Skip to contentSkip to conversation

fetch2: replace double slashes in paths in encodeurl()

PATCH Applied Paul Eggleton 2 participants 2 messages Sep 7, 2012

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 fetch2: replace double slashes in paths in encodeurl()

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/lib/bb/fetch2/__init__.py |    3 +++
 1 file changed, 3 insertions(+)
bitbake/lib/bb/fetch2/__init__.py +3 -0
index 12ebce2..b232d3e 100644
@@ -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:
Signature · 1 line
1.7.9.5
#1 lore raw
Quoted 9 lines · Paul Eggleton

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/lib/bb/fetch2/__init__.py |    3 +++
 1 file changed, 3 insertions(+)

Merged to master, thanks.

Richard