Support EBUILD_PHASE during package and rpm phases for bug #129244.
authorZac Medico <zmedico@gentoo.org>
Tue, 11 Apr 2006 03:54:13 +0000 (03:54 -0000)
committerZac Medico <zmedico@gentoo.org>
Tue, 11 Apr 2006 03:54:13 +0000 (03:54 -0000)
svn path=/main/trunk/; revision=3125

bin/ebuild.sh
pym/portage.py

index 3f2610c4e89af2f765a1d6c30368f891a58d16d3..c4cf610f117c7eed7080c6ee5ed1d189180dcc4c 100755 (executable)
@@ -11,6 +11,8 @@ if [ ! -z "${PORTAGE_GPG_DIR}" ]; then
        SANDBOX_PREDICT="${SANDBOX_PREDICT}:${PORTAGE_GPG_DIR}"
 fi
 
+declare -rx EBUILD_PHASE
+
 if [ "$*" != "depend" ] && [ "$*" != "clean" ] && [ "$*" != "nofetch" ]; then
        if [ -f "${T}/environment" ]; then
                source "${T}/environment" &>/dev/null
@@ -21,8 +23,6 @@ if [ -n "$#" ]; then
        ARGS="${*}"
 fi
 
-declare -rx EBUILD_PHASE="$*"
-
 # Prevent aliases from causing portage to act inappropriately.
 # Make sure it's before everything so we don't mess aliases that follow.
 unalias -a
index a3cb1707939b302f85a330b6523ed3abc38a9e12..8ca53b742e34aa7176222b0f8dd11ddfb4280291 100644 (file)
@@ -2197,7 +2197,9 @@ def spawnebuild(mydo,actionmap,mysettings,debug,alwaysdep=0,logfile=None):
                        if retval:
                                return retval
        kwargs = actionmap[mydo]["args"]
+       mysettings["EBUILD_PHASE"] = mydo
        phase_retval = spawn(actionmap[mydo]["cmd"] % mydo, mysettings, debug=debug, logfile=logfile, **kwargs)
+       del mysettings["EBUILD_PHASE"]
        if phase_retval == os.EX_OK:
                if mydo == "install":
                        mycommand = " ".join([MISC_SH_BINARY, "install_qa_check"])