Patchwork [bitbake-devel] fetch2: Ensure expansions happen in URL parameters in uri_replace

login
register
mail settings
Submitter Richard Purdie
Date Feb. 14, 2013, 9:36 p.m.
Message ID <1360877790.11225.125.camel@ted>
Download mbox | patch
Permalink /patch/44665/
State New
Headers show

Comments

Richard Purdie - Feb. 14, 2013, 9:36 p.m.
For example, this allows us to specify downloadfilename=PATH in sstate
mirror urls to improve directory structures in DL_DIR when using sstate.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---

Patch

diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py
index 21f576e..3f5de99 100644
--- a/bitbake/lib/bb/fetch2/__init__.py
+++ b/bitbake/lib/bb/fetch2/__init__.py
@@ -214,6 +214,8 @@  def uri_replace(ud, uri_find, uri_replace, replacements, d):
                         return None
             # Overwrite any specified replacement parameters
             for k in uri_replace_decoded[loc]:
+                for l in replacements:
+                    uri_replace_decoded[loc][k] = uri_replace_decoded[loc][k].replace(l, replacements[l])
                 result_decoded[loc][k] = uri_replace_decoded[loc][k]
         elif (re.match(regexp, uri_decoded[loc])):
             if not uri_replace_decoded[loc]: