summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorJoshua Lock <josh@linux.intel.com>2010-10-05 12:44:08 +0100
committerJoshua Lock <josh@linux.intel.com>2010-10-05 16:54:10 +0100
commit0ee7a9e6bdce1f3094e831b9db83087fff1dad17 (patch)
tree24a40bee95129e3edfa42095812a35d927aec1e2 /bitbake
parent8e5c0841ea4e8ffa95c55f3094d78918e1f98d52 (diff)
downloadpoky-0ee7a9e6bdce1f3094e831b9db83087fff1dad17.tar.gz
bitbake/fetch: if mirror fetching fails, ensure exception is raised
We catch any exception raised by the fetchers go() method and attempt to work around it by trying any (post) mirrors which are configured. However, should the mirrors fail the exception is lost and the fetch is assumed to have completed successfully. Instead, save the exception and if the local file does not exist after trying the mirrors re-raise the exception. Fixes [BUGID #362] Signed-off-by: Joshua Lock <josh@linux.intel.com>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/fetch/__init__.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/bitbake/lib/bb/fetch/__init__.py b/bitbake/lib/bb/fetch/__init__.py
index a787cb656b..65ac468797 100644
--- a/bitbake/lib/bb/fetch/__init__.py
+++ b/bitbake/lib/bb/fetch/__init__.py
@@ -272,10 +272,12 @@ def go(d, urls = None):
272 try: 272 try:
273 m.go(u, ud, d) 273 m.go(u, ud, d)
274 localpath = ud.localpath 274 localpath = ud.localpath
275 except: 275 except FetchError:
276 # Finally, try fetching uri, u, from MIRRORS 276 # Finally, try fetching uri, u, from MIRRORS
277 mirrors = [ i.split() for i in (bb.data.getVar('MIRRORS', d, 1) or "").split('\n') if i ] 277 mirrors = [ i.split() for i in (bb.data.getVar('MIRRORS', d, 1) or "").split('\n') if i ]
278 localpath = try_mirrors (d, u, mirrors) 278 localpath = try_mirrors (d, u, mirrors)
279 if not localpath or not os.path.exists(localpath):
280 raise FetchError("Unable to fetch URL %s from any source." % u)
279 281
280 if localpath: 282 if localpath:
281 ud.localpath = localpath 283 ud.localpath = localpath