Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Oct 2015 22:42:57 +0000 (UTC)
From:      Bryan Drewery <bdrewery@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r399163 - head/Mk
Message-ID:  <201510122242.t9CMgvFP068126@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bdrewery
Date: Mon Oct 12 22:42:57 2015
New Revision: 399163
URL: https://svnweb.freebsd.org/changeset/ports/399163

Log:
  Apply export handling fixes from bsd.port.mk.
  
   - r399153: Use :Q.
   - r399155: Use a loop to export vars
  
  With hat:	portmgr

Modified:
  head/Mk/bsd.port.subdir.mk

Modified: head/Mk/bsd.port.subdir.mk
==============================================================================
--- head/Mk/bsd.port.subdir.mk	Mon Oct 12 22:41:34 2015	(r399162)
+++ head/Mk/bsd.port.subdir.mk	Mon Oct 12 22:42:57 2015	(r399163)
@@ -63,6 +63,7 @@ STRIP?=	-s
 .if !defined(ARCH)
 ARCH!=	${UNAME} -p
 .endif
+_EXPORTED_VARS+=	ARCH
 
 .if !defined(OSVERSION)
 .if exists(/usr/include/sys/param.h)
@@ -73,20 +74,24 @@ OSVERSION!=	${AWK} '/^\#define[[:blank:]
 OSVERSION!=	${SYSCTL} -n kern.osreldate
 .endif
 .endif
+_EXPORTED_VARS+=	OSVERSION
 
 WITH_PKG=	yes
 WITH_PKGNG=	yes
 
 .if !defined(_OSRELEASE)
-_OSRELEASE!=			${UNAME} -r
+_OSRELEASE!=		${UNAME} -r
 .endif
+_EXPORTED_VARS+=	_OSRELEASE
 .if !defined(OSREL)
 OSREL=	${_OSRELEASE:C/[-(].*//}
 .endif
+_EXPORTED_VARS+=	OSREL
 
 .if !defined(OPSYS)
 OPSYS!=	${UNAME} -s
 .endif
+_EXPORTED_VARS+=	OPSYS
 
 .if ${ARCH} == "amd64" || ${ARCH} =="ia64"
 .if !defined(HAVE_COMPAT_IA32_KERN)
@@ -96,30 +101,37 @@ HAVE_COMPAT_IA32_KERN!= if ${SYSCTL} -n 
 .endif
 .endif
 .endif
+_EXPORTED_VARS+=	HAVE_COMPAT_IA32_KERN
 
 .if !defined(CONFIGURE_MAX_CMD_LEN)
 CONFIGURE_MAX_CMD_LEN!= ${SYSCTL} -n kern.argmax
 .endif
+_EXPORTED_VARS+=	CONFIGURE_MAX_CMD_LEN
 
 .if !defined(_JAVA_VERSION_LIST_REGEXP)
 _JAVA_VERSION_LIST_REGEXP!=	${MAKE} -V _JAVA_VERSION_LIST_REGEXP USE_JAVA=1 -f ${PORTSDIR}/Mk/bsd.port.mk
 .endif
+_EXPORTED_VARS+=	_JAVA_VERSION_LIST_REGEXP
 
 .if !defined(_JAVA_VENDOR_LIST_REGEXP)
 _JAVA_VENDOR_LIST_REGEXP!=	${MAKE} -V _JAVA_VENDOR_LIST_REGEXP USE_JAVA=1 -f ${PORTSDIR}/Mk/bsd.port.mk
 .endif
+_EXPORTED_VARS+=	_JAVA_VENDOR_LIST_REGEXP
 
 .if !defined(_JAVA_OS_LIST_REGEXP)
 _JAVA_OS_LIST_REGEXP!=		${MAKE} -V _JAVA_OS_LIST_REGEXP USE_JAVA=1 -f ${PORTSDIR}/Mk/bsd.port.mk
 .endif
+_EXPORTED_VARS+=	_JAVA_OS_LIST_REGEXP
 
 .if !defined(_JAVA_PORTS_INSTALLED)
 _JAVA_PORTS_INSTALLED!=		${MAKE} -V _JAVA_PORTS_INSTALLED USE_JAVA=1 -f ${PORTSDIR}/Mk/bsd.port.mk
 .endif
+_EXPORTED_VARS+=	_JAVA_PORTS_INSTALLED
 
 .if !defined(UID)
 UID!=	${ID} -u
 .endif
+_EXPORTED_VARS+=	UID
 
 .endif
 
@@ -336,20 +348,12 @@ README.html:
 	@${RM} -f $@.tmp $@.tmp2 $@.tmp3 $@.tmp4
 
 # Pass in the cached invariant variables to child makes.
-# XXX Why are we trying to escape these characters using regexps and not using ':Q'?
 .if !defined(NOPRECIOUSMAKEVARS)
-.MAKEFLAGS: \
-	ARCH="${ARCH:S/"/"'"'"/g:S/\$/\$\$/g:S/\\/\\\\/g}" \
-	OPSYS="${OPSYS:S/"/"'"'"/g:S/\$/\$\$/g:S/\\/\\\\/g}" \
-	OSREL="${OSREL:S/"/"'"'"/g:S/\$/\$\$/g:S/\\/\\\\/g}" \
-	OSVERSION="${OSVERSION:S/"/"'"'"/g:S/\$/\$\$/g:S/\\/\\\\/g}" \
-	UID="${UID:S/"/"'"'"/g:S/\$/\$\$/g:S/\\/\\\\/g}" \
-	HAVE_COMPAT_IA32_KERN="${HAVE_COMPAT_IA32_KERN}" \
-	CONFIGURE_MAX_CMD_LEN="${CONFIGURE_MAX_CMD_LEN}" \
-	_JAVA_VERSION_LIST_REGEXP="${_JAVA_VERSION_LIST_REGEXP:Q}" \
-	_JAVA_VENDOR_LIST_REGEXP="${_JAVA_VENDOR_LIST_REGEXP:Q}" \
-	_JAVA_OS_LIST_REGEXP="${_JAVA_OS_LIST_REGEXP:Q}" \
-	_JAVA_PORTS_INSTALLED="${_JAVA_PORTS_INSTALLED}"
+.for var in ${_EXPORTED_VARS}
+.if empty(.MAKEFLAGS:M${var}=*) && !empty(${var})
+.MAKEFLAGS:	${var}=${${var}:Q}
+.endif
+.endfor
 .endif
 
 PORTSEARCH_DISPLAY_FIELDS?=name,path,info,maint,index,bdeps,rdeps,www



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201510122242.t9CMgvFP068126>