summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-03-01 08:30:13 +0000
committerZac Medico <zmedico@gentoo.org>2008-03-01 08:30:13 +0000
commit8fc64639748d9b5382bddeffffc41d12f672ed00 (patch)
tree798105ce32a3919f1eec2dd2297a08f25138bc11
parent7e244d16419f05e1072b2ef40dfea77702f81ed6 (diff)
downloadportage-8fc64639748d9b5382bddeffffc41d12f672ed00.tar.gz
portage-8fc64639748d9b5382bddeffffc41d12f672ed00.tar.bz2
portage-8fc64639748d9b5382bddeffffc41d12f672ed00.zip
Bug #211949 - Make filter_readonly_variables() remove any variables
with names containing a hyphen since bash does not allow them. svn path=/main/trunk/; revision=9402
-rwxr-xr-xbin/ebuild.sh10
1 files changed, 7 insertions, 3 deletions
diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 2f48e76e7..1e0af3e24 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -1389,8 +1389,12 @@ PORTAGE_MUTABLE_FILTERED_VARS="AA HOSTNAME"
# @FUNCTION: filter_readonly_variables
# @DESCRIPTION: [--filter-sandbox] [--allow-extra-vars]
-# Read an environment from stdin and echo to stdout while filtering readonly
-# variables.
+# Read an environment from stdin and echo to stdout while filtering variables
+# with names that are known to cause interference:
+#
+# * some specific variables for which bash does not allow assignment
+# * any variables with names containing a hyphen (not allowed by bash)
+# * some specific variables that affect portage or sandbox behavior
#
# --filter-sandbox causes all SANDBOX_* variables to be filtered, which
# is only desired in certain cases, such as during preprocessing or when
@@ -1419,7 +1423,7 @@ filter_readonly_variables() {
SANDBOX_DEBUG_LOG SANDBOX_DISABLED SANDBOX_LIB
SANDBOX_LOG SANDBOX_ON"
filtered_vars="${readonly_bash_vars} ${READONLY_PORTAGE_VARS}
- BASH_[_[:alnum:]]* PATH"
+ BASH_[_[:alnum:]]* PATH [-_[:alnum:]]*-[-_[:alnum:]]*"
if hasq --filter-sandbox $* ; then
filtered_vars="${filtered_vars} SANDBOX_[_[:alnum:]]*"
else