summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pym/_emerge/__init__.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py
index 938c4aa7d..972caa4fc 100644
--- a/pym/_emerge/__init__.py
+++ b/pym/_emerge/__init__.py
@@ -2677,8 +2677,12 @@ class EbuildBuild(CompositeTask):
be released when merge() is called.
"""
- if self._default_exit(packager) == os.EX_OK and \
- self.opts.buildpkgonly:
+ if self._default_exit(packager) != os.EX_OK:
+ self._unlock_builddir()
+ self.wait()
+ return
+
+ if self.opts.buildpkgonly:
# Need to call "clean" phase for buildpkgonly mode
portage.elog.elog_process(self.pkg.cpv, self.settings)
phase = "clean"
@@ -2689,9 +2693,10 @@ class EbuildBuild(CompositeTask):
self._start_task(clean_phase, self._clean_exit)
return
- if self._final_exit(packager) != os.EX_OK or \
- self.opts.buildpkgonly:
- self._unlock_builddir()
+ # Continue holding the builddir lock until
+ # after the package has been installed.
+ self._current_task = None
+ self.returncode = packager.returncode
self.wait()
def _clean_exit(self, clean_phase):