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, 10 insertions, 3 deletions
diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py
index a055faaf19..d3c761d00d 100644
--- a/bitbake/lib/bb/fetch2/__init__.py
+++ b/bitbake/lib/bb/fetch2/__init__.py
@@ -175,6 +175,7 @@ def uri_replace(ud, uri_find, uri_replace, d):
175 uri_decoded = list(decodeurl(ud.url)) 175 uri_decoded = list(decodeurl(ud.url))
176 uri_find_decoded = list(decodeurl(uri_find)) 176 uri_find_decoded = list(decodeurl(uri_find))
177 uri_replace_decoded = list(decodeurl(uri_replace)) 177 uri_replace_decoded = list(decodeurl(uri_replace))
178 logger.debug(2, "For url %s comparing %s to %s" % (uri_decoded, uri_find_decoded, uri_replace_decoded))
178 result_decoded = ['', '', '', '', '', {}] 179 result_decoded = ['', '', '', '', '', {}]
179 for i in uri_find_decoded: 180 for i in uri_find_decoded:
180 loc = uri_find_decoded.index(i) 181 loc = uri_find_decoded.index(i)
@@ -187,12 +188,18 @@ def uri_replace(ud, uri_find, uri_replace, d):
187 result_decoded[loc] = re.sub(i, uri_replace_decoded[loc], uri_decoded[loc]) 188 result_decoded[loc] = re.sub(i, uri_replace_decoded[loc], uri_decoded[loc])
188 if uri_find_decoded.index(i) == 2: 189 if uri_find_decoded.index(i) == 2:
189 if ud.mirrortarball: 190 if ud.mirrortarball:
190 result_decoded[loc] = os.path.join(os.path.dirname(result_decoded[loc]), os.path.basename(ud.mirrortarball)) 191 if result_decoded[loc].endswith("/"):
192 result_decoded[loc] = os.path.dirname(result_decoded[loc])
193 result_decoded[loc] = os.path.join(result_decoded[loc], os.path.basename(ud.mirrortarball))
191 elif ud.localpath: 194 elif ud.localpath:
192 result_decoded[loc] = os.path.join(os.path.dirname(result_decoded[loc]), os.path.basename(ud.localpath)) 195 if result_decoded[loc].endswith("/"):
196 result_decoded[loc] = os.path.dirname(result_decoded[loc])
197 result_decoded[loc] = os.path.join(result_decoded[loc], os.path.basename(ud.localpath))
193 else: 198 else:
194 return ud.url 199 return ud.url
195 return encodeurl(result_decoded) 200 result = encodeurl(result_decoded)
201 logger.debug(2, "For url %s returning %s" % (ud.url, result))
202 return result
196 203
197methods = [] 204methods = []
198urldata_cache = {} 205urldata_cache = {}