Patchwork [bitbake-devel,12/14] fetch2: uri_replace() improve mirrortarball handling

login
register
mail settings
Submitter Richard Purdie
Date June 20, 2012, 2:13 p.m.
Message ID <24b59a3ca143af295675388fbab16bafa192ac2f.1340200208.git.richard.purdie@linuxfoundation.org>
Download mbox | patch
Permalink /patch/30301/
State New
Headers show

Comments

Richard Purdie - June 20, 2012, 2:13 p.m.
We only consider mirror tarballs when the source and target urls are of

Patch

differing types. We also should clear all url paramters when handling
mirror tarballs.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 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 945db7b..63e2e48 100644
--- a/bitbake/lib/bb/fetch2/__init__.py
+++ b/bitbake/lib/bb/fetch2/__init__.py
@@ -212,8 +212,11 @@  def uri_replace(ud, uri_find, uri_replace, d):
             if loc == 2:
                 # Handle path manipulations
                 basename = None
-                if ud.mirrortarball:
+                if uri_decoded[0] != uri_replace_decoded[0] and ud.mirrortarball:
+                    # If the source and destination url types differ, must be a mirrortarball mapping
                     basename = os.path.basename(ud.mirrortarball)
+                    # Kill parameters, they make no sense for mirror tarballs
+                    uri_decoded[5] = {}
                 elif ud.localpath:
                     basename = os.path.basename(ud.localpath)
                 if basename and not result_decoded[loc].endswith(basename):