Date: Thu, 5 Jul 2007 09:06:16 GMT From: Gabor Kovesdan <gabor@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 122925 for review Message-ID: <200707050906.l6596GnE036697@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=122925 Change 122925 by gabor@gabor_server on 2007/07/05 09:05:54 - Check in latest changes to mounting. Very experimental. Affected files ... .. //depot/projects/soc2006/gabor_destdir/Mk/bsd.destdir.mk#18 edit Differences ... ==== //depot/projects/soc2006/gabor_destdir/Mk/bsd.destdir.mk#18 (text+ko) ==== @@ -45,12 +45,14 @@ DESTDIR_ENV_LIST?= -DESTDIR_ENV= DESTDIR= CHROOTED=YES PORTSDIR=${PORTSDIR_TMP_REL} +DESTDIR_ENV= DESTDIR= CHROOTED=YES -.for _var in ${DESTDIR_ENV_LIST:NDESTDIR:NCHROOTED:NPORTSDIR} +.for _var in ${DESTDIR_ENV_LIST:NDESTDIR:NCHROOTED} DESTDIR_ENV+= ${_var}="${${_var}}" .endfor +DESTDIR_MOUNT_LIST?= PORTSDIR:${PORTSDIR} + .for _target in ${.TARGETS} ${_target}: pre-chroot do-chroot @${TRUE} @@ -62,14 +64,32 @@ .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: - ${ECHO_CMD} "===> Nullmounting ports tree into ${DESTDIR}..."; \ - ${MOUNT_NULLFS} ${PORTSDIR} ${DESTDIR}${PORTSDIR_TMP_REL}; \ + @for _entry in ${DESTDIR_MOUNT_LIST}; do \ + _var= `${ECHO_CMD} $${_entry} | ${SED} -e 's/:.*//'`; \ + _path1= `${ECHO_CMD} $${_entry} | ${SED} -e 's/[^:]*://'`; \ + _path2= `${ECHO_CMD} $${_path1} | ${SED} -e 's/.*://'`; \ + echo "$${_var} $${_path1} $${_path2}"; \ + if [ $${_path1} = $${_path2} ]; then \ + _tmpdir= `${MKTEMP} -d ${DESTDIR}/tmp/tmpdir.XXXXXX`; \ + _tmpdir_rel= `${ECHO_CMD} $${_tmpdir} | ${SED} -e 's|^${DESTDIR}||'`; \ + if [ $${_var} = PORTSDIR ]; then \ + _builddir= ${ECHO_CMD} ${.CURDIR} | ${SED} -e 's|^${PORTSDIR}||' -e 's|^|$${_tmpdir_rel}|'; \ + fi; \ + _tmp= "$${_destdir_env}"; \ + _destdir_env= "$${_tmp} $${_var}=$${_tmpdir_rel}"; \ + echo "$${_destdir_env}"; \ + ${MOUNT_NULLFS} $${_path1} ${DESTDIR}${_tmpdir_rel}; \ + else \ + if [ $${_var} = PORTSDIR ]; then \ + _builddir= ${ECHO_CMD} ${.CURDIR} | ${SED} -e 's|^${PORTSDIR}||' -e 's|^|$${_tmpdir_rel}|'; \ + fi; \ + _tmp= "$${_destdir_env}"; \ + _destdir_env= "$${_tmp} $${_var}=$${_path2}"; \ + ${MOUNT_NULLFS} $${_path1} ${DESTDIR}/$${_path2}; \ + fi; \ + done; \ + echo "$${_destdir_env}"; \ found=0; \ for _entry in `${MOUNT} | ${GREP} devfs | ${AWK} {'print $$3'}`; do \ if [ `${REALPATH} $${_entry}` = `${REALPATH} ${DESTDIR}/dev` ]; then \ @@ -81,9 +101,7 @@ ${MOUNT_DEVFS} ${DESTDIR}/dev; \ fi; \ ${ECHO_CMD} "===> Starting chrooted make in ${DESTDIR}..."; \ - ${CHROOT} ${DESTDIR} ${SH} -c "(cd ${BUILDDIR}; ${SETENV} -i ${DESTDIR_ENV} ${MAKE} ${.TARGETS})"; \ - ${UMOUNT} ${DESTDIR}${PORTSDIR_TMP_REL}; \ - ${RMDIR} ${DESTDIR}${PORTSDIR_TMP_REL} + ${CHROOT} ${DESTDIR} ${SH} -c "(cd $${_builddir}; ${SETENV} -i ${DESTDIR_ENV} $${_destdir_env} ${MAKE} ${.TARGETS})" .endif .endif
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200707050906.l6596GnE036697>