diff options
author | Joshua Lock <josh@linux.intel.com> | 2010-10-05 12:44:08 +0100 |
---|---|---|
committer | Chris Larson <chris_larson@mentor.com> | 2010-10-12 15:49:02 -0700 |
commit | c88cf0dd127b0477ad90f0972b69624af55c7304 (patch) | |
tree | 97c82153823a66e848b350c24e5865b1a78d7ff7 | |
parent | d237fa4e030c3339beed5268678645e7bb735a06 (diff) | |
download | bitbake-c88cf0dd127b0477ad90f0972b69624af55c7304.tar.gz |
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 <josh@linux.intel.com>
Signed-off-by: Chris Larson <chris_larson@mentor.com>
-rw-r--r-- | lib/bb/fetch/__init__.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/bb/fetch/__init__.py b/lib/bb/fetch/__init__.py index dbc9c8b51..f7b06f3cf 100644 --- a/lib/bb/fetch/__init__.py +++ b/lib/bb/fetch/__init__.py @@ -291,10 +291,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 |