aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Robert Beckett <bbeckett@netvu.org.uk>2018-06-04 14:32:30 +0100
committerGravatar Peter Korsgaard <peter@korsgaard.com>2018-07-17 09:10:08 +0200
commit6eddb997357e5afd5a0af524fa638ccecbff1d30 (patch)
treea3717f4563d59935ccc7fc87cfba39db09409501
parent5f5cf32069ff0439c13c3bf1915f3d18632e0a55 (diff)
downloadbuildroot-6eddb997357e5afd5a0af524fa638ccecbff1d30.tar.gz
buildroot-6eddb997357e5afd5a0af524fa638ccecbff1d30.tar.bz2
dl-wrapper: Fix support for URIs containing '+'
'+' 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> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com> (cherry picked from commit a5ba72946ebf597a163bae9b12453dfa68993d54) Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
-rwxr-xr-xsupport/download/dl-wrapper2
1 files changed, 1 insertions, 1 deletions
diff --git a/support/download/dl-wrapper b/support/download/dl-wrapper
index 8d6365e08d..4059c37ebc 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" ;;