summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/fetch2/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/fetch2/__init__.py')
-rw-r--r--bitbake/lib/bb/fetch2/__init__.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py
index 259b2637a6..8078991d71 100644
--- a/bitbake/lib/bb/fetch2/__init__.py
+++ b/bitbake/lib/bb/fetch2/__init__.py
@@ -466,9 +466,13 @@ def uri_replace(ud, uri_find, uri_replace, replacements, d, mirrortarball=None):
466 # Kill parameters, they make no sense for mirror tarballs 466 # Kill parameters, they make no sense for mirror tarballs
467 uri_decoded[5] = {} 467 uri_decoded[5] = {}
468 elif ud.localpath and ud.method.supports_checksum(ud): 468 elif ud.localpath and ud.method.supports_checksum(ud):
469 basename = os.path.basename(uri_decoded[loc]) 469 basename = os.path.basename(ud.localpath)
470 if basename and not result_decoded[loc].endswith(basename): 470 if basename:
471 result_decoded[loc] = os.path.join(result_decoded[loc], basename) 471 uri_basename = os.path.basename(uri_decoded[loc])
472 if basename != uri_basename and result_decoded[loc].endswith(uri_basename):
473 result_decoded[loc] = result_decoded[loc].replace(uri_basename, basename)
474 elif not result_decoded[loc].endswith(basename):
475 result_decoded[loc] = os.path.join(result_decoded[loc], basename)
472 else: 476 else:
473 return None 477 return None
474 result = encodeurl(result_decoded) 478 result = encodeurl(result_decoded)