summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2012-06-20 12:55:11 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-06-21 13:07:43 +0100
commit3c468ac3ed6d045561afce19b85ae9dd18d87cea (patch)
treeec2ef3bf163612cd147eeaf74bcabdaf1cb8cf09 /lib
parent84ffc261f376429b3a6b5d7bf2f6217cd10ca12a (diff)
downloadbitbake-3c468ac3ed6d045561afce19b85ae9dd18d87cea.tar.gz
fetch2: Add parameter handling to uri_replace()
This means that parameters in the source expression are used as part of the match. Parameters in the destination are used explicitly in the final url. (From Poky rev: c465cb0c5c927dd41d96ad6d6fa1566349574bb7) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/bb/fetch2/__init__.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/bb/fetch2/__init__.py b/lib/bb/fetch2/__init__.py
index 05ecd3c34..06be82da2 100644
--- a/lib/bb/fetch2/__init__.py
+++ b/lib/bb/fetch2/__init__.py
@@ -194,7 +194,15 @@ def uri_replace(ud, uri_find, uri_replace, d):
for loc, i in enumerate(uri_find_decoded):
result_decoded[loc] = uri_decoded[loc]
if loc == 5:
- continue
+ # Handle URL parameters
+ if i:
+ # Any specified URL parameters must match
+ for k in uri_replace_decoded[loc]:
+ if uri_decoded[loc][k] != uri_replace_decoded[loc][k]:
+ return None
+ # Overwrite any specified replacement parameters
+ for k in uri_replace_decoded[loc]:
+ result_decoded[loc][k] = uri_replace_decoded[loc][k]
elif (re.match(i, uri_decoded[loc])):
if not uri_replace_decoded[loc]:
result_decoded[loc] = ""