From c3e90a144f627d19f623c21b1f3a67f078222f77 Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Wed, 24 Feb 2021 17:48:03 +0100 Subject: [PATCH] pck-update.in: fix http+git and https+git protocols with preserve_dot_git support --- plugins/pck-update.in | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/plugins/pck-update.in b/plugins/pck-update.in index ebe0ad7..098ac95 100644 --- a/plugins/pck-update.in +++ b/plugins/pck-update.in @@ -1204,11 +1204,20 @@ rpmvars.solve "$fullURL_new" "$SRPM_SPECFILE_WITH_PATH") notify.debug "fullURL_new = $fullURL_new" case "$fullURL_new" in - git://*|http://*.git/*|https://*.git/*|http+git://*|https+git://*) + http+git://*|https+git://*) fullURL_new="${fullURL_new/+git}" - git.download \ - --pck-version "$pck_newver" \ - --destdir="$source_dir" "$fullURL_new" + [ -e "${source_dir}/${fullURL/*\/}" -a "$force_download" != "1" ] || \ + git.download \ + --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 \ ${proxy:+--proxy $proxy} ${proxy_user:+--proxy-user $proxy_user} \ @@ -2052,13 +2061,6 @@ rpmvars.solve "$fullURL" "$SRPM_SPECFILE_WITH_PATH") notify.debug "fullURL = $fullURL" 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://*) fullURL="${fullURL/+git}" [ -e "${source_dir}/${fullURL/*\/}" -a "$force_download" != "1" ] || \ @@ -2067,6 +2069,13 @@ rpmvars.solve "$fullURL" "$SRPM_SPECFILE_WITH_PATH") --destdir="$source_dir" "$fullURL" \ --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 \ ${proxy:+--proxy $proxy} ${proxy_user:+--proxy-user $proxy_user} \ --exit-on-err --filenum="$totfilenum" --destdir="$source_dir" "$fullURL"