Avoid leaking some variables from ebuild_main() into the environment (local
authorZac Medico <zmedico@gentoo.org>
Thu, 30 Apr 2009 07:04:31 +0000 (07:04 -0000)
committerZac Medico <zmedico@gentoo.org>
Thu, 30 Apr 2009 07:04:31 +0000 (07:04 -0000)
variables are exposed to 'children'). (trunk r13316)

svn path=/main/branches/2.1.6/; revision=13487

bin/ebuild.sh

index c086e6d31b5d64ecfca49a9b03d4c193fa3df818..8fad20b877564f6ffea3ce373e96c3885d25c6f4 100755 (executable)
@@ -1901,8 +1901,6 @@ fi
 
 ebuild_main() {
        local f x
-       local export_vars="ASFLAGS CCACHE_DIR CCACHE_SIZE
-               CFLAGS CXXFLAGS LDFLAGS LIBCFLAGS LIBCXXFLAGS"
 
        if ! hasq $EBUILD_SH_ARGS clean depend help info nofetch ; then
 
@@ -1931,6 +1929,7 @@ ebuild_main() {
        if [[ $EBUILD_PHASE != depend ]] ; then
                local phase_func=$(_ebuild_arg_to_phase "$EAPI" "$EBUILD_PHASE")
                [[ -n $phase_func ]] && _ebuild_phase_funcs "$EAPI" "$phase_func"
+               unset phase_func
        fi
 
        source_all_bashrcs
@@ -1971,7 +1970,8 @@ ebuild_main() {
                case "$EBUILD_SH_ARGS" in
                configure|compile)
 
-                       for x in $export_vars ; do
+                       for x in ASFLAGS CCACHE_DIR CCACHE_SIZE \
+                               CFLAGS CXXFLAGS LDFLAGS LIBCFLAGS LIBCXXFLAGS ; do
                                [[ ${!x-unset} != unset ]] && export $x
                        done