From: Zac Medico Date: Mon, 7 Jul 2008 22:41:10 +0000 (-0000) Subject: * Add new CompositeTask._default_final_exit() method and use it as the new X-Git-Tag: v2.2_rc2~167 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=8c8226266a93b0b01790ad983b8f35259e4a7543;p=portage.git * Add new CompositeTask._default_final_exit() method and use it as the new generic task exit callback. * Remove erroneous self.wait() calls inside MergeListItem.start(). svn path=/main/trunk/; revision=10974 --- diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index 8649912ae..bf4ef3afd 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -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):