diff options
author | Zac Medico <zmedico@gentoo.org> | 2007-11-30 00:59:48 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2007-11-30 00:59:48 +0000 |
commit | 9add99f73e20f0ee9c1b40e286be45ea49a1ffa4 (patch) | |
tree | 7ff8f26d87921b542071e8f00512c77defbc87bd /bin/ebuild.sh | |
parent | 86df9fc17e057b01d7eece3c148378d86092d4c7 (diff) | |
download | portage-9add99f73e20f0ee9c1b40e286be45ea49a1ffa4.tar.gz portage-9add99f73e20f0ee9c1b40e286be45ea49a1ffa4.tar.bz2 portage-9add99f73e20f0ee9c1b40e286be45ea49a1ffa4.zip |
Bug #189417 - When ${T}/environment exists, isolate the ebuild
environment from the calling environment. This makes it possible
for the build to unset a variable that was inherited from the
calling environment, and the variable will remain unset between
phases. (trunk r8752:8755)
svn path=/main/branches/2.1.2/; revision=8756
Diffstat (limited to 'bin/ebuild.sh')
-rwxr-xr-x | bin/ebuild.sh | 28 |
1 files changed, 5 insertions, 23 deletions
diff --git a/bin/ebuild.sh b/bin/ebuild.sh index a5b89c9d4..f8f7377d7 100755 --- a/bin/ebuild.sh +++ b/bin/ebuild.sh @@ -1547,32 +1547,14 @@ if hasq "depend" "${EBUILD_SH_ARGS}"; then unset BIN_PATH BIN BODY FUNC_SRC fi -# Automatically try to load environment.bz2 whenever -# "${T}/environment" does not exist, except for phases -# such as nofetch that do not require ${T} to exist. -if ! hasq ${EBUILD_SH_ARGS} clean depend nofetch && \ - [ ! -f "${T}/environment" ] ; then - bzip2 -dc "${EBUILD%/*}"/environment.bz2 > \ - "${T}/environment" 2> /dev/null - if [ $? -eq 0 ] && [ -s "${T}/environment" ] ; then - preprocess_ebuild_env || \ - die "error processing '${EBUILD%/*}/environment.bz2'" - else - rm -f "${T}/environment" - fi -fi - if hasq ${EBUILD_SH_ARGS} clean ; then true elif ! hasq ${EBUILD_PHASE} depend && [ -f "${T}"/environment ] ; then - if [ "${PN}" == "portage" ] && [ -n "${EBUILD_SH_ARGS}" ] ; then - # When portage reinstalls itself, during inst/rm phases, the - # environment may have been saved by a different version of ebuild.sh, - # so it can't trusted that it's been properly filtered. Therefore, - # always preprocess the environment when ${PN} == portage. - preprocess_ebuild_env || \ - die "error processing environment" - fi + # The environment may have been extracted from environment.bz2 or + # may have come from another version of ebuild.sh or something. + # In any case, preprocess it to prevent any potential interference. + preprocess_ebuild_env || \ + die "error processing environment" # Colon separated SANDBOX_* variables need to be cumulative. for x in SANDBOX_DENY SANDBOX_READ SANDBOX_PREDICT SANDBOX_WRITE ; do eval PORTAGE_${x}=\${!x} |