Commit 66e607a4caa07b301614131c00a1521d669cca4d

Authored by Silvan Calarco
1 parent 169dcf8bb9
Exists in master

pck-update,linnetwork.lib: preserve .git directory if protocol is http[s]+git

Showing 3 changed files with 19 additions and 5 deletions Side-by-side Diff

1   -VERSION=1.16.6
  1 +VERSION=1.16.7
2 2 RELEASE=1mamba
lib/libnetwork.lib.in
... ... @@ -852,6 +852,7 @@
852 852 # -d, --destdir : target directory
853 853 # -p, --proxy : proxy server
854 854 # -u, --proxy-user : proxy user
  855 +# --preserve-dot-git : do not remove .git files
855 856 # $@ : git repository
856 857 #
857 858 # return value:
858 859  
... ... @@ -860,14 +861,15 @@
860 861 function git.download() {
861 862 local ARGS
862 863 ARGS=`LC_ALL=C getopt \
863   - -o d:v:p:u: \
864   - --long destdir:,pck-version:,proxy:,proxy-user: \
  864 + -o d:v:p:u:k \
  865 + --long destdir:,pck-version:,proxy:,proxy-user:,preserve-dot-git: \
865 866 -n "$FUNCNAME" -- "$@"`
866 867 [ $? = 0 ] || notify.error $"(bug)"" -- $FUNCNAME: "$"\`getopt' error"
867 868  
868 869 local destdir
869 870 local proxy proxy_user
870 871 local pck_version
  872 + local preserve_dot_git=0
871 873  
872 874 eval set -- "$ARGS"
873 875 while :; do
... ... @@ -888,6 +890,10 @@
888 890 proxy_user="$2"; shift
889 891 notify.debug "$FUNCNAME: proxy_user = \"$proxy_user\""
890 892 ;;
  893 + --preserve-dot-git)
  894 + preserve_dot_git="$2"; shift
  895 + notify.debug "$FUNCNAME: preserve_dot_git = \"$preserve_dot_git\""
  896 + ;;
891 897 --) shift; break;;
892 898 *) notify.error $"\
893 899 (bug)"" -- $FUNCNAME: "$"\`getopt' error: bad command \`$1'" ;;
... ... @@ -915,7 +921,7 @@
915 921 git.create_tarball \
916 922 --pck-version "$pck_version" \
917 923 --destdir "$destdir" \
918   - --preserve-dot-git "0" --git-branch "$git_branch" \
  924 + --preserve-dot-git "${preserve_dot_git}" --git-branch "$git_branch" \
919 925 "${token_dirname/\/$git_branch*}"
920 926 }
921 927  
plugins/pck-update.in
... ... @@ -2052,12 +2052,20 @@
2052 2052 notify.debug "fullURL = $fullURL"
2053 2053  
2054 2054 case "$fullURL" in
2055   - git://*|http://*.git/*|https://*.git/*|http+git://*|https+git://*)
  2055 + git://*|http://*.git/*|https://*.git/*)
2056 2056 fullURL="${fullURL/+git}"
2057 2057 [ -e "${source_dir}/${fullURL/*\/}" -a "$force_download" != "1" ] || \
2058 2058 git.download \
2059 2059 --pck-version "$pck_rpmversion" \
2060 2060 --destdir="$source_dir" "$fullURL"
  2061 + ;;
  2062 + http+git://*|https+git://*)
  2063 + fullURL="${fullURL/+git}"
  2064 + [ -e "${source_dir}/${fullURL/*\/}" -a "$force_download" != "1" ] || \
  2065 + git.download \
  2066 + --pck-version "$pck_rpmversion" \
  2067 + --destdir="$source_dir" "$fullURL" \
  2068 + --preserve-dot-git 1
2061 2069 ;;
2062 2070 *) curl.download --options "$curl_options" $sdflag \
2063 2071 ${proxy:+--proxy $proxy} ${proxy_user:+--proxy-user $proxy_user} \