diff options
Diffstat (limited to 'bitbake')
-rw-r--r-- | bitbake/lib/bb/fetch2/__init__.py | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py index ce2fb23b48..05ecd3c343 100644 --- a/bitbake/lib/bb/fetch2/__init__.py +++ b/bitbake/lib/bb/fetch2/__init__.py | |||
@@ -193,24 +193,25 @@ def uri_replace(ud, uri_find, uri_replace, d): | |||
193 | result_decoded = ['', '', '', '', '', {}] | 193 | result_decoded = ['', '', '', '', '', {}] |
194 | for loc, i in enumerate(uri_find_decoded): | 194 | for loc, i in enumerate(uri_find_decoded): |
195 | result_decoded[loc] = uri_decoded[loc] | 195 | result_decoded[loc] = uri_decoded[loc] |
196 | if isinstance(i, basestring): | 196 | if loc == 5: |
197 | if (re.match(i, uri_decoded[loc])): | 197 | continue |
198 | if not uri_replace_decoded[loc]: | 198 | elif (re.match(i, uri_decoded[loc])): |
199 | result_decoded[loc] = "" | 199 | if not uri_replace_decoded[loc]: |
200 | else: | 200 | result_decoded[loc] = "" |
201 | result_decoded[loc] = re.sub(i, uri_replace_decoded[loc], uri_decoded[loc]) | ||
202 | if loc == 2: | ||
203 | basename = None | ||
204 | if ud.mirrortarball: | ||
205 | basename = os.path.basename(ud.mirrortarball) | ||
206 | elif ud.localpath: | ||
207 | basename = os.path.basename(ud.localpath) | ||
208 | if basename and result_decoded[loc].endswith("/"): | ||
209 | result_decoded[loc] = os.path.dirname(result_decoded[loc]) | ||
210 | if basename and not result_decoded[loc].endswith(basename): | ||
211 | result_decoded[loc] = os.path.join(result_decoded[loc], basename) | ||
212 | else: | 201 | else: |
213 | return None | 202 | result_decoded[loc] = re.sub(i, uri_replace_decoded[loc], uri_decoded[loc]) |
203 | if loc == 2: | ||
204 | basename = None | ||
205 | if ud.mirrortarball: | ||
206 | basename = os.path.basename(ud.mirrortarball) | ||
207 | elif ud.localpath: | ||
208 | basename = os.path.basename(ud.localpath) | ||
209 | if basename and result_decoded[loc].endswith("/"): | ||
210 | result_decoded[loc] = os.path.dirname(result_decoded[loc]) | ||
211 | if basename and not result_decoded[loc].endswith(basename): | ||
212 | result_decoded[loc] = os.path.join(result_decoded[loc], basename) | ||
213 | else: | ||
214 | return None | ||
214 | result = encodeurl(result_decoded) | 215 | result = encodeurl(result_decoded) |
215 | if result == ud.url: | 216 | if result == ud.url: |
216 | return None | 217 | return None |