summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2011-06-10 09:13:24 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-06-13 15:04:48 +0100
commitc1d978d7bd1ac8eb1e2d50029ab2384be9f72fb4 (patch)
tree99a3733403e837cdff9b002c4507c2b14e26a241
parent1430a36e81737bd92245042710eb9d6ad8b6f1a7 (diff)
downloadbitbake-c1d978d7bd1ac8eb1e2d50029ab2384be9f72fb4.tar.gz
bitbake/fetch2: When replacing URLs in mirror handling mask out empty entries
The symptom of this problem is something like a cvs url which specifies a username where the username is then passed through to something like an http mirror. This patch fixes things by ensuring empty entries are preserved in the new URL. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--lib/bb/fetch2/__init__.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/bb/fetch2/__init__.py b/lib/bb/fetch2/__init__.py
index 27fcc3cf7..02a36b523 100644
--- a/lib/bb/fetch2/__init__.py
+++ b/lib/bb/fetch2/__init__.py
@@ -203,7 +203,10 @@ def uri_replace(ud, uri_find, uri_replace, d):
result_decoded[loc] = uri_decoded[loc]
if isinstance(i, basestring):
if (re.match(i, uri_decoded[loc])):
- result_decoded[loc] = re.sub(i, uri_replace_decoded[loc], uri_decoded[loc])
+ if not uri_replace_decoded[loc]:
+ result_decoded[loc] = ""
+ else:
+ result_decoded[loc] = re.sub(i, uri_replace_decoded[loc], uri_decoded[loc])
if uri_find_decoded.index(i) == 2:
if ud.mirrortarball:
result_decoded[loc] = os.path.join(os.path.dirname(result_decoded[loc]), os.path.basename(ud.mirrortarball))