[bitbake-devel] [PATCH] wget.py: support for semi-colons in URL

Richard Purdie richard.purdie at linuxfoundation.org
Mon Jul 27 20:01:43 UTC 2015


On Mon, 2015-07-27 at 10:58 -0700, Christopher Larson wrote:
> 
> On Mon, Jul 27, 2015 at 9:10 AM, Bystricky, Juro
> <juro.bystricky at intel.com> wrote:
>         I agree that a generic solution is preferable. I also I think
>         it is only prudent to support all valid URLs.
>         
>         The situation is complicated by the fact that at present it
>         may not be possible to determine how to interpret the ‘;’ in
>         SRC_URI.
>         
>         It can be part of the URL or it can be a SRC_URI
>         delimiter/separator.
>         
>         As I don’t suppose changing the delimiter character from
>         semi-colon to something else (i.e. an unsafe URL character)
>         
>         is an option, some other changes to the SRC_URI syntax are
>         needed, for example:
>         
>          
>         
>         1.      Some form of escape sequence (i.e. ‘;;’ means treat as
>         ‘;’) in URL, i.e.
>         
>         SRC_URI =
>         "http://abc123.com/git/?p=gcc/gcc.git;;a=snapshot;;h=a5dd47;downloadfilename=abc.tar"
>         
> 
> 
> This is probably the only sane bet to retain compatibility, at least
> as far as I can tell, but perhaps someone else has an idea.
>
>         2.      Quoted string implementation, using one of the
>         “unsafe” URL characters such as ‘`’, to delimit  the URL
>
>         SRC_URI = "’
>         http://abc123.com/git/?p=gcc/gcc.git;a=snapshot;h=a5dd47`;downloadfilename=abc.tar"
>
> Clearly this would be ideal, and is what we should have done, but it’s
> a bit late now :) It’s not the only questionable choice we made in the
> URL handling back when we wrote the original fetcher (e.g. file://
> rather than file:, but afaik one should only use the former if there’s
> a netloc/host).

Yes, horse has bolted now. A bit like a lot of bitbake, hindsight is
great! :}.

There is an alternative I've been mulling over the weekend:

http://abc123.com/git/?p=gcc/gcc.git;extraparams=`;a=snapshot;h=a5dd47`;downloadfilename=abc.tar"
or
http://abc123.com/git/?p=gcc/gcc.git;extraparams=a=snapshot%3Bh=a5dd47;downloadfilename=abc.tar"

(or some variant of that, pick your favourite quote characters and ;
placement is for discussion). We'd then just pull out extraparams and
unescape it somehow. Each fetcher could then deal with it as
appropriate, or its just a wget fetcher specific option.

Just thinking out loud really...

Cheers,

Richard








More information about the bitbake-devel mailing list