From 07f7ba64e55c52e14f8509fc519cb0648f5c6a55 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Fri, 14 Mar 2008 18:20:49 +0000 Subject: Sync the fixes for bug #211949 from trunk. svn path=/main/branches/2.1.2/; revision=9465 --- bin/ebuild.sh | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) (limited to 'bin/ebuild.sh') diff --git a/bin/ebuild.sh b/bin/ebuild.sh index 2f17d0e7e..3cf834f6b 100755 --- a/bin/ebuild.sh +++ b/bin/ebuild.sh @@ -1412,18 +1412,16 @@ PORTAGE_MUTABLE_FILTERED_VARS="AA HOSTNAME" # builtin command. To avoid this problem, this function filters those # variables out and discards them. See bug #190128. filter_readonly_variables() { - local x filtered_vars var_grep + local x filtered_vars local readonly_bash_vars="DIRSTACK EUID FUNCNAME GROUPS PIPESTATUS PPID SHELLOPTS UID" local filtered_sandbox_vars="SANDBOX_ACTIVE SANDBOX_BASHRC SANDBOX_DEBUG_LOG SANDBOX_DISABLED SANDBOX_LIB SANDBOX_LOG SANDBOX_ON" filtered_vars="${readonly_bash_vars} ${READONLY_PORTAGE_VARS} - BASH_[_[:alnum:]]* PATH - [[:digit:]][_[:alnum:]]* - [^=[:space:]]*[^_[:alnum:]=[:space:]][^=[:space:]]*" + BASH_.* PATH" if hasq --filter-sandbox $* ; then - filtered_vars="${filtered_vars} SANDBOX_[_[:alnum:]]*" + filtered_vars="${filtered_vars} SANDBOX_.*" else filtered_vars="${filtered_vars} ${filtered_sandbox_vars}" fi @@ -1437,20 +1435,8 @@ filter_readonly_variables() { ${PORTAGE_MUTABLE_FILTERED_VARS} " fi - set -f - for x in ${filtered_vars} ; do - var_grep="${var_grep}|${x}" - done - set +f - var_grep=${var_grep:1} # strip the first | - var_grep="(^|^declare[[:space:]]+-[^[:space:]]+[[:space:]]+|^export[[:space:]]+)(${var_grep})=.*" - # The sed is to remove the readonly attribute from variables such as those - # listed in READONLY_EBUILD_METADATA, since having any readonly attributes - # persisting in the saved environment can be inconvenient when it - # eventually needs to be reloaded. - "${PORTAGE_BIN_PATH}"/filter-bash-environment.py "${var_grep}" | sed -r \ - -e 's:^declare[[:space:]]+-r[[:space:]]+:declare :' \ - -e 's:^declare[[:space:]]+-([[:alnum:]]*)r([[:alnum:]]*)[[:space:]]+:declare -\1\2 :' + + "${PORTAGE_BIN_PATH}"/filter-bash-environment.py "${filtered_vars}" } # @FUNCTION: preprocess_ebuild_env -- cgit v1.2.3-1-g7c22