bitbake: fetch2: replace double slashes in paths in encodeurl()
authorPaul Eggleton <paul.eggleton@linux.intel.com>
Fri, 7 Sep 2012 13:34:35 +0000 (14:34 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 7 Sep 2012 13:50:04 +0000 (14:50 +0100)
This ensures that if all a MIRRORS entry does is add a slash, this does
not result in a circular loop.

Fixes [YOCTO #3073].

(Bitbake rev: 57055d337a2c9997a6e5d5bdabaec396e3e128e9)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
bitbake/lib/bb/fetch2/__init__.py

index 00fafb6..fae1add 100644 (file)
@@ -178,6 +178,9 @@ def encodeurl(decoded):
         url += "@"
     if host and type != "file":
         url += "%s" % host
+    # Standardise path to ensure comparisons work
+    while '//' in path:
+        path = path.replace("//", "/")
     url += "%s" % urllib.quote(path)
     if p:
         for parm in p: