From 722000c545d7c23764382685d70819e42c11ead8 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Fri, 10 Sep 2010 18:39:42 -0700 Subject: Remove pkg_nofetch code from the fetch() function since it's currently broken (doebuild_environment raises TypeError due to missing mydbapi parameter) and this is a poor place to spawn pkg_nofetch anyway, especially given that the caller does not even pass in a portdbapi instance. For now, relocate the pkg_nofetch execution to EbuildBuild so that it works for emerge. TODO: Add pkg_nofetch support to fetch() callers where appropriate. --- pym/_emerge/EbuildBuild.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'pym/_emerge') diff --git a/pym/_emerge/EbuildBuild.py b/pym/_emerge/EbuildBuild.py index 28ef7d074..6d42b1fbb 100644 --- a/pym/_emerge/EbuildBuild.py +++ b/pym/_emerge/EbuildBuild.py @@ -193,19 +193,18 @@ class EbuildBuild(CompositeTask): 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: + # We only call the pkg_nofetch phase if either RESTRICT=fetch + # is set or the package has explicitly overridden the default + # pkg_nofetch implementation. This allows specialized messages + # to be displayed for problematic packages even though they do + # not set RESTRICT=fetch (bug #336499). + + if 'fetch' not in self.pkg.metadata.restrict and \ + '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) -- cgit v1.2.3-1-g7c22