summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-08-17 09:35:41 -0700
committerZac Medico <zmedico@gentoo.org>2010-08-17 09:35:41 -0700
commitf9eb68bd354e67f9e86921168573f6e873843c87 (patch)
tree17b620a41d8dff196c4579bf3109e64c3779e11a
parentcc06c2dc55f617079311a0cf4d6f755ba0eab8db (diff)
downloadportage-f9eb68bd354e67f9e86921168573f6e873843c87.tar.gz
portage-f9eb68bd354e67f9e86921168573f6e873843c87.tar.bz2
portage-f9eb68bd354e67f9e86921168573f6e873843c87.zip
Make EbuildBinpkg inherit from CompositeTask since the EbuildPhase
class is capable of executing the 'package' phase.
-rw-r--r--pym/_emerge/EbuildBinpkg.py35
1 files changed, 23 insertions, 12 deletions
diff --git a/pym/_emerge/EbuildBinpkg.py b/pym/_emerge/EbuildBinpkg.py
index edcc4bf3b..68346f823 100644
--- a/pym/_emerge/EbuildBinpkg.py
+++ b/pym/_emerge/EbuildBinpkg.py
@@ -1,19 +1,18 @@
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
+from _emerge.CompositeTask import CompositeTask
from _emerge.EbuildProcess import EbuildProcess
from portage import os
from portage.exception import PermissionDenied
from portage.util import ensure_dirs
-class EbuildBinpkg(EbuildProcess):
+class EbuildBinpkg(CompositeTask):
"""
This assumes that src_install() has successfully completed.
"""
- __slots__ = ("_binpkg_tmpfile", "pkg")
-
- def __init__(self, **kwargs):
- EbuildProcess.__init__(self, phase="package", **kwargs)
+ __slots__ = ('pkg', 'settings') + \
+ ('_binpkg_tmpfile',)
def _start(self):
pkg = self.pkg
@@ -30,12 +29,24 @@ class EbuildBinpkg(EbuildProcess):
self._binpkg_tmpfile = binpkg_tmpfile
self.settings["PORTAGE_BINPKG_TMPFILE"] = self._binpkg_tmpfile
- EbuildProcess._start(self)
- def _set_returncode(self, wait_retval):
- EbuildProcess._set_returncode(self, wait_retval)
+ package_phase = EbuildProcess(background=self.background,
+ phase='package', scheduler=self.scheduler,
+ settings=self.settings)
+
+ self._start_task(package_phase, self._package_phase_exit)
+
+ def _package_phase_exit(self, package_phase):
+
self.settings.pop("PORTAGE_BINPKG_TMPFILE", None)
- if self.returncode == os.EX_OK:
- pkg = self.pkg
- bintree = pkg.root_config.trees["bintree"]
- bintree.inject(pkg.cpv, filename=self._binpkg_tmpfile)
+ if self._default_exit(package_phase) != os.EX_OK:
+ self.wait()
+ return
+
+ pkg = self.pkg
+ bintree = pkg.root_config.trees["bintree"]
+ bintree.inject(pkg.cpv, filename=self._binpkg_tmpfile)
+
+ self._current_task = None
+ self.returncode = os.EX_OK
+ self.wait()