diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py index 414cc2b6b1..6789f3f9a5 100644 --- a/bitbake/lib/bb/fetch2/__init__.py +++ b/bitbake/lib/bb/fetch2/__init__.py @@ -200,8 +200,10 @@ def uri_replace(ud, uri_find, uri_replace, d): if basename and not result_decoded[loc].endswith(basename): result_decoded[loc] = os.path.join(result_decoded[loc], basename) else: - return ud.url + return None result = encodeurl(result_decoded) + if result == ud.url: + return None logger.debug(2, "For url %s returning %s" % (ud.url, result)) return result @@ -462,7 +464,7 @@ def try_mirrors(d, origud, mirrors, check = False): except ValueError: continue newuri = uri_replace(origud, find, replace, ld) - if newuri == origud.url: + if not newuri: continue try: ud = FetchData(newuri, ld)