Fix references to EBUILD_SH_BINARY so that they work properly
authorZac Medico <zmedico@gentoo.org>
Thu, 29 Nov 2007 02:19:39 +0000 (02:19 -0000)
committerZac Medico <zmedico@gentoo.org>
Thu, 29 Nov 2007 02:19:39 +0000 (02:19 -0000)
with variable PORTAGE_BIN_PATH.

svn path=/main/trunk/; revision=8738

pym/portage/__init__.py

index 5370600be7380eaf74199a77a669a69933839daa..c892bc2622bdf5e7b9e4bf1f8a1de1a69236a948 100644 (file)
@@ -4172,6 +4172,8 @@ def doebuild(myebuild, mydo, myroot, mysettings, debug=0, listonly=0,
        # Note: PORTAGE_BIN_PATH may differ from the global
        # constant when portage is reinstalling itself.
        portage_bin_path = mysettings["PORTAGE_BIN_PATH"]
+       ebuild_sh_binary = os.path.join(portage_bin_path,
+               os.path.basename(EBUILD_SH_BINARY))
        misc_sh_binary = os.path.join(portage_bin_path,
                os.path.basename(MISC_SH_BINARY))
 
@@ -4206,7 +4208,7 @@ def doebuild(myebuild, mydo, myroot, mysettings, debug=0, listonly=0,
                                mysettings["dbkey"] = ""
                                pr, pw = os.pipe()
                                fd_pipes = {0:0, 1:1, 2:2, 9:pw}
-                               mypids = spawn(EBUILD_SH_BINARY + " depend", mysettings,
+                               mypids = spawn(ebuild_sh_binary + " depend", mysettings,
                                        fd_pipes=fd_pipes, returnpid=True, droppriv=droppriv)
                                os.close(pw) # belongs exclusively to the child process now
                                maxbytes = 1024
@@ -4235,7 +4237,7 @@ def doebuild(myebuild, mydo, myroot, mysettings, debug=0, listonly=0,
                                mysettings["dbkey"] = \
                                        os.path.join(mysettings.depcachedir, "aux_db_key_temp")
 
-                       return spawn(EBUILD_SH_BINARY + " depend", mysettings,
+                       return spawn(ebuild_sh_binary + " depend", mysettings,
                                droppriv=droppriv)
 
                # Validate dependency metadata here to ensure that ebuilds with invalid
@@ -4309,10 +4311,10 @@ def doebuild(myebuild, mydo, myroot, mysettings, debug=0, listonly=0,
                # if any of these are being called, handle them -- running them out of
                # the sandbox -- and stop now.
                if mydo in ["clean","cleanrm"]:
-                       return spawn(EBUILD_SH_BINARY + " clean", mysettings,
+                       return spawn(ebuild_sh_binary + " clean", mysettings,
                                debug=debug, free=1, logfile=None)
                elif mydo == "help":
-                       return spawn(EBUILD_SH_BINARY + " " + mydo, mysettings,
+                       return spawn(ebuild_sh_binary + " " + mydo, mysettings,
                                debug=debug, free=1, logfile=logfile)
                elif mydo == "setup":
                        infodir = os.path.join(
@@ -4321,7 +4323,7 @@ def doebuild(myebuild, mydo, myroot, mysettings, debug=0, listonly=0,
                                """Load USE flags for setup phase of a binary package.
                                Ideally, the environment.bz2 would be used instead."""
                                mysettings.load_infodir(infodir)
-                       retval = spawn(EBUILD_SH_BINARY + " " + mydo, mysettings,
+                       retval = spawn(ebuild_sh_binary + " " + mydo, mysettings,
                                debug=debug, free=1, logfile=logfile)
                        retval = exit_status_check(retval)
                        if secpass >= 2:
@@ -4332,7 +4334,7 @@ def doebuild(myebuild, mydo, myroot, mysettings, debug=0, listonly=0,
                                        filemode=060, filemask=0)
                        return retval
                elif mydo == "preinst":
-                       phase_retval = spawn(" ".join((EBUILD_SH_BINARY, mydo)),
+                       phase_retval = spawn(" ".join((ebuild_sh_binary, mydo)),
                                mysettings, debug=debug, free=1, logfile=logfile)
                        phase_retval = exit_status_check(phase_retval)
                        if phase_retval == os.EX_OK:
@@ -4353,7 +4355,7 @@ def doebuild(myebuild, mydo, myroot, mysettings, debug=0, listonly=0,
                        return phase_retval
                elif mydo == "postinst":
                        mysettings.load_infodir(mysettings["O"])
-                       phase_retval = spawn(" ".join((EBUILD_SH_BINARY, mydo)),
+                       phase_retval = spawn(" ".join((ebuild_sh_binary, mydo)),
                                mysettings, debug=debug, free=1, logfile=logfile)
                        phase_retval = exit_status_check(phase_retval)
                        if phase_retval == os.EX_OK:
@@ -4372,7 +4374,7 @@ def doebuild(myebuild, mydo, myroot, mysettings, debug=0, listonly=0,
                        return phase_retval
                elif mydo in ("prerm", "postrm", "config", "info"):
                        mysettings.load_infodir(mysettings["O"])
-                       retval =  spawn(EBUILD_SH_BINARY + " " + mydo,
+                       retval =  spawn(ebuild_sh_binary + " " + mydo,
                                mysettings, debug=debug, free=1, logfile=logfile)
                        retval = exit_status_check(retval)
                        return retval
@@ -4508,8 +4510,7 @@ def doebuild(myebuild, mydo, myroot, mysettings, debug=0, listonly=0,
 
                fakeroot = "fakeroot" in mysettings.features
 
-               ebuild_sh = os.path.join(portage_bin_path,
-                       os.path.basename(EBUILD_SH_BINARY)) + " %s"
+               ebuild_sh = ebuild_sh_binary + " %s"
                misc_sh = misc_sh_binary + " dyn_%s"
 
                # args are for the to spawn function