summaryrefslogtreecommitdiffstats
path: root/bin/ebuild.sh
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-11-29 20:24:05 +0000
committerZac Medico <zmedico@gentoo.org>2007-11-29 20:24:05 +0000
commit4f4287014f5742bd08b8c950d7cfdf2fd52ea921 (patch)
treee85dead2e3f2fb16fa6a271163edb448c517d6f8 /bin/ebuild.sh
parent7533586dcc2c0351da28da56b9e6a2a1b9ea004d (diff)
downloadportage-4f4287014f5742bd08b8c950d7cfdf2fd52ea921.tar.gz
portage-4f4287014f5742bd08b8c950d7cfdf2fd52ea921.tar.bz2
portage-4f4287014f5742bd08b8c950d7cfdf2fd52ea921.zip
Move environment.bz2 extraction from ebuild.sh to doebuild() on
the python side. The python will be able to use it's awareness of the ${T}/environment to decide what type of ebuild environment should be generated. For example, if the ebuild environment should be able to unset variables that have been inherited from the calling environment, the existence of ${T}/environment will indicate that the ebuild environment should be isolated from the calling environment. svn path=/main/trunk/; revision=8753
Diffstat (limited to 'bin/ebuild.sh')
-rwxr-xr-xbin/ebuild.sh28
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}