Make EbuildBinpkg delegate everything up to src_install() to
authorZac Medico <zmedico@gentoo.org>
Sat, 28 Jun 2008 23:32:58 +0000 (23:32 -0000)
committerZac Medico <zmedico@gentoo.org>
Sat, 28 Jun 2008 23:32:58 +0000 (23:32 -0000)
the EbuildBuild class.

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

pym/_emerge/__init__.py

index 4ae7d78bee5ba3983cf22434c8750a54201cf381..5b3fa09e211ec5610ac053848cd12cb0a008afba 100644 (file)
@@ -1476,7 +1476,9 @@ class EbuildBuild(Task):
                return retval
 
 class EbuildBinpkg(Task):
-
+       """
+       This assumes that src_install() has successfully completed.
+       """
        __slots__ = ("pkg", "settings")
 
        def _get_hash_key(self):
@@ -1500,13 +1502,21 @@ class EbuildBinpkg(Task):
                settings["PORTAGE_BINPKG_TMPFILE"] = binpkg_tmpfile
                settings.backup_changes("PORTAGE_BINPKG_TMPFILE")
 
+               # Earlier phases should already be done, so
+               # use "noauto" to quietly skip them.
+               settings.features.append("noauto")
+
                try:
                        retval = portage.doebuild(ebuild_path,
                                "package", root_config.root,
                                settings, debug, mydbapi=portdb,
                                tree="porttree")
                finally:
-                       self.settings.pop("PORTAGE_BINPKG_TMPFILE", None)
+                       settings.pop("PORTAGE_BINPKG_TMPFILE", None)
+                       try:
+                               settings.features.remove("noauto")
+                       except ValueError:
+                               pass
 
                if retval == os.EX_OK:
                        bintree.inject(pkg.cpv, filename=binpkg_tmpfile)
@@ -6517,6 +6527,11 @@ class MergeTask(object):
                                                        (mergecount, len(mymergelist), pkg_key)
                                                emergelog(xterm_titles, msg, short_msg=short_msg)
 
+                                               build = EbuildBuild(pkg=pkg, settings=pkgsettings)
+                                               retval = build.execute()
+                                               if retval != os.EX_OK:
+                                                       raise self._pkg_failure(retval)
+
                                                build = EbuildBinpkg(pkg=pkg, settings=pkgsettings)
                                                retval = build.execute()
                                                if retval != os.EX_OK: