pck-update.in: fix http+git and https+git protocols with preserve_dot_git support

This commit is contained in:
Silvan Calarco 2021-02-24 17:48:03 +01:00
parent bb706d3ef4
commit c3e90a144f

View File

@ -1204,11 +1204,20 @@ rpmvars.solve "$fullURL_new" "$SRPM_SPECFILE_WITH_PATH")
notify.debug "fullURL_new = $fullURL_new" notify.debug "fullURL_new = $fullURL_new"
case "$fullURL_new" in case "$fullURL_new" in
git://*|http://*.git/*|https://*.git/*|http+git://*|https+git://*) http+git://*|https+git://*)
fullURL_new="${fullURL_new/+git}" fullURL_new="${fullURL_new/+git}"
git.download \ [ -e "${source_dir}/${fullURL/*\/}" -a "$force_download" != "1" ] || \
--pck-version "$pck_newver" \ git.download \
--destdir="$source_dir" "$fullURL_new" --pck-version "$pck_newver" \
--destdir="$source_dir" "$fullURL_new" \
--preserve-dot-git 1
;;
git://*|http://*.git/*|https://*.git/*)
fullURL_new="${fullURL_new/+git}"
[ -e "${source_dir}/${fullURL/*\/}" -a "$force_download" != "1" ] || \
git.download \
--pck-version "$pck_newver" \
--destdir="$source_dir" "$fullURL_new"
;; ;;
*) curl.download --options "$curl_options" $sdflag \ *) curl.download --options "$curl_options" $sdflag \
${proxy:+--proxy $proxy} ${proxy_user:+--proxy-user $proxy_user} \ ${proxy:+--proxy $proxy} ${proxy_user:+--proxy-user $proxy_user} \
@ -2052,13 +2061,6 @@ rpmvars.solve "$fullURL" "$SRPM_SPECFILE_WITH_PATH")
notify.debug "fullURL = $fullURL" notify.debug "fullURL = $fullURL"
case "$fullURL" in case "$fullURL" in
git://*|http://*.git/*|https://*.git/*)
fullURL="${fullURL/+git}"
[ -e "${source_dir}/${fullURL/*\/}" -a "$force_download" != "1" ] || \
git.download \
--pck-version "$pck_rpmversion" \
--destdir="$source_dir" "$fullURL"
;;
http+git://*|https+git://*) http+git://*|https+git://*)
fullURL="${fullURL/+git}" fullURL="${fullURL/+git}"
[ -e "${source_dir}/${fullURL/*\/}" -a "$force_download" != "1" ] || \ [ -e "${source_dir}/${fullURL/*\/}" -a "$force_download" != "1" ] || \
@ -2067,6 +2069,13 @@ rpmvars.solve "$fullURL" "$SRPM_SPECFILE_WITH_PATH")
--destdir="$source_dir" "$fullURL" \ --destdir="$source_dir" "$fullURL" \
--preserve-dot-git 1 --preserve-dot-git 1
;; ;;
git://*|http://*.git/*|https://*.git/*)
fullURL="${fullURL/+git}"
[ -e "${source_dir}/${fullURL/*\/}" -a "$force_download" != "1" ] || \
git.download \
--pck-version "$pck_rpmversion" \
--destdir="$source_dir" "$fullURL"
;;
*) curl.download --options "$curl_options" $sdflag \ *) curl.download --options "$curl_options" $sdflag \
${proxy:+--proxy $proxy} ${proxy_user:+--proxy-user $proxy_user} \ ${proxy:+--proxy $proxy} ${proxy_user:+--proxy-user $proxy_user} \
--exit-on-err --filenum="$totfilenum" --destdir="$source_dir" "$fullURL" --exit-on-err --filenum="$totfilenum" --destdir="$source_dir" "$fullURL"