From: Yann E. MORIN <yann.morin.1998@free.fr>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 2/2] dl-wrapper: Fix support for URIs containing '+'
Date: Mon, 4 Jun 2018 17:56:45 +0200 [thread overview]
Message-ID: <20180604155645.GB3700@scaer> (raw)
In-Reply-To: <1528119150-28659-2-git-send-email-bbeckett@netvu.org.uk>
Robert, All,
On 2018-06-04 14:32 +0100, Robert Beckett spake thusly:
> '+' is a valid character in a url. The current dl-wrapper gets the
> URI scheme by dropping everything after the last '+' character, with
> the intension of finding 'git' from e.g. 'git+https://uri'.
>
> If a uri has a '+' anywhere in it, it ends up using too much of the
> string as a scheme, and fails to match the handler properly.
>
> An example of where this form of URI is used is when using deploy tokens
> in gitlab. It uses a form like https://<username>:<password>@gitlab.com/<group>/<repo.git>
> where username for deploy token is of the form 'gitlab+deploy-token-<number>'.
>
> Use the %% operator to search backwards until the last '+' character when
> dropping the rest of the string as we know that the first '+'
> in the string should be the scheme.
>
> Signed-off-by: Robert Beckett <bbeckett@netvu.org.uk>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Regards,
Yann E. MORIN.
> ---
> support/download/dl-wrapper | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/support/download/dl-wrapper b/support/download/dl-wrapper
> index 8d6365e..4059c37 100755
> --- a/support/download/dl-wrapper
> +++ b/support/download/dl-wrapper
> @@ -88,7 +88,7 @@ main() {
> download_and_check=0
> rc=1
> for uri in "${uris[@]}"; do
> - backend=${uri%+*}
> + backend=${uri%%+*}
> case "${backend}" in
> git|svn|cvs|bzr|file|scp|hg) ;;
> *) backend="wget" ;;
> --
> 2.7.4
>
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
next prev parent reply other threads:[~2018-06-04 15:56 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-04 13:32 [Buildroot] [PATCH 1/2] git: fix handling of git repos using master as version Robert Beckett
2018-06-04 13:32 ` [Buildroot] [PATCH 2/2] dl-wrapper: Fix support for URIs containing '+' Robert Beckett
2018-06-04 15:56 ` Yann E. MORIN [this message]
2018-06-04 20:00 ` Thomas Petazzoni
2018-06-04 14:33 ` [Buildroot] [PATCH 1/2] git: fix handling of git repos using master as version Thomas Petazzoni
2018-06-04 14:59 ` Bob Beckett
2018-06-04 15:44 ` Yann E. MORIN
2018-06-04 16:32 ` Bob Beckett
2018-06-04 16:52 ` Gary Bisson
2018-06-04 16:54 ` Bob Beckett
2018-06-04 17:22 ` Henrique Marks
2018-06-04 22:45 ` Trent Piepho
2018-06-04 22:19 ` Arnout Vandecappelle
2018-06-05 3:26 ` Baruch Siach
2018-06-05 19:36 ` Arnout Vandecappelle
2018-06-05 5:53 ` Thomas Petazzoni
2018-06-04 16:23 ` Thomas Petazzoni
2018-06-04 16:51 ` Bob Beckett
2018-06-04 22:18 ` Arnout Vandecappelle
2018-06-05 7:57 ` Thomas Petazzoni
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=20180604155645.GB3700@scaer \
--to=yann.morin.1998@free.fr \
--cc=buildroot@busybox.net \
/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