1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-30 00:20:08 +00:00

bitbake/fetch2: Ensure original ud is preserved in try_mirror

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie
2011-02-08 12:40:40 +00:00
parent 38878db3b0
commit 0713fb6b99
+4 -4
View File
@@ -399,7 +399,7 @@ def check_network_access(d, info = ""):
else: else:
logger.debug(1, "Fetcher accessed the network with the command %s" % info) logger.debug(1, "Fetcher accessed the network with the command %s" % info)
def try_mirrors(d, ud, mirrors, check = False): def try_mirrors(d, origud, mirrors, check = False):
""" """
Try to use a mirrored version of the sources. Try to use a mirrored version of the sources.
This method will be automatically called before the fetchers go. This method will be automatically called before the fetchers go.
@@ -410,8 +410,8 @@ def try_mirrors(d, ud, mirrors, check = False):
""" """
ld = d.createCopy() ld = d.createCopy()
for (find, replace) in mirrors: for (find, replace) in mirrors:
newuri = uri_replace(ud, find, replace, ld) newuri = uri_replace(origud, find, replace, ld)
if newuri == ud.url: if newuri == origud.url:
continue continue
try: try:
ud = FetchData(newuri, ld) ud = FetchData(newuri, ld)
@@ -430,7 +430,7 @@ def try_mirrors(d, ud, mirrors, check = False):
return ud.localpath return ud.localpath
except bb.fetch2.BBFetchException: except bb.fetch2.BBFetchException:
logger.debug(1, "Mirror fetch failure for url %s (original url: %s)" % (newuri, ud.url)) logger.debug(1, "Mirror fetch failure for url %s (original url: %s)" % (newuri, origud.url))
bb.utils.remove(ud.localpath) bb.utils.remove(ud.localpath)
continue continue
return None return None