summaryrefslogtreecommitdiff
path: root/Mk
diff options
context:
space:
mode:
authorBryan Drewery <bdrewery@FreeBSD.org>2015-10-13 00:03:10 +0000
committerBryan Drewery <bdrewery@FreeBSD.org>2015-10-13 00:03:10 +0000
commit481f66bd216c6811ff6496f5b4c7301788eeca41 (patch)
tree0fab9e768b3ad1910f5c578714bbb12390cb9b86 /Mk
parentAdd a function to export vars that bsd.port.mk generates from fork/exec. (diff)
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
Notes
Notes: svn path=/head/; revision=399171
Diffstat (limited to 'Mk')
-rw-r--r--Mk/Scripts/functions.sh6
-rw-r--r--Mk/Scripts/ports_env.sh13
2 files changed, 16 insertions, 3 deletions
diff --git a/Mk/Scripts/functions.sh b/Mk/Scripts/functions.sh
index 701397e4d58d..58175d725726 100644
--- a/Mk/Scripts/functions.sh
+++ b/Mk/Scripts/functions.sh
@@ -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
}
diff --git a/Mk/Scripts/ports_env.sh b/Mk/Scripts/ports_env.sh
new file mode 100644
index 000000000000..7d1d861bf28e
--- /dev/null
+++ b/Mk/Scripts/ports_env.sh
@@ -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