summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pym/_emerge/EbuildBuild.py28
1 files changed, 26 insertions, 2 deletions
diff --git a/pym/_emerge/EbuildBuild.py b/pym/_emerge/EbuildBuild.py
index b319596ac..ecf9f6c43 100644
--- a/pym/_emerge/EbuildBuild.py
+++ b/pym/_emerge/EbuildBuild.py
@@ -153,8 +153,7 @@ class EbuildBuild(CompositeTask):
portage.elog.elog_process(self.pkg.cpv, self.settings)
if self._default_exit(fetcher) != os.EX_OK:
- self._unlock_builddir()
- self.wait()
+ self._fetch_failed()
return
# discard successful fetch log
@@ -195,6 +194,31 @@ class EbuildBuild(CompositeTask):
scheduler=scheduler, settings=settings)
self._start_task(build, self._build_exit)
+ def _fetch_failed(self):
+ # If RESTRICT=fetch is set, then the nofetch phase
+ # should have been executed already, so don't do
+ # it again.
+ if 'fetch' in self.pkg.metadata.restrict or \
+ 'nofetch' not in self.pkg.metadata.defined_phases:
+ self._unlock_builddir()
+ self.wait()
+ return
+
+ # The package has defined a pkg_nofetch phase, even
+ # though RESTRICT=fetch is not set, so go ahead and
+ # run it. This allows specialized messages to be
+ # displayed for problematic packages (bug #336499).
+ self.returncode = None
+ nofetch_phase = EbuildPhase(background=self.background,
+ phase='nofetch', scheduler=self.scheduler, settings=self.settings)
+ self._start_task(nofetch_phase, self._nofetch_exit)
+
+ def _nofetch_exit(self, nofetch_phase):
+ self._final_exit(nofetch_phase)
+ self._unlock_builddir()
+ self.returncode = 1
+ self.wait()
+
def _unlock_builddir(self):
portage.elog.elog_process(self.pkg.cpv, self.settings)
self._build_dir.unlock()