Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
Cc: bitbake-devel@lists.openembedded.org,
	openembedded-core@lists.openembedded.org
Subject: Re: [bitbake-devel] [PATCH 20/20] fetch: allow regexps in mirror protocol
Date: Wed, 27 Jun 2012 21:35:32 +0100	[thread overview]
Message-ID: <1340829332.23146.86.camel@ted> (raw)
In-Reply-To: <1340808774-24884-1-git-send-email-enrico.scholz@sigma-chemnitz.de>

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@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








  parent reply	other threads:[~2012-06-27 20:46 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1340289297.1640.122.camel@ted>
2012-06-26 17:31 ` (PRE)MIRRORS doesn't work with https?$:// anymore Was: [bitbake-devel] [PATCH] fetch2: Add new mirror syntax to simplify mirror specifications Martin Jansa
2012-06-27 10:34   ` Richard Purdie
2012-06-27 11:06     ` Martin Jansa
2012-06-27 14:52     ` [PATCH 20/20] fetch: allow regexps in mirror protocol Enrico Scholz
2012-06-27 14:59       ` Robert P. J. Day
2012-06-27 20:35       ` Richard Purdie [this message]
2012-06-28  0:18         ` [bitbake-devel] " Enrico Scholz
2012-06-28  0:27           ` Enrico Scholz
2012-06-28 11:42             ` Richard Purdie
2012-06-28 11:43           ` Richard Purdie
2012-06-27 14:54     ` (PRE)MIRRORS doesn't work with https?$:// anymore Was: [bitbake-devel] [PATCH] fetch2: Add new mirror syntax to simplify mirror specifications Enrico Scholz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1340829332.23146.86.camel@ted \
    --to=richard.purdie@linuxfoundation.org \
    --cc=bitbake-devel@lists.openembedded.org \
    --cc=enrico.scholz@sigma-chemnitz.de \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox