Date: Tue, 26 Jun 2007 06:47:04 GMT From: Gabor Kovesdan <gabor@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 122323 for review Message-ID: <200706260647.l5Q6l4ft090455@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=122323 Change 122323 by gabor@gabor_server on 2007/06/26 06:46:17 Add DESTDIR_ENV_LIST to allow overriding variables from outside. Only those variables are passed to the chrooted make, which are listed in DESTDIR_ENV_LIST. The reason behind this is to avoid passing something accidentally from the host environment. Let's suppose you have set PREFIX=/opt in the host environment. With a constant variable list, the destination environment would inherit this, as well. Affected files ... .. //depot/projects/soc2006/gabor_destdir/Mk/bsd.destdir.mk#2 edit Differences ... ==== //depot/projects/soc2006/gabor_destdir/Mk/bsd.destdir.mk#2 (text+ko) ==== @@ -11,6 +11,20 @@ DESTDIR_Include_MAINTAINER= portmgr@FreeBSD.org +# Place variable names into DESTDIR_ENV_LIST, which you want to override in +# the DESTDIR environment from outside. E.g.: +# +# make DESTDIR=/foo/bar PREFIX=/opt DESTDIR_ENV_LIST=PREFIX +# + +DESTDIR_ENV_LIST?= + +DESTDIR_ENV= DESTDIR= CHROOTED=YES + +.for _var in ${DESTDIR_ENV_LIST} +DESTDIR_ENV+= ${_var}="${${_var}}" +.endfor + .for _target in ${.TARGETS} ${_target}: pre-chroot do-chroot post-chroot @${TRUE} @@ -39,7 +53,7 @@ ${MOUNT} -t devfs devfs ${DESTDIR}/dev .endif ${ECHO_CMD} "===> Starting chrooted make in ${DESTDIR}..."; \ - ${CHROOT} ${DESTDIR} ${SH} -c "(cd ${.CURDIR}; ${MAKE} DESTDIR= CHROOTED=YES ${.TARGETS})" + ${CHROOT} ${DESTDIR} ${SH} -c "(cd ${.CURDIR}; ${MAKE} ${DESTDIR_ENV} ${.TARGETS})" .endif .if !target(post-chroot)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200706260647.l5Q6l4ft090455>