From e48d76874acf68de724161639519f5aaef7d2b72 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Tue, 17 Aug 2010 07:18:30 -0700 Subject: Make EbuildBinpkg inherit from EbuildProcess since the 'package' phase is already a member of actionmap. --- pym/_emerge/EbuildBinpkg.py | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) (limited to 'pym/_emerge/EbuildBinpkg.py') diff --git a/pym/_emerge/EbuildBinpkg.py b/pym/_emerge/EbuildBinpkg.py index 8c68d70bf..edcc4bf3b 100644 --- a/pym/_emerge/EbuildBinpkg.py +++ b/pym/_emerge/EbuildBinpkg.py @@ -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"] -- cgit v1.2.3-1-g7c22