summaryrefslogtreecommitdiffstats
path: root/pym/_emerge/EbuildBuild.py
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2011-07-16 16:30:14 -0700
committerZac Medico <zmedico@gentoo.org>2011-07-16 16:30:14 -0700
commit785fe0b42a66b1d137955a4b816b3c254a1b785d (patch)
tree176c9c8d8a185994671276f5d3746db9c51db43f /pym/_emerge/EbuildBuild.py
parenta3ebf8f370ed20bcf419395b786aae2daccb5074 (diff)
downloadportage-785fe0b42a66b1d137955a4b816b3c254a1b785d.tar.gz
portage-785fe0b42a66b1d137955a4b816b3c254a1b785d.tar.bz2
portage-785fe0b42a66b1d137955a4b816b3c254a1b785d.zip
EbuildBuild: skip the fetch queue when possible
Since commit f07f8386e945b48358c11c121960e4833c539752, it was possible for EbuildBuild to wait on the fetch queue even in cases in which all required files had been previously fetched. Now this case is optimized to skip the fetch queue, as discribed in bug #375331, comment #2.
Diffstat (limited to 'pym/_emerge/EbuildBuild.py')
-rw-r--r--pym/_emerge/EbuildBuild.py25
1 files changed, 24 insertions, 1 deletions
diff --git a/pym/_emerge/EbuildBuild.py b/pym/_emerge/EbuildBuild.py
index b6beb495b..1776d1eac 100644
--- a/pym/_emerge/EbuildBuild.py
+++ b/pym/_emerge/EbuildBuild.py
@@ -166,12 +166,34 @@ class EbuildBuild(CompositeTask):
portage.prepare_build_dirs(self.pkg.root, self.settings, 1)
fetcher = EbuildFetcher(config_pool=self.config_pool,
+ ebuild_path=self._ebuild_path,
fetchall=self.opts.fetch_all_uri,
fetchonly=self.opts.fetchonly,
background=self.background,
logfile=self.settings.get('PORTAGE_LOG_FILE'),
pkg=self.pkg, scheduler=self.scheduler)
+ try:
+ already_fetched = fetcher.already_fetched(self.settings)
+ except portage.exception.InvalidDependString as e:
+ msg_lines = []
+ msg = "Fetch failed for '%s' due to invalid SRC_URI: %s" % \
+ (self.pkg.cpv, e)
+ msg_lines.append(msg)
+ fetcher._eerror(msg_lines)
+ portage.elog.elog_process(self.pkg.cpv, self.settings)
+ self.returncode = 1
+ self._current_task = None
+ self._unlock_builddir()
+ self.wait()
+ return
+
+ if already_fetched:
+ # This case is optimized to skip the fetch queue.
+ fetcher = None
+ self._fetch_exit(fetcher)
+ return
+
# Allow the Scheduler's fetch queue to control the
# number of concurrent fetchers.
fetcher.addExitListener(self._fetch_exit)
@@ -180,7 +202,8 @@ class EbuildBuild(CompositeTask):
def _fetch_exit(self, fetcher):
- if self._default_exit(fetcher) != os.EX_OK:
+ if fetcher is not None and \
+ self._default_exit(fetcher) != os.EX_OK:
self._fetch_failed()
return