From 12066bf508a1459b1971a7ce666799e1f0124e36 Mon Sep 17 00:00:00 2001 From: Joshua Lock Date: Tue, 5 Oct 2010 12:44:08 +0100 Subject: 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 poky [BUGID #362] Signed-off-by: Joshua Lock Signed-off-by: Chris Larson --- lib/bb/fetch/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/bb/fetch') diff --git a/lib/bb/fetch/__init__.py b/lib/bb/fetch/__init__.py index 13a2c419e..1cd0faf82 100644 --- a/lib/bb/fetch/__init__.py +++ b/lib/bb/fetch/__init__.py @@ -261,10 +261,12 @@ def go(d, urls = None): try: m.go(u, ud, d) localpath = ud.localpath - except: + except FetchError: # Finally, try fetching uri, u, from MIRRORS mirrors = [ i.split() for i in (bb.data.getVar('MIRRORS', d, 1) or "").split('\n') if i ] localpath = try_mirrors (d, u, mirrors) + if not localpath or not os.path.exists(localpath): + raise FetchError("Unable to fetch URL %s from any source." % u) if localpath: ud.localpath = localpath -- cgit 1.2.3-korg