Check-in [e8cddc8cfa]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Sync first check the consistency of the plist
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: e8cddc8cfaa99be80f5550f815cb80219e76d367
User & Date: bapt 2012-06-07 10:14:38
Context
2012-06-07
10:45
Preliminary make genplist target check-in: 582f3b845d user: bapt tags: trunk
10:14
Sync first check the consistency of the plist check-in: e8cddc8cfa user: bapt tags: trunk
08:03
New knob FORCE_STAGE to allow exp-run with stage activated for everyone check-in: 226c50ffdf user: bapt tags: trunk
Changes

Changes to ports/Tools/sync_from_stage.sh.

5
6
7
8
9
10
11
12
13
14
15
16

17
18
19
20
21
22
23
24



25
26
27
28
29
30
31
32
33


34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53

54
55
56












57
	echo "$0 -f stagedir -p plist -P prefix
Parameters:
  -f stagedir: patch to the stagedir root
  -p plist: path to the plist
"
	exit 1
}
while getopts "f:p:P:" flag; do
	case "${flag}" in
		f) STAGEDIR=${OPTARG} ;;
		p) PLIST=${OPTARG} ;;
		P) PREFIX=${OPTARG} ;;

	esac
done

: ${PREFIX:=/usr/local}
[ -z ${STAGEDIR} ] && usage
[ -z ${PLIST} ] && usage
[ -f ${PLIST} ] || usage
[ -d ${STAGEDR} ] || usage




cd ${STAGEDIR}
tmpprefix=${PREFIX}
tmplastplist="";
while read line; do
	case $line in
		@unexec*) ;;
		@ignore*) ;;
		@dirrm*) ;;


		@comment*) ;;
		@exec*)
			echo ${line# } | sed -e "s,%D,${PREFIX},g" -e "s,%F,${tmplastplist},g" -e "s,%B,`dirname ${tmplastplist}`,g" -e "s,%f,`basename ${tmpprefix}/${tmplastplist}`,g" | sh
			;;
		@mode) unset tmpmode ;;
		@mode*) tmpmode=${line#* } ;;
		@owner) unset tmpowner ;;
		@owner*) tmpowner=${line#* } ;;
		@group) unset tmpgroup ;;
		@group*) tmpgroup=${line#* } ;;
		@*) ${DO_NADA} ;;
		*)
			tmplastplist=$line ;
			if [ -n "$tmpgroup" -a -n "$tmpowner" ]; then
				chown ${tmpowner}:${tmgroup} ./$tmpprefix/$line
			fi
			if [ -n "$tmpmode" ]; then
				chmod $tmpmode ./$tmpprefix/$line
			fi
			;;

	esac
done < ${PLIST}
pax -p e -rw "./${tmpprefix}/${line}" /












exit 0







|




>








>
>
>








|
>
>













|
<
<




>


<
>
>
>
>
>
>
>
>
>
>
>
>

5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53


54
55
56
57
58
59
60

61
62
63
64
65
66
67
68
69
70
71
72
73
	echo "$0 -f stagedir -p plist -P prefix
Parameters:
  -f stagedir: patch to the stagedir root
  -p plist: path to the plist
"
	exit 1
}
while getopts "f:p:P:w:" flag; do
	case "${flag}" in
		f) STAGEDIR=${OPTARG} ;;
		p) PLIST=${OPTARG} ;;
		P) PREFIX=${OPTARG} ;;
		w) WRKDIR=${OPTARG} ;;
	esac
done

: ${PREFIX:=/usr/local}
[ -z ${STAGEDIR} ] && usage
[ -z ${PLIST} ] && usage
[ -f ${PLIST} ] || usage
[ -d ${STAGEDR} ] || usage
[ -d ${WRKDIR} ] || usage

PAXLIST=${WRKDIR}/.pax

cd ${STAGEDIR}
tmpprefix=${PREFIX}
tmplastplist="";
while read line; do
	case $line in
		@unexec*) ;;
		@ignore*) ;;
		@dirrm*)
			echo ${line#* } > ${PAXLIST}
			;;
		@comment*) ;;
		@exec*)
			echo ${line# } | sed -e "s,%D,${PREFIX},g" -e "s,%F,${tmplastplist},g" -e "s,%B,`dirname ${tmplastplist}`,g" -e "s,%f,`basename ${tmpprefix}/${tmplastplist}`,g" | sh
			;;
		@mode) unset tmpmode ;;
		@mode*) tmpmode=${line#* } ;;
		@owner) unset tmpowner ;;
		@owner*) tmpowner=${line#* } ;;
		@group) unset tmpgroup ;;
		@group*) tmpgroup=${line#* } ;;
		@*) ${DO_NADA} ;;
		*)
			tmplastplist=$line ;
			chown ${tmpowner:-root}:${tmgroup:-wheel} ./$tmpprefix/$line


			if [ -n "$tmpmode" ]; then
				chmod $tmpmode ./$tmpprefix/$line
			fi
			;;
			echo "./${line}" > ${PAXLIST}
	esac
done < ${PLIST}


# sanity check
while read line; do
	[ -e ${STAGEDIR}/$line ] || ERRS="${ERRS}\n${line}"
done < ${PAXLIST}
if [ -n "${ERRS}" ]; then
	echo "=====> Some files or directory from the plist cannot be found:"
	echo ${ERRS}
	exit 1

fi
cat ${PAXLIST} | pax -p e -drw /
exit 0