PERFORCE change 122323 for review

Gabor Kovesdan gabor at FreeBSD.org
Tue Jun 26 06:47:05 UTC 2007


http://perforce.freebsd.org/chv.cgi?CH=122323

Change 122323 by gabor at 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 at 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)


More information about the p4-projects mailing list