aboutsummaryrefslogtreecommitdiffstats
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:09:01 +0100
commit604df1b25cf114e083f52917df2df64e01279c25 (patch)
treec7c763b521e0dd4f5d42be55c189b84498d3fe8d
parent0d0a12fa0e4dabf01c1c24370aff54d26690a6dc (diff)
downloadbitbake-604df1b25cf114e083f52917df2df64e01279c25.tar.gz
bitbake-604df1b25cf114e083f52917df2df64e01279c25.tar.bz2
bitbake-604df1b25cf114e083f52917df2df64e01279c25.zip
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) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--lib/bb/fetch2/__init__.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/bb/fetch2/__init__.py b/lib/bb/fetch2/__init__.py
index 88905f9b..1b99a0fe 100644
--- a/lib/bb/fetch2/__init__.py
+++ b/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] = ""