[OE-core] [bitbake-devel] [PATCH 20/20] fetch: allow regexps in mirror protocol

Richard Purdie richard.purdie at linuxfoundation.org
Wed Jun 27 20:35:32 UTC 2012


On Wed, 2012-06-27 at 16:52 +0200, Enrico Scholz wrote:
> Last mirror rewrite caused a regression not accepting
> 
>    .*://.*/.* file://${DL_DIR}/../local/
> 
> like specifications anymore. Patch restores old behavior by using regexp
> matching when checking protocol.
> 
> Signed-off-by: Enrico Scholz <enrico.scholz at sigma-chemnitz.de>
> ---
>  lib/bb/fetch2/__init__.py |    2 +-
>  1 Datei geändert, 1 Zeile hinzugefügt(+), 1 Zeile entfernt(-)
> 
> diff --git a/lib/bb/fetch2/__init__.py b/lib/bb/fetch2/__init__.py
> index 6f3d88c..75ce01b 100644
> --- a/lib/bb/fetch2/__init__.py
> +++ b/lib/bb/fetch2/__init__.py
> @@ -207,7 +207,7 @@ def uri_replace(ud, uri_find, uri_replace, d):
>          elif loc == 0:
>              # Principle of least surprise. We could end up with https matching against http and 
>              # generating "files://" urls if we use the regexp engine below.
> -            if i != uri_decoded[loc]:
> +            if not re.match(i, uri_decoded[loc]):
>                  return None
>              result_decoded[loc] = uri_replace_decoded[loc]
>          elif (re.match(i, uri_decoded[loc])):

I'm not picking on you (Enrico) here, there is a problem with my change
and we probably should revert my change in this area.

However the above patch fails "bitbake-selftest" and introduces a
regression. I wrote regression tests for the fetcher for a reason.

The trouble is its sees:

https://.*/.* file:///someplace/

but returns a url like files:// which the fetcher doesn't understand.
Suggestions on how to fix this are welcome.

Cheers,

Richard









More information about the Openembedded-core mailing list