Date: Tue, 26 Jun 2007 07:04:27 GMT From: Gabor Kovesdan <gabor@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 122325 for review Message-ID: <200706260704.l5Q74RBK093239@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=122325 Change 122325 by gabor@gabor_server on 2007/06/26 07:03:29 Use safe mounting of PORTSDIR with mktemp(1). We need to this to avoid odd cases, where the destination environment already has a different version of ports tree somehow. Thus it is not enough to check the existence of the ports tree. E.g. if we want to install foobar-1.0, we don't want to have foobar-0.9 in the destination due to an outdated leftover ports tree. Affected files ... .. //depot/projects/soc2006/gabor_destdir/Mk/bsd.destdir.mk#3 edit Differences ... ==== //depot/projects/soc2006/gabor_destdir/Mk/bsd.destdir.mk#3 (text+ko) ==== @@ -19,7 +19,7 @@ DESTDIR_ENV_LIST?= -DESTDIR_ENV= DESTDIR= CHROOTED=YES +DESTDIR_ENV= DESTDIR= CHROOTED=YES PORTSDIR=${PORTSDIR_TMP_REL} .for _var in ${DESTDIR_ENV_LIST} DESTDIR_ENV+= ${_var}="${${_var}}" @@ -36,24 +36,21 @@ .endif .if !target(do-chroot) + +PORTSDIR_TMP!= ${MKTEMP} -d ${DESTDIR}/tmp/portsdir.XXXXXX +PORTSDIR_TMP_REL= ${PORTSDIR_TMP:S,^${DESTDIR},,} +BUILDDIR= ${.CURDIR:S,^${PORTSDIR},,:S,^,${PORTSDIR_TMP_REL},} + do-chroot: - ${MKDIR} ${DESTDIR}${PORTSDIR} -# found=0; \ -# for i in `${MOUNT} | ${AWK} {'print $$3'}` ; do \ -# if [ `${REALPATH} ${DESTDIR}${PORTSDIR}` == `${REALPATH} $${i}` ]; then \ -# found=1; \ -# fi ; \ -# done ; \ -# if [ $${found} != 1 ]; then \ -# ${ECHO_CMD} "===> Nullmounting ${PORTSDIR} into ${DESTDIR}..."; \ -# ${MOUNT} -t nullfs ${PORTSDIR} ${DESTDIR}${PORTSDIR}; \ -# fi + ${ECHO_CMD} "===> Nullmounting ports tree into ${DESTDIR}..."; \ + ${MOUNT} -t nullfs ${PORTSDIR} ${DESTDIR}${PORTSDIR_TMP_REL} .if !exists (${DESTDIR}/dev/null) ${ECHO_CMD} "===> Mounting devfs into ${DESTDIR}..."; \ ${MOUNT} -t devfs devfs ${DESTDIR}/dev .endif ${ECHO_CMD} "===> Starting chrooted make in ${DESTDIR}..."; \ - ${CHROOT} ${DESTDIR} ${SH} -c "(cd ${.CURDIR}; ${MAKE} ${DESTDIR_ENV} ${.TARGETS})" + ${CHROOT} ${DESTDIR} ${SH} -c "(cd ${BUILDDIR}; ${MAKE} ${DESTDIR_ENV} ${.TARGETS})"; \ + ${UMOUNT} ${DESTDIR}${PORTSDIR_TMP_REL} .endif .if !target(post-chroot)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200706260704.l5Q74RBK093239>