X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=build-aux%2Fgnupload;h=a0e5c7b60ff36872458a1d4dff1882a60dee4a6d;hb=dc84183747ce1703eb99685b5dbde1f65a143c06;hp=bfdad59b6a73e9a4ad5d6f2e8d83c32a27c10f60;hpb=a2016c1de6e4884f6c8ed5cc498f3bf821c25ca4;p=debian%2Fgzip diff --git a/build-aux/gnupload b/build-aux/gnupload index bfdad59..a0e5c7b 100755 --- a/build-aux/gnupload +++ b/build-aux/gnupload @@ -1,9 +1,9 @@ #!/bin/sh # Sign files and upload them. -scriptversion=2009-12-21.21; # UTC +scriptversion=2012-06-11.00; # UTC -# Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation +# Copyright (C) 2004-2012 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -19,6 +19,8 @@ scriptversion=2009-12-21.21; # UTC # along with this program. If not, see . # Originally written by Alexandre Duret-Lutz . +# The master copy of this file is maintained in the gnulib Git repository. +# Please send bug reports and feature requests to bug-gnulib@gnu.org. set -e @@ -26,16 +28,20 @@ GPG='gpg --batch --no-tty' conffile=.gnuploadrc to= dry_run=false +replace= symlink_files= delete_files= delete_symlinks= collect_var= dbg= +nl=' +' -usage="Usage: $0 [OPTIONS]... [COMMAND] FILES... [[COMMAND] FILES...] +usage="Usage: $0 [OPTION]... [CMD] FILE... [[CMD] FILE...] -Sign all FILES, and upload them to selected destinations, according to -. +Sign all FILES, and process them at selected destinations according to CMD. + +explains further. Commands: --delete delete FILES from destination @@ -48,12 +54,14 @@ 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 -is created by replacing the version information with \`-latest', e.g.: +is created by replacing the version information with '-latest', e.g.: foo-1.3.4.tar.gz -> foo-latest.tar.gz @@ -101,13 +109,13 @@ happen to have an ncftp package installed, the ncftpput-ftp script in the build-aux/ directory of the gnulib package (http://savannah.gnu.org/projects/gnulib) may serve as a replacement. -Report bugs to . -Send patches to ." +Send patches and bug reports to ." # Read local configuration file if test -r "$conffile"; then echo "$0: Reading configuration file $conffile" - eval set x "`sed 's/#.*$//;/^$/d' \"$conffile\" | tr '\012\015' ' '` \"\$@\"" + conf=`sed 's/#.*$//;/^$/d' "$conffile" | tr "\015$nl" ' '` + eval set x "$conf \"\$@\"" shift fi @@ -141,6 +149,9 @@ while test -n "$1"; do --delete) collect_var=delete_files ;; + --replace) + replace="replace: true" + ;; --rmsymlink) collect_var=delete_symlinks ;; @@ -165,7 +176,7 @@ while test -n "$1"; do break ;; -*) - echo "$0: Unknown option \`$1', try \`$0 --help'" 1>&2 + echo "$0: Unknown option '$1', try '$0 --help'" 1>&2 exit 1 ;; esac @@ -183,7 +194,7 @@ done dprint() { - echo "Running $*..." + echo "Running $* ..." } if $dry_run; then @@ -214,7 +225,7 @@ else for file do if test ! -f $file; then - echo "$0: Cannot find \`$file'" 1>&2 + echo "$0: Cannot find '$file'" 1>&2 exit 1 elif test -n "$symlink_expr"; then linkname=`echo $file | sed "$symlink_expr"` @@ -233,21 +244,23 @@ fi unset passphrase # Reset PATH to be sure that echo is a built-in. We will later use -# `echo $passphrase' to output the passphrase, so it is important that -# it is a built-in (third-party programs tend to appear in `ps' +# 'echo $passphrase' to output the passphrase, so it is important that +# it is a built-in (third-party programs tend to appear in 'ps' # listings with their arguments...). -# Remember this script runs with `set -e', so if echo is not built-in +# Remember this script runs with 'set -e', so if echo is not built-in # it will exit now. -PATH=/empty echo -n "Enter GPG passphrase: " -stty -echo -read -r passphrase -stty echo -echo +if $dry_run; then :; else + PATH=/empty echo -n "Enter GPG passphrase: " + stty -echo + read -r passphrase + stty echo + echo +fi if test $# -ne 0; then for file do - echo "Signing $file..." + echo "Signing $file ..." rm -f $file.sig echo "$passphrase" | $dbg $GPG --passphrase-fd 0 -ba -o $file.sig $file done @@ -265,7 +278,7 @@ filename: $3$stmt" fi cat >${2}.directive<