Move filtering of misc bash variables from save_ebuild_env() to
authorZac Medico <zmedico@gentoo.org>
Mon, 19 Oct 2009 03:38:37 +0000 (03:38 -0000)
committerZac Medico <zmedico@gentoo.org>
Mon, 19 Oct 2009 03:38:37 +0000 (03:38 -0000)
filter_readonly_variables(). Add additional variables found in
the output of `env -i bash -c 'declare -p'`. (trunk r14676)

svn path=/main/branches/2.1.7/; revision=14689

bin/ebuild.sh
bin/isolated-functions.sh

index 1b83620b49b4eb06b465452522c31a9394ae421b..b94e81df2e154c2c5959bc56d2f4dbeaa0808c82 100755 (executable)
@@ -1634,11 +1634,15 @@ filter_readonly_variables() {
        local x filtered_vars
        local readonly_bash_vars="BASHPID DIRSTACK EUID FUNCNAME
                GROUPS PIPESTATUS PPID SHELLOPTS UID"
+       local bash_misc_vars="BASH BASH_.* COMP_WORDBREAKS HISTCMD
+               HISTFILE HOSTNAME HOSTTYPE IFS LINENO MACHTYPE OLDPWD
+               OPTERR OPTIND OSTYPE POSIXLY_CORRECT PS4 PWD RANDOM
+               SECONDS SHELL SHLVL"
        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_.* HISTFILE PATH POSIXLY_CORRECT"
+       filtered_vars="$readonly_bash_vars $bash_misc_vars
+               $READONLY_PORTAGE_VARS PATH"
        if hasq --filter-sandbox $* ; then
                filtered_vars="${filtered_vars} SANDBOX_.*"
        else
index d4c5c70db3fcd5705a5bb4935617a06235fc8fc6..94afc910440c482e7ac8090d7199d5a9c34a3abd 100755 (executable)
@@ -497,10 +497,6 @@ save_ebuild_env() {
                        fi
                fi
 
-               # misc variables set by bash
-               unset BASH HOSTTYPE IFS MACHTYPE OLDPWD \
-                       OPTERR OPTIND OSTYPE PS4 PWD SHELL SHLVL
-
                # misc variables inherited from the calling environment
                unset COLORTERM DISPLAY EDITOR LESS LESSOPEN LOGNAME LS_COLORS PAGER \
                        TERM TERMCAP USER
@@ -543,6 +539,7 @@ save_ebuild_env() {
                        source_all_bashrcs ebuild_main \
                        ebuild_phase ebuild_phase_with_hooks \
                        _ebuild_arg_to_phase _ebuild_phase_funcs default \
+                       _pipestatus \
                        ${QA_INTERCEPTORS}
 
                # portage config variables and variables set directly by portage