]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
bitbake/fetch2: When replacing URLs in mirror handling mask out empty entries
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 10 Jun 2011 08:13:24 +0000 (09:13 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 13 Jun 2011 14:10:07 +0000 (15:10 +0100)
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>
bitbake/lib/bb/fetch2/__init__.py

index 27fcc3cf76df0598ed7be816762e1a04cec5464b..02a36b523d7844fddeb0908ed547f3bdd4f51fe8 100644 (file)
@@ -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))