Check-in [d0812f289d]

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

Overview
Comment:in all cases @exec can safely be run as post-install at once.

No need to split all the execution

Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:d0812f289d4bda54af87687cf0e85399820d525a
User & Date: bapt 2012-06-20 06:22:10
Context
2012-06-21
05:24
Fix @exec being executed and fix pax(1) typo check-in: 208359bb45 user: bdrewery tags: trunk
2012-06-20
06:22
in all cases @exec can safely be run as post-install at once.

No need to split all the execution check-in: d0812f289d user: bapt tags: trunk

2012-06-19
14:32
Sort by the inode to ensure all are processed together in order check-in: eb54d44aaa user: bdrewery tags: trunk
Changes

Changes to ports/Tools/scripts/sync_from_stage.sh.

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
..
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98

99
[ -z ${STAGEDIR} ] && usage
[ -z ${PLIST} ] && usage
[ -f ${PLIST} ] || usage
test -d ${STAGEDIR} || usage
test -d ${WRKDIR} || usage

PAXLIST=${WRKDIR}/.pax


cd ${STAGEDIR}
tmpprefix=${PREFIX}
tmplastplist="";
:> ${PAXLIST}

while read line; do
	case $line in
		@unexec*) ;;
		@ignore*) ;;
		@dirrm*)
			test -d "${STAGEDIR}/${tmpprefix}/${line#* }" || ERRS="${ERRS} ${line}"

			;;
		@comment*) ;;
		@cwd) tmpprefix=${PREFIX} ;;
		@cwd*) tmpprefix=${line#* } ;;
		@exec*)
			dirname=${tmplastplist%/*}
			basename=${tmplastplist##*/}
			echo ${line} | sed -e "s,%D,${PREFIX},g" -e "s,%F,${tmplastplist},g" -e "s,%B,${tmpprefix}/${dirname},g" -e "s,%f,${basename},g" >> ${PAXLIST}




			;;
		@mode) unset tmpmode ;;
		@mode*) tmpmode=${line#* } ;;
		@owner) unset tmpowner ;;
		@owner*) tmpowner=${line#* } ;;
		@group) unset tmpgroup ;;
		@group*) tmpgroup=${line#* } ;;
................................................................................
	echo "=====> Some files or directory from the plist cannot be found:"
	for err in ${ERRS}; do
		echo $err
	done
	exit 1

fi
while read line; do
	case $line in
		@*) echo ${line#* } | sh
			;;
		*)
			echo ${line} | pax -p e -drw /
			;;
	esac
done < ${PAXLIST}

# Fix hardlinks by linking each file to the previous if the inodes match
find ${STAGEDIR} -type f -links +1 -ls|awk '{print $1 " " $11}'| sort -n -k 1 | while read line; do
	set -- $line
	tmpinode=$1
	tmpfile=${2##${STAGEDIR}}

	if [ "${tmpinode}" = "${lastinode}" ]; then
		ln -f ${lastfile} ${tmpfile}
	fi
	lastinode=$tmpinode
	lastfile=$tmpfile
done

exit 0







>





>





|
>







|
>
>
>
>







 







<
<
<
<
<
<
<
<
|
<
<
<
<
<
<
<
<
<
<
<
<
<
>

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
..
77
78
79
80
81
82
83








84













85
86
[ -z ${STAGEDIR} ] && usage
[ -z ${PLIST} ] && usage
[ -f ${PLIST} ] || usage
test -d ${STAGEDIR} || usage
test -d ${WRKDIR} || usage

PAXLIST=${WRKDIR}/.pax
EXECLIST=${WRKSRC}/.exec

cd ${STAGEDIR}
tmpprefix=${PREFIX}
tmplastplist="";
:> ${PAXLIST}
:> ${EXECLIST}
while read line; do
	case $line in
		@unexec*) ;;
		@ignore*) ;;
		@dirrm*)
			test -d "${STAGEDIR}/${tmpprefix}/${line#* }" || \
				ERRS="${ERRS} ${line}"
			;;
		@comment*) ;;
		@cwd) tmpprefix=${PREFIX} ;;
		@cwd*) tmpprefix=${line#* } ;;
		@exec*)
			dirname=${tmplastplist%/*}
			basename=${tmplastplist##*/}
			echo ${line} | sed -e "s,%D,${PREFIX},g" \
			    -e "s,%F,${tmplastplist},g" \
			    -e "s,%B,${tmpprefix}/${dirname},g" \
			    -e "s,%f,${basename},g" \
			    >> ${EXECLIST}
			;;
		@mode) unset tmpmode ;;
		@mode*) tmpmode=${line#* } ;;
		@owner) unset tmpowner ;;
		@owner*) tmpowner=${line#* } ;;
		@group) unset tmpgroup ;;
		@group*) tmpgroup=${line#* } ;;
................................................................................
	echo "=====> Some files or directory from the plist cannot be found:"
	for err in ${ERRS}; do
		echo $err
	done
	exit 1

fi








cat ${PAXLIST} | px -p e -drw /













cat ${EXECLIST} | sh
exit 0