aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-09-06 16:43:54 -0700
committerZac Medico <zmedico@gentoo.org>2010-09-06 16:43:54 -0700
commit12c645c3bbae062d06e7e52ab1d03d23ec6b7e84 (patch)
treecaf549c5af1a2436a8a9624832742d7dbbbc4e92 /bin
parentRemove unnecessary depgraph.altlist() call in Scheduler._calc_resume_list(). (diff)
downloadportage-12c645c3bbae062d06e7e52ab1d03d23ec6b7e84.tar.gz
portage-12c645c3bbae062d06e7e52ab1d03d23ec6b7e84.tar.bz2
portage-12c645c3bbae062d06e7e52ab1d03d23ec6b7e84.zip
Define EBUILD_MASTER_PID earlier in ebuild.sh, before $EBUILD isv2.2_rc76
sourced.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/ebuild.sh12
1 files changed, 8 insertions, 4 deletions
diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index bc4700e0b..e976bd114 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -1905,6 +1905,10 @@ if [[ -n ${QA_INTERCEPTORS} ]] ; then
unset BIN_PATH BIN BODY FUNC_SRC
fi
+# Subshell/helper die support (must export for the die helper).
+export EBUILD_MASTER_PID=$BASHPID
+trap 'exit 1' SIGTERM
+
if ! hasq "$EBUILD_PHASE" clean cleanrm depend && \
[ -f "${T}"/environment ] ; then
# The environment may have been extracted from environment.bz2 or
@@ -2104,6 +2108,10 @@ fi
ebuild_main() {
# Subshell/helper die support (must export for the die helper).
+ # Since this function is typically executed in a subshell,
+ # setup EBUILD_MASTER_PID to refer to the current $BASHPID,
+ # which seems to give the best results when further
+ # nested subshells call die.
export EBUILD_MASTER_PID=$BASHPID
trap 'exit 1' SIGTERM
@@ -2320,9 +2328,5 @@ elif [[ -n $EBUILD_SH_ARGS ]] ; then
exit $?
fi
-# Subshell/helper die support (must export for the die helper).
-export EBUILD_MASTER_PID=$BASHPID
-trap 'exit 1' SIGTERM
-
# Do not exit when ebuild.sh is sourced by other scripts.
true