Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Oct 2015 00:03:10 +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: r399171 - head/Mk/Scripts
Message-ID:  <201510130003.t9D03ARi091869@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bdrewery
Date: Tue Oct 13 00:03:10 2015
New Revision: 399171
URL: https://svnweb.freebsd.org/changeset/ports/399171

Log:
  Follow-up r399170 with a script, ports_env.sh, that can be used for the purpose.
  
  This will allow Poudriere to know if it is possible to use the feature or not
  by the existence of the file.
  
  Also fix quoting issues.
  
  With hat:	portmgr

Added:
  head/Mk/Scripts/ports_env.sh   (contents, props changed)
Modified:
  head/Mk/Scripts/functions.sh

Modified: head/Mk/Scripts/functions.sh
==============================================================================
--- head/Mk/Scripts/functions.sh	Mon Oct 12 23:41:36 2015	(r399170)
+++ head/Mk/Scripts/functions.sh	Tue Oct 13 00:03:10 2015	(r399171)
@@ -159,7 +159,7 @@ validate_env() {
 	fi
 }
 
-export_index_env() {
+export_ports_env() {
 	local export_vars make_cmd make_env var results value
 
 	validate_env MAKE PORTSDIR
@@ -192,7 +192,7 @@ export_index_env() {
 	"
 
 	for var in ${export_vars}; do
-		make_cmd="${make_cmd}${make_cmd:+ }-V ${var}=\${${var}}"
+		make_cmd="${make_cmd}${make_cmd:+ }-V ${var}=\${${var}:Q}"
 	done
 
 	# Bring in all the vars, but not empty ones.
@@ -205,7 +205,7 @@ export_index_env() {
 
 		if [ -n "${value}" ]; then
 			export ${var}
-			echo "export ${var}=${value}"
+			echo "export ${var}=\"${value}\""
 		fi
 	done
 }

Added: head/Mk/Scripts/ports_env.sh
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/Mk/Scripts/ports_env.sh	Tue Oct 13 00:03:10 2015	(r399171)
@@ -0,0 +1,13 @@
+#! /bin/sh
+
+# MAINTAINER: portmgr@FreeBSD.org
+# $FreeBSD$
+
+if [ -z "${SCRIPTSDIR}" ]; then
+	echo "Must set SCRIPTSDIR" >&2
+	exit 1
+fi
+
+. ${SCRIPTSDIR}/functions.sh
+
+export_ports_env



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