Remove some unsafe assumptions from preprocess_ebuild_env() and
authorZac Medico <zmedico@gentoo.org>
Sun, 25 Nov 2007 21:34:44 +0000 (21:34 -0000)
committerZac Medico <zmedico@gentoo.org>
Sun, 25 Nov 2007 21:34:44 +0000 (21:34 -0000)
note the remaining assumption that save_ebuild_env() is not
overridden by the environment being loaded.

svn path=/main/trunk/; revision=8662

bin/ebuild.sh

index 6e01ae8d910a1fffca5c05847375f770a79733c1..60205d69315d40082c4b9f59b914ca2145bed6e3 100755 (executable)
@@ -1397,12 +1397,14 @@ preprocess_ebuild_env() {
        filter_readonly_variables --filter-sandbox < "${T}"/environment \
                > "${T}"/environment.filtered
        mv "${T}"/environment.filtered "${T}"/environment
+       # TODO: Remove the assumption that the environment being loaded
+       # does not override the save_ebuild_env() function.
        (
                source "${T}"/environment
                # Rely on save_ebuild_env() to filter out any remaining variables
                # and functions that could interfere with the current environment.
-               save_ebuild_env | filter_readonly_variables > "${T}"/environment
-       )
+               save_ebuild_env
+       ) | filter_readonly_variables > "${T}"/environment
 }
 
 # @FUNCTION: save_ebuild_env