summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/fetch2/__init__.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py
index 42fef69c3c..6847873e7b 100644
--- a/bitbake/lib/bb/fetch2/__init__.py
+++ b/bitbake/lib/bb/fetch2/__init__.py
@@ -190,14 +190,15 @@ def uri_replace(ud, uri_find, uri_replace, d):
190 else: 190 else:
191 result_decoded[loc] = re.sub(i, uri_replace_decoded[loc], uri_decoded[loc]) 191 result_decoded[loc] = re.sub(i, uri_replace_decoded[loc], uri_decoded[loc])
192 if uri_find_decoded.index(i) == 2: 192 if uri_find_decoded.index(i) == 2:
193 basename = None
193 if ud.mirrortarball: 194 if ud.mirrortarball:
194 if result_decoded[loc].endswith("/"): 195 basename = os.path.basename(ud.localpath)
195 result_decoded[loc] = os.path.dirname(result_decoded[loc])
196 result_decoded[loc] = os.path.join(result_decoded[loc], os.path.basename(ud.mirrortarball))
197 elif ud.localpath: 196 elif ud.localpath:
198 if result_decoded[loc].endswith("/"): 197 basename = os.path.basename(ud.localpath)
199 result_decoded[loc] = os.path.dirname(result_decoded[loc]) 198 if basename and result_decoded[loc].endswith("/"):
200 result_decoded[loc] = os.path.join(result_decoded[loc], os.path.basename(ud.localpath)) 199 result_decoded[loc] = os.path.dirname(result_decoded[loc])
200 if basename and not result_decoded[loc].endswith(basename):
201 result_decoded[loc] = os.path.join(result_decoded[loc], basename)
201 else: 202 else:
202 return ud.url 203 return ud.url
203 result = encodeurl(result_decoded) 204 result = encodeurl(result_decoded)