[bitbake-devel] fetch2: fix fetcher looping due to self-referential entries

Submitted by Paul Eggleton on Sept. 7, 2012, 1:18 p.m.

Details

Message ID 1347023891-9237-1-git-send-email-paul.eggleton@linux.intel.com
State Superseded
Headers show

Commit Message

Paul Eggleton Sept. 7, 2012, 1:18 p.m.
Ensure that if all a MIRRORS entry does is add a slash, this does not
result in a circular loop.

Fixes [YOCTO #3073].

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 bitbake/lib/bb/fetch2/__init__.py |    1 +
 1 file changed, 1 insertion(+)

Patch hide | download patch | download mbox

diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py
index 12ebce2..a90249f 100644
--- a/bitbake/lib/bb/fetch2/__init__.py
+++ b/bitbake/lib/bb/fetch2/__init__.py
@@ -178,6 +178,7 @@  def encodeurl(decoded):
         url += "@"
     if host and type != "file":
         url += "%s" % host
+    path = path.replace("//", "/")
     url += "%s" % urllib.quote(path)
     if p:
         for parm in p:

Comments

Paul Eggleton Sept. 7, 2012, 1:31 p.m.
On Friday 07 September 2012 14:18:11 Paul Eggleton wrote:
> Ensure that if all a MIRRORS entry does is add a slash, this does not
> result in a circular loop.
> 
> Fixes [YOCTO #3073].
> 
> Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
> ---
>  bitbake/lib/bb/fetch2/__init__.py |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/bitbake/lib/bb/fetch2/__init__.py
> b/bitbake/lib/bb/fetch2/__init__.py index 12ebce2..a90249f 100644
> --- a/bitbake/lib/bb/fetch2/__init__.py
> +++ b/bitbake/lib/bb/fetch2/__init__.py
> @@ -178,6 +178,7 @@ def encodeurl(decoded):
>          url += "@"
>      if host and type != "file":
>          url += "%s" % host
> +    path = path.replace("//", "/")
>      url += "%s" % urllib.quote(path)
>      if p:
>          for parm in p:

Actually I'll tweak this a bit with a different shortlog, ignore this.

Cheers,
Paul