Fix more references to MISC_SH_BINARY so that they work properly
authorZac Medico <zmedico@gentoo.org>
Thu, 29 Nov 2007 00:12:30 +0000 (00:12 -0000)
committerZac Medico <zmedico@gentoo.org>
Thu, 29 Nov 2007 00:12:30 +0000 (00:12 -0000)
with variable PORTAGE_BIN_PATH.

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

pym/portage/__init__.py

index f16e2d4bd76eb45a0f436a797a2971ac7f2eba26..cd3ebbe722827a39216af8b9b2ab332bbc0757c2 100644 (file)
@@ -3619,7 +3619,13 @@ def spawnebuild(mydo,actionmap,mysettings,debug,alwaysdep=0,logfile=None):
                                        apply_secpass_permissions(fpath, uid=myuid, gid=mygid,
                                                mode=mystat.st_mode, stat_cached=mystat,
                                                follow_links=False)
-                       mycommand = " ".join([MISC_SH_BINARY, "install_qa_check", "install_symlink_html_docs"])
+                       # Note: PORTAGE_BIN_PATH may differ from the global
+                       # constant when portage is reinstalling itself.
+                       portage_bin_path = mysettings["PORTAGE_BIN_PATH"]
+                       misc_sh_binary = os.path.join(portage_bin_path,
+                               os.path.basename(MISC_SH_BINARY))
+                       mycommand = " ".join([portage_bin_path,
+                               "install_qa_check", "install_symlink_html_docs"])
                        qa_retval = spawn(mycommand, mysettings, debug=debug, logfile=logfile, **kwargs)
                        if qa_retval:
                                writemsg("!!! install_qa_check failed; exiting.\n",
@@ -4162,6 +4168,12 @@ def doebuild(myebuild, mydo, myroot, mysettings, debug=0, listonly=0,
                                eerror(l, phase=mydo, key=mysettings.mycpv)
                return retval
 
+       # Note: PORTAGE_BIN_PATH may differ from the global
+       # constant when portage is reinstalling itself.
+       portage_bin_path = mysettings["PORTAGE_BIN_PATH"]
+       misc_sh_binary = os.path.join(portage_bin_path,
+               os.path.basename(MISC_SH_BINARY))
+
        logfile=None
        builddir_lock = None
        tmpdir = None
@@ -4325,7 +4337,7 @@ def doebuild(myebuild, mydo, myroot, mysettings, debug=0, listonly=0,
                        if phase_retval == os.EX_OK:
                                # Post phase logic and tasks that have been factored out of
                                # ebuild.sh.
-                               myargs = [MISC_SH_BINARY, "preinst_bsdflags", "preinst_mask",
+                               myargs = [misc_sh_binary, "preinst_bsdflags", "preinst_mask",
                                        "preinst_sfperms", "preinst_selinux_labels",
                                        "preinst_suid_scan"]
                                _doebuild_exit_status_unlink(
@@ -4346,7 +4358,7 @@ def doebuild(myebuild, mydo, myroot, mysettings, debug=0, listonly=0,
                        if phase_retval == os.EX_OK:
                                # Post phase logic and tasks that have been factored out of
                                # ebuild.sh.
-                               myargs = [MISC_SH_BINARY, "postinst_bsdflags"]
+                               myargs = [misc_sh_binary, "postinst_bsdflags"]
                                _doebuild_exit_status_unlink(
                                        mysettings.get("EBUILD_EXIT_STATUS_FILE"))
                                mysettings["EBUILD_PHASE"] = ""
@@ -4495,13 +4507,9 @@ def doebuild(myebuild, mydo, myroot, mysettings, debug=0, listonly=0,
 
                fakeroot = "fakeroot" in mysettings.features
 
-               # Note: PORTAGE_BIN_PATH may differ from the global
-               # constant when portage is reinstalling itself.
-               portage_bin_path = mysettings["PORTAGE_BIN_PATH"]
                ebuild_sh = os.path.join(portage_bin_path,
                        os.path.basename(EBUILD_SH_BINARY)) + " %s"
-               misc_sh = os.path.join(portage_bin_path,
-                       os.path.basename(MISC_SH_BINARY)) + " dyn_%s"
+               misc_sh = misc_sh_binary + " dyn_%s"
 
                # args are for the to spawn function
                actionmap = {