* Add new CompositeTask._default_final_exit() method and use it as the new
authorZac Medico <zmedico@gentoo.org>
Mon, 7 Jul 2008 22:41:10 +0000 (22:41 -0000)
committerZac Medico <zmedico@gentoo.org>
Mon, 7 Jul 2008 22:41:10 +0000 (22:41 -0000)
  generic task exit callback.

* Remove erroneous self.wait() calls inside MergeListItem.start().

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

pym/_emerge/__init__.py

index 8649912aea7bc7b7c90a1a75c6189c01c7336ce3..bf4ef3afda472abf40999c72e95baa1fa6372c4a 100644 (file)
@@ -1594,15 +1594,22 @@ class CompositeTask(AsynchronousTask):
                Assumes that task is the final task of this composite task.
                Calls _default_exit() and sets self.returncode to the task's
                returncode and sets self._current_task to None.
-
-               Subclasses can use this as a generic final task exit callback.
-
                """
                self._default_exit(task)
                self._current_task = None
                self.returncode = task.returncode
                return self.returncode
 
+       def _default_final_exit(self, task):
+               """
+               This calls _final_exit() and then wait().
+
+               Subclasses can use this as a generic final task exit callback.
+
+               """
+               self._final_exit(task)
+               return self.wait()
+
        def _start_task(self, task, exit_handler):
                """
                Register exit handler for the given task, set it
@@ -2155,7 +2162,7 @@ class EbuildExecuter(CompositeTask):
                                pkg=pkg, phase=phase, scheduler=scheduler,
                                settings=settings, tree=tree))
 
-               self._start_task(ebuild_phases, self._final_exit)
+               self._start_task(ebuild_phases, self._default_final_exit)
 
 class EbuildPhase(SubProcess):
 
@@ -2872,7 +2879,6 @@ class MergeListItem(CompositeTask):
 
                        self._install_task = build
                        self._start_task(build, self._ebuild_exit)
-                       self.wait()
                        return
 
                elif pkg.type_name == "binary":
@@ -2884,8 +2890,7 @@ class MergeListItem(CompositeTask):
                                scheduler=scheduler, world_atom=world_atom)
 
                        self._install_task = binpkg
-                       self._start_task(binpkg, self._final_exit)
-                       self.wait()
+                       self._start_task(binpkg, self._default_final_exit)
                        return
 
        def _ebuild_exit(self, build):