From e5f3cc34df74c08c8cab3e1cf9207fafaec6cb9a Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Fri, 10 Jun 2011 09:13:24 +0100 Subject: [PATCH] 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. (Bitbake rev: c1d978d7bd1ac8eb1e2d50029ab2384be9f72fb4) Signed-off-by: Richard Purdie --- bitbake/lib/bb/fetch2/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py index 27fcc3cf76..02a36b523d 100644 --- a/bitbake/lib/bb/fetch2/__init__.py +++ b/bitbake/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))