aboutsummaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2012-06-20 16:37:22 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-06-21 13:10:34 +0100
commitdf0059b465a07e7d01642b7a4e240fd40e916fe0 (patch)
tree8c74ce6be7fbb9587d4ff0b2d8dd62208c1bae7c /bitbake
parentdd249ebe67095178608756aac978a7206951ccc4 (diff)
downloadopenembedded-core-contrib-df0059b465a07e7d01642b7a4e240fd40e916fe0.tar.gz
bitbake: fetch2: Update replace_uri to handle uri types explicitly
For mirror mapping, we never use regexps for the type component of the url. Doing so causes various slightly bizarre behaviour such as https:// urls being translated to files:// urls which we have no handler for. This patch forces the type matches to be direct, not regexp based and gives the expected bahvriour. (From Poky rev: 695d8aca0999d2d61970b990e83c3132ba6f12cb) (Bitbake rev: 604df1b25cf114e083f52917df2df64e01279c25) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/fetch2/__init__.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py
index 88905f9b4b..1b99a0fe49 100644
--- a/bitbake/lib/bb/fetch2/__init__.py
+++ b/bitbake/lib/bb/fetch2/__init__.py
@@ -203,6 +203,12 @@ def uri_replace(ud, uri_find, uri_replace, d):
# Overwrite any specified replacement parameters
for k in uri_replace_decoded[loc]:
result_decoded[loc][k] = uri_replace_decoded[loc][k]
+ elif loc == 0:
+ # Principle of least surprise. We could end up with https matching against http and
+ # generating "files://" urls if we use the regexp engine below.
+ if i != uri_decoded[loc]:
+ return None
+ result_decoded[loc] = uri_replace_decoded[loc]
elif (re.match(i, uri_decoded[loc])):
if not uri_replace_decoded[loc]:
result_decoded[loc] = ""