Make EbuildBinpkg inherit from EbuildProcess since the 'package'
authorZac Medico <zmedico@gentoo.org>
Tue, 17 Aug 2010 14:18:30 +0000 (07:18 -0700)
committerZac Medico <zmedico@gentoo.org>
Tue, 17 Aug 2010 14:18:30 +0000 (07:18 -0700)
phase is already a member of actionmap.

pym/_emerge/EbuildBinpkg.py

index 8c68d70bfadc1278feb2bdc664672814a9e13f6c..edcc4bf3b23767a29120e0ec4baaaee7a4b8bccc 100644 (file)
@@ -1,21 +1,19 @@
 # Copyright 1999-2010 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
-from _emerge.MiscFunctionsProcess import MiscFunctionsProcess
+from _emerge.EbuildProcess import EbuildProcess
 from portage import os
 from portage.exception import PermissionDenied
-from portage.package.ebuild.doebuild import _spawn_actionmap
-from portage.package.ebuild.doebuild import spawn as doebuild_spawn
 from portage.util import ensure_dirs
 
-class EbuildBinpkg(MiscFunctionsProcess):
+class EbuildBinpkg(EbuildProcess):
        """
        This assumes that src_install() has successfully completed.
        """
        __slots__ = ("_binpkg_tmpfile", "pkg")
 
        def __init__(self, **kwargs):
-               MiscFunctionsProcess.__init__(self, phase="package", **kwargs)
+               EbuildProcess.__init__(self, phase="package", **kwargs)
 
        def _start(self):
                pkg = self.pkg
@@ -31,22 +29,12 @@ class EbuildBinpkg(MiscFunctionsProcess):
                                "access('%s', os.W_OK)" % parent_dir)
 
                self._binpkg_tmpfile = binpkg_tmpfile
-               self.logfile = self.settings.get("PORTAGE_LOG_FILE")
-               self.commands = ["dyn_" + self.phase]
-               MiscFunctionsProcess._start(self)
-
-       def _spawn(self, args, **kwargs):
-               self.settings["EBUILD_PHASE"] = self.phase
                self.settings["PORTAGE_BINPKG_TMPFILE"] = self._binpkg_tmpfile
-               kwargs.update(_spawn_actionmap(self.settings)[self.phase]["args"])
-               try:
-                       return doebuild_spawn(" ".join(args), self.settings, **kwargs)
-               finally:
-                       self.settings.pop("EBUILD_PHASE", None)
-                       self.settings.pop("PORTAGE_BINPKG_TMPFILE", None)
+               EbuildProcess._start(self)
 
        def _set_returncode(self, wait_retval):
-               MiscFunctionsProcess._set_returncode(self, wait_retval)
+               EbuildProcess._set_returncode(self, wait_retval)
+               self.settings.pop("PORTAGE_BINPKG_TMPFILE", None)
                if self.returncode == os.EX_OK:
                        pkg = self.pkg
                        bintree = pkg.root_config.trees["bintree"]