bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gnupload --replace


From: Karl Berry
Subject: gnupload --replace
Date: Sat, 9 Jun 2012 23:47:09 GMT

Here is a patch to gnupload to implement --replace, per the new upload
"protocol".  Any comments/suggestions before I commit it?

k

--- a/build-aux/gnupload
+++ b/build-aux/gnupload
@@ -28,6 +28,7 @@ GPG='gpg --batch --no-tty'
 conffile=.gnuploadrc
 to=
 dry_run=false
+replace=
 symlink_files=
 delete_files=
 delete_symlinks=
@@ -53,8 +54,10 @@ Options:
   --to DEST                specify one destination for FILES
                            (multiple --to options are allowed)
   --user NAME              sign with key NAME
+  --replace                allow replacements of existing files
   --symlink-regex[=EXPR]   use sed script EXPR to compute symbolic link names
   --dry-run                do nothing, show what would have been done
+                           (including the constructed directive file)
   --version                output version information and exit
 
 If --symlink-regex is given without EXPR, then the link target name
@@ -146,6 +149,9 @@ while test -n "$1"; do
     --delete)
       collect_var=delete_files
       ;;
+    --replace)
+      replace="replace: true"
+      ;;
     --rmsymlink)
       collect_var=delete_symlinks
       ;;
@@ -270,7 +278,7 @@ filename: $3$stmt"
   fi
 
   cat >${2}.directive<<EOF
-version: 1.1
+version: 1.2
 directory: $1
 comment: gnupload v. $scriptversion$stmt
 EOF
@@ -393,6 +401,12 @@ do
   do
     echo "Uploading $file to $dest ..."
     stmt=
+    #
+    # allowing file replacement is all or nothing.
+    if test -n "$replace"; then stmt="$stmt
+$replace"
+    fi
+    #
     files="$file $file.sig"
     destdir=`echo $dest | sed 's/[^:]*://'`
     if test -n "$symlink_expr"; then
diff --git a/build-aux/ylwrap b/build-aux/ylwrap
old mode 100644
new mode 100755



reply via email to

[Prev in Thread] Current Thread [Next in Thread]