diff options
author | Zac Medico <zmedico@gentoo.org> | 2009-12-06 11:03:54 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2009-12-06 11:03:54 +0000 |
commit | 72aba76bde1fe1e79c35d0c80c79ac16a1db0639 (patch) | |
tree | 231b2876ab96022876f6d6c3e185a42611ef29a4 /pym/_emerge/EbuildBuild.py | |
parent | 07aa28581d9153a49e33661830d4929a94d59176 (diff) | |
download | portage-72aba76bde1fe1e79c35d0c80c79ac16a1db0639.tar.gz portage-72aba76bde1fe1e79c35d0c80c79ac16a1db0639.tar.bz2 portage-72aba76bde1fe1e79c35d0c80c79ac16a1db0639.zip |
Bug #295715 - Implement a register_success_hook function to complement
register_die_hook, and also add code to ensure the die hooks are called even
when the failure is on the python side (like for file collisions).
(trunk r14936)
svn path=/main/branches/2.1.7/; revision=14950
Diffstat (limited to 'pym/_emerge/EbuildBuild.py')
-rw-r--r-- | pym/_emerge/EbuildBuild.py | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/pym/_emerge/EbuildBuild.py b/pym/_emerge/EbuildBuild.py index 930b5c6df..543fb1b03 100644 --- a/pym/_emerge/EbuildBuild.py +++ b/pym/_emerge/EbuildBuild.py @@ -10,6 +10,7 @@ from _emerge.CompositeTask import CompositeTask from _emerge.EbuildMerge import EbuildMerge from _emerge.EbuildFetchonly import EbuildFetchonly from _emerge.EbuildBuildDir import EbuildBuildDir +from _emerge.MiscFunctionsProcess import MiscFunctionsProcess from portage.util import writemsg import portage from portage import os @@ -215,14 +216,13 @@ class EbuildBuild(CompositeTask): return if self.opts.buildpkgonly: - # Need to call "clean" phase for buildpkgonly mode - portage.elog.elog_process(self.pkg.cpv, self.settings) - phase = "clean" - clean_phase = EbuildPhase(background=self.background, - pkg=self.pkg, phase=phase, - scheduler=self.scheduler, settings=self.settings, - tree=self._tree) - self._start_task(clean_phase, self._clean_exit) + phase = 'success_hooks' + success_hooks = MiscFunctionsProcess( + background=self.background, + commands=[phase], phase=phase, pkg=self.pkg, + scheduler=self.scheduler, settings=self.settings) + self._start_task(success_hooks, + self._buildpkgonly_success_hook_exit) return # Continue holding the builddir lock until @@ -231,6 +231,18 @@ class EbuildBuild(CompositeTask): self.returncode = packager.returncode self.wait() + def _buildpkgonly_success_hook_exit(self, success_hooks): + self._default_exit(success_hooks) + self.returncode = None + # Need to call "clean" phase for buildpkgonly mode + portage.elog.elog_process(self.pkg.cpv, self.settings) + phase = 'clean' + clean_phase = EbuildPhase(background=self.background, + pkg=self.pkg, phase=phase, + scheduler=self.scheduler, settings=self.settings, + tree=self._tree) + self._start_task(clean_phase, self._clean_exit) + def _clean_exit(self, clean_phase): if self._final_exit(clean_phase) != os.EX_OK or \ self.opts.buildpkgonly: |