summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-11-20 02:33:28 +0000
committerZac Medico <zmedico@gentoo.org>2007-11-20 02:33:28 +0000
commit2e2f8d584055083185689c5ec4c5ce39e201cf38 (patch)
tree831d7369f245796d6894fbf3d82e1e1696a281d8 /bin
parentb97c1a0a5c54c55268691211ad6b905a2e63b1c8 (diff)
downloadportage-2e2f8d584055083185689c5ec4c5ce39e201cf38.tar.gz
portage-2e2f8d584055083185689c5ec4c5ce39e201cf38.tar.bz2
portage-2e2f8d584055083185689c5ec4c5ce39e201cf38.zip
Now that save_ebuild_env() filters variables that could cause
interference, preprocess_ebuild_env() can rely on it to clean up the environment enough so that anything left can be allowed to override variables or functions from the current environment. svn path=/main/trunk/; revision=8537
Diffstat (limited to 'bin')
-rwxr-xr-xbin/ebuild.sh11
1 files changed, 2 insertions, 9 deletions
diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index aaaf28826..505acbd92 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -1381,22 +1381,15 @@ filter_readonly_variables() {
# any stale variables or functions from an arbitrary environment from
# interfering with the current environment. This is useful when an existing
# environment needs to be loaded from a binary or installed package.
-#
-# For simplicity, the current implementation will cause the current environment
-# to override *everything* in the environment that is being processed. In the
-# future, it should be more selective and only override the parts that are
-# strictly necessary.
preprocess_ebuild_env() {
filter_readonly_variables < "${T}"/environment > "${T}"/environment.filtered
mv "${T}"/environment.filtered "${T}"/environment
- save_ebuild_env > "${T}"/environment.baseline
(
source "${T}"/environment
- unset FEATURES
- source "${T}"/environment.baseline
+ # Rely on save_ebuild_env() to filter out any remaining variables
+ # and functions that could interfere with the current environment.
save_ebuild_env > "${T}"/environment
)
- rm "${T}"/environment.baseline
}
# @FUNCTION: save_ebuild_env