Openembedded Bitbake Development
 help / color / mirror / Atom feed
* [PATCH] fetch2: Handle errors orruring when building mirror urls
@ 2012-06-22 11:54 Richard Purdie
  0 siblings, 0 replies; only message in thread
From: Richard Purdie @ 2012-06-22 11:54 UTC (permalink / raw)
  To: bitbake-devel

When we build the mirror urls, its possible an error will occur. If it
does, it should just mean we don't attempt this mirror url. The current
code actually aborts *all* the mirrors, not just the failed url.

This patch catches and logs the exception allowing things to continue.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py
index 0b256ae..a38cb8f 100644
--- a/bitbake/lib/bb/fetch2/__init__.py
+++ b/bitbake/lib/bb/fetch2/__init__.py
@@ -503,9 +503,18 @@ def build_mirroruris(origud, mirrors, ld):
             newuri = uri_replace(ud, find, replace, replacements, ld)
             if not newuri or newuri in uris or newuri == origud.url:
                 continue
+            try:
+                newud = FetchData(newuri, ld)
+                newud.setup_localpath(ld)
+            except bb.fetch2.BBFetchException as e:
+                logger.debug(1, "Mirror fetch failure for url %s (original url: %s)" % (newuri, origud.url))
+                logger.debug(1, str(e))
+                try:
+                    ud.method.clean(ud, ld)
+                except UnboundLocalError:
+                    pass
+                continue   
             uris.append(newuri)
-            newud = FetchData(newuri, ld)
-            newud.setup_localpath(ld)
             uds.append(newud)
 
             adduri(newuri, newud, uris, uds)




^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2012-06-22 12:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-22 11:54 [PATCH] fetch2: Handle errors orruring when building mirror urls Richard Purdie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox