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
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()