From: "Patrick Williams" <patrick@stwcx.xyz>
To: bitbake-devel@lists.openembedded.org
Subject: Re: [PATCH v4] fetch2/wget: include parameters in URL
Date: Wed, 30 Dec 2020 16:06:28 -0600 [thread overview]
Message-ID: <X+z55CKAFrEE0Hdr@heinlein> (raw)
In-Reply-To: <20201230220323.727622-1-patrick@stwcx.xyz>
[-- Attachment #1: Type: text/plain, Size: 2407 bytes --]
On Wed, Dec 30, 2020 at 04:03:23PM -0600, Patrick Williams wrote:
> The wget fetcher currently silently drops all parameters and has
> been that way since it was originally introduced in fetch via 080eb8764.
> This prevents use in SOURCE_MIRROR_URL and SRC_URI which require
> additional parameters.
>
> Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
> ---
> lib/bb/fetch2/wget.py | 12 +++++++++---
> 1 file changed, 9 insertions(+), 3 deletions(-)
>
> diff --git a/lib/bb/fetch2/wget.py b/lib/bb/fetch2/wget.py
> index e6d9f528..0019f10c 100644
> --- a/lib/bb/fetch2/wget.py
> +++ b/lib/bb/fetch2/wget.py
> @@ -91,7 +91,14 @@ class Wget(FetchMethod):
>
> fetchcmd = self.basecmd
>
> - if 'downloadfilename' in ud.parm:
> + # Join the URL components together.
> + url_parts = ud.url.split(";")
> + if len(url_parts) == 1:
> + uri = url_parts[0]
> + else:
> + uri = url_parts[0] + "?" + "&".join(url_parts[1:])
> +
> + if 'downloadfilename' in ud.parm or len(url_parts) != 1:
> localpath = os.path.join(d.getVar("DL_DIR"), ud.localfile)
> bb.utils.mkdirhier(os.path.dirname(localpath))
> fetchcmd += " -O %s" % shlex.quote(localpath)
> @@ -99,7 +106,6 @@ class Wget(FetchMethod):
> if ud.user and ud.pswd:
> fetchcmd += " --user=%s --password=%s --auth-no-challenge" % (ud.user, ud.pswd)
>
> - uri = ud.url.split(";")[0]
I ran into one more edge case trying to re-download a file from my
internal mirror service: netbase_6.1~bpo10+1.tar.xz . The URL
contains a URL-quoted version of the filename. Switched the code
to reuse the 'downloadfilename' logic earlier in the function, which
is safer anyhow because it uses shlex, etc.
> if os.path.exists(ud.localpath):
> # file exists, but we didnt complete it.. trying again..
> fetchcmd += d.expand(" -c -P ${DL_DIR} '%s'" % uri)
> @@ -441,7 +447,7 @@ class Wget(FetchMethod):
> valid = 1
> elif self._vercmp(version, newver) < 0:
> version = newver
> -
> +
> pupver = re.sub('_', '.', version[1])
>
> bb.debug(3, "*** %s -> UpstreamVersion = %s (CurrentVersion = %s)" %
> --
> 2.26.2
>
--
Patrick Williams
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 849 bytes --]
prev parent reply other threads:[~2020-12-30 22:06 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-29 15:13 [PATCH] fetch2/wget: include paramters in URL Patrick Williams
2020-12-29 21:05 ` Patrick Williams
2020-12-29 21:16 ` [PATCH v2] fetch2/wget: include parameters " Patrick Williams
2020-12-29 21:57 ` [PATCH v3] " Patrick Williams
2020-12-29 22:02 ` Patrick Williams
2020-12-30 22:03 ` [PATCH v4] " Patrick Williams
2020-12-30 22:06 ` Patrick Williams [this message]
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=X+z55CKAFrEE0Hdr@heinlein \
--to=patrick@stwcx.xyz \
--cc=bitbake-devel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.