diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-06-10 09:13:24 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-06-13 15:10:07 +0100 |
commit | e5f3cc34df74c08c8cab3e1cf9207fafaec6cb9a (patch) | |
tree | 09e947349a9bdba5c3c39ab2a209cc23efaa75f2 /bitbake/lib/bb | |
parent | ba5db2d81c11089a321629cf2161c78adfe95675 (diff) | |
download | poky-e5f3cc34df74c08c8cab3e1cf9207fafaec6cb9a.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.
(Bitbake rev: c1d978d7bd1ac8eb1e2d50029ab2384be9f72fb4)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb')
-rw-r--r-- | bitbake/lib/bb/fetch2/__init__.py | 5 |
1 files changed, 4 insertions, 1 deletions
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): | |||
203 | result_decoded[loc] = uri_decoded[loc] | 203 | result_decoded[loc] = uri_decoded[loc] |
204 | if isinstance(i, basestring): | 204 | if isinstance(i, basestring): |
205 | if (re.match(i, uri_decoded[loc])): | 205 | if (re.match(i, uri_decoded[loc])): |
206 | result_decoded[loc] = re.sub(i, uri_replace_decoded[loc], uri_decoded[loc]) | 206 | if not uri_replace_decoded[loc]: |
207 | result_decoded[loc] = "" | ||
208 | else: | ||
209 | result_decoded[loc] = re.sub(i, uri_replace_decoded[loc], uri_decoded[loc]) | ||
207 | if uri_find_decoded.index(i) == 2: | 210 | if uri_find_decoded.index(i) == 2: |
208 | if ud.mirrortarball: | 211 | if ud.mirrortarball: |
209 | result_decoded[loc] = os.path.join(os.path.dirname(result_decoded[loc]), os.path.basename(ud.mirrortarball)) | 212 | result_decoded[loc] = os.path.join(os.path.dirname(result_decoded[loc]), os.path.basename(ud.mirrortarball)) |