Check-in [edb3e6b0f7]

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

Overview
Comment:make install works with pkg_install

First step should be done, now testing is needed and extending

Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: edb3e6b0f7e70b5c04acaa323a42145e89a2cb8c
User & Date: bapt 2012-06-07 14:21:54
Context
2012-06-07
18:35
Fix @cwd handling check-in: 0fe0b30033 user: bdrewery tags: trunk
14:21
make install works with pkg_install

First step should be done, now testing is needed and extending check-in: edb3e6b0f7 user: bapt tags: trunk

13:58
Remove debug check-in: 0112cb835a user: bapt tags: trunk
Changes

Changes to ports/Mk/bsd.port.mk.

3887
3888
3889
3890
3891
3892
3893





3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
.endif
.endif
.endif

# Package

.if !target(do-package)





do-package: ${TMPPLIST}
	@if [ -d ${PACKAGES} ]; then \
		if [ ! -d ${PKGREPOSITORY} ]; then \
			if ! ${MKDIR} ${PKGREPOSITORY}; then \
				${ECHO_MSG} "=> Can't create directory ${PKGREPOSITORY}."; \
				exit 1; \
			fi; \
		fi; \
	fi
	@if ${PKG_CMD} -b ${PKGNAME} ${PKGFILE}; then \
		if [ -d ${PACKAGES} ]; then \
			cd ${.CURDIR} && eval ${MAKE} package-links; \
		fi; \
	else \
		cd ${.CURDIR} && eval ${MAKE} delete-package; \
		exit 1; \
	fi







>
>
>
>
>









|







3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
.endif
.endif
.endif

# Package

.if !target(do-package)
.if ${USE_STAGE:L} == yes
STAGE_ARGS=	${PKG_ARGS} -S ${STAGEDIR}
.else
STAGE_ARGS= -b ${PKGNAME}
.endif
do-package: ${TMPPLIST}
	@if [ -d ${PACKAGES} ]; then \
		if [ ! -d ${PKGREPOSITORY} ]; then \
			if ! ${MKDIR} ${PKGREPOSITORY}; then \
				${ECHO_MSG} "=> Can't create directory ${PKGREPOSITORY}."; \
				exit 1; \
			fi; \
		fi; \
	fi
	@if ${PKG_CMD} ${STAGE_ARGS} ${PKGFILE}; then \
		if [ -d ${PACKAGES} ]; then \
			cd ${.CURDIR} && eval ${MAKE} package-links; \
		fi; \
	else \
		cd ${.CURDIR} && eval ${MAKE} delete-package; \
		exit 1; \
	fi

Changes to ports/Mk/bsd.stage.mk.

20
21
22
23
24
25
26
27
28
29
30
31
32
33
34

.if !target(sync-from-stage)
sync-from-stage:
.if defined(WITH_PKGNG)
	@${DO_NADA}
.else
	@${ECHO_MSG} "===> Syncing from stagedir"
	@${SH} ${PORTSDIR}/Tools/sync_from_stage.sh -f ${STAGEDIR} -p ${TMPPLIST} -P ${PREFIX}
	
	@if [ -f ${PKGINSTALL} ]; then \
		${SH} ${PKGINSTALL} POST-INSTALL; \
	fi
	@[ -f ${PKGMESSAGE} ] && ${CAT} ${PKGMESSAGE} || return 0
.endif
.endif







|







20
21
22
23
24
25
26
27
28
29
30
31
32
33
34

.if !target(sync-from-stage)
sync-from-stage:
.if defined(WITH_PKGNG)
	@${DO_NADA}
.else
	@${ECHO_MSG} "===> Syncing from stagedir"
	@${SH} ${PORTSDIR}/Tools/scripts/sync_from_stage.sh -f ${STAGEDIR} -p ${TMPPLIST} -P ${PREFIX}
	
	@if [ -f ${PKGINSTALL} ]; then \
		${SH} ${PKGINSTALL} POST-INSTALL; \
	fi
	@[ -f ${PKGMESSAGE} ] && ${CAT} ${PKGMESSAGE} || return 0
.endif
.endif

Name change from ports/Tools/sync_from_stage.sh to ports/Tools/scripts/sync_from_stage.sh.

26
27
28
29
30
31
32

33
34
35
36
37
38
39
40


41
42
43
44
45
46
47
..
50
51
52
53
54
55
56

57
58
59
60
61
62
63
64
65
66
67

68

69
70
71
72
73
[ -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#* } ;;
................................................................................
		@*) ${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







>





|


>
>







 







>
|
<





|



>
|
>





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
..
53
54
55
56
57
58
59
60
61

62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
[ -d ${WRKDIR} ] || usage

PAXLIST=${WRKDIR}/.pax

cd ${STAGEDIR}
tmpprefix=${PREFIX}
tmplastplist="";
:> ${PAXLIST}
while read line; do
	case $line in
		@unexec*) ;;
		@ignore*) ;;
		@dirrm*)
			echo ./${tmpprefix}/${line#* } >> ${PAXLIST}
			;;
		@comment*) ;;
		@cwd) tmpprefix=${PREFIX} ;;
		@cwd*) tmpprefix=${line# } ;;
		@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#* } ;;
................................................................................
		@*) ${DO_NADA} ;;
		*)
			tmplastplist=$line ;
			chown ${tmpowner:-root}:${tmgroup:-wheel} ./$tmpprefix/$line
			if [ -n "$tmpmode" ]; then
				chmod $tmpmode ./$tmpprefix/$line
			fi
			echo "./${tmpprefix}/${line}" >> ${PAXLIST}
		;;

	esac
done < ${PLIST}

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

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