From 7cc90d2efba4f42bcbf5a3273ef8b17da6a1ee20 Mon Sep 17 00:00:00 2001 From: Davide Madrisan Date: Mon, 29 Oct 2012 23:15:58 +0100 Subject: [PATCH] pck-update (action 3,5): preliminary support for source files updates from a git repository Signed-off-by: Davide Madrisan --- ChangeLog | 4 ++++ plugins/pck-update.in | 18 ++++++++++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1bae68f..85b0fa6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -55,6 +55,10 @@ Changes in version 1.12.6 + update * lib/libnetwork.lib - Davide Madrisan: New helper function: 'git.download()'. + ++ improvement + * pck-update - Davide Madrisan: + Action 3,5: support source files update from a git repository. ------------------------------------------------------------------------------- diff --git a/plugins/pck-update.in b/plugins/pck-update.in index dc59b02..f89f0d5 100644 --- a/plugins/pck-update.in +++ b/plugins/pck-update.in @@ -1122,9 +1122,16 @@ echo $fullURL | sed "s,%[{]*version[}]*,$pck_newver,g") rpmvars.solve "$fullURL_new" "$SRPM_SPECFILE_WITH_PATH") notify.debug "fullURL_new = $fullURL_new" - curl.download --options "$curl_options" $sdflag \ + case "$fullURL_new" in + git://*|http://*.git|https://*.git) + git.download \ + --destdir="$source_dir" "$fullURL_new" + ;; + *) curl.download --options "$curl_options" $sdflag \ ${proxy:+--proxy $proxy} ${proxy_user:+--proxy-user $proxy_user} \ --exit-on-err --filenum="$totfilenum" --destdir="$source_dir" "$fullURL_new" + ;; + esac done # get the list of URL of all the patches (usually local files)... @@ -1946,9 +1953,16 @@ found ${NOTE}missing BuildRequirement${NORM} \`${NOTE}$f${NORM}'" rpmvars.solve "$fullURL" "$SRPM_SPECFILE_WITH_PATH") notify.debug "fullURL = $fullURL" - curl.download --options "$curl_options" $sdflag \ + case "$fullURL_new" in + git://*|http://*.git|https://*.git) + git.download \ + --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" + ;; + esac done # get the list of URLs for the patch files to download