libnetwork.lib: support for url-decoding git tag so it works with i.e. 'subproject%2F1.0' for 'subproject/1.0'

This commit is contained in:
Silvan Calarco 2022-01-06 14:20:26 +01:00
parent 4cd140d0a5
commit 4c108739a2

View File

@ -925,9 +925,13 @@ function git.download() {
"${token_dirname/\/$git_branch*}" "${token_dirname/\/$git_branch*}"
} }
# function git.urldecode
# url decodes a given string
function git.urldecode() { : "${*//+/ }"; echo -e "${_//%/\\x}"; }
# function git.create_tarball # function git.create_tarball
# clone a git repository and convert is into a tarball file # clone a git repository and convert is into a tarball file
# #
# args: # args:
# -d,--destdir : target directory # -d,--destdir : target directory
# -v,--pck-version : package version # -v,--pck-version : package version
@ -969,7 +973,7 @@ function git.create_tarball() {
notify.debug "$FUNCNAME: pck_version = \"$pck_version\"" notify.debug "$FUNCNAME: pck_version = \"$pck_version\""
;; ;;
--git-branch) --git-branch)
git_branch="$2"; shift git_branch="`git.urldecode "$2"`"; shift
if [ "${git_branch/@*}" != "${git_branch}" ]; then if [ "${git_branch/@*}" != "${git_branch}" ]; then
git_commit="${git_branch/*@}" git_commit="${git_branch/*@}"
git_branch="${git_branch/@*}" git_branch="${git_branch/@*}"