X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=build-aux%2Fgnupload;h=8f05700814f2ee30430d2fe8c5eeae5b9c881025;hb=92249085071a973e2c0621b0415b93d2e48bb00d;hp=7a137c1aae35440cc4447cfc62b035b727b7ac56;hpb=d738e90e8360e101b94fca8c79147f59565f62d8;p=debian%2Fgzip
diff --git a/build-aux/gnupload b/build-aux/gnupload
index 7a137c1..8f05700 100755
--- a/build-aux/gnupload
+++ b/build-aux/gnupload
@@ -1,9 +1,9 @@
#!/bin/sh
# Sign files and upload them.
-scriptversion=2013-03-19.17; # UTC
+scriptversion=2018-05-19.18; # UTC
-# Copyright (C) 2004-2013 Free Software Foundation, Inc.
+# Copyright (C) 2004-2018 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
@@ -16,7 +16,7 @@ scriptversion=2013-03-19.17; # UTC
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
+# 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.
@@ -24,7 +24,30 @@ scriptversion=2013-03-19.17; # UTC
set -e
-GPG='gpg --batch --no-tty'
+GPG=gpg
+# Choose the proper version of gpg, so as to avoid a
+# "gpg-agent is not available in this session" error
+# when gpg-agent is version 3 but gpg is still version 1.
+# FIXME-2020: remove, once all major distros ship gpg version 3 as /usr/bin/gpg
+gpg_agent_version=`(gpg-agent --version) 2>/dev/null | sed -e '2,$d' -e 's/^[^0-9]*//'`
+case "$gpg_agent_version" in
+ 2.*)
+ gpg_version=`(gpg --version) 2>/dev/null | sed -e '2,$d' -e 's/^[^0-9]*//'`
+ case "$gpg_version" in
+ 1.*)
+ if (type gpg2) >/dev/null 2>/dev/null; then
+ # gpg2 is present.
+ GPG=gpg2
+ else
+ # gpg2 is missing. Ubuntu users should install the package 'gnupg2'.
+ echo "WARNING: Using 'gpg', which is too old. You should install 'gpg2'." 1>&2
+ fi
+ ;;
+ esac
+ ;;
+esac
+
+GPG="${GPG} --batch --no-tty"
conffile=.gnuploadrc
to=
dry_run=false
@@ -54,10 +77,10 @@ Options:
--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
+ -n, --dry-run do nothing, show what would have been done
(including the constructed directive file)
--version output version information and exit
- --help print this help text and exit
+ -h, --help print this help text 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.:
@@ -78,7 +101,7 @@ in the current working directory, its contents are prepended to the
actual command line options. Use this to keep your defaults. Comments
(#) and empty lines in $conffile are allowed.
-
+
gives some further background.
Examples:
@@ -108,7 +131,7 @@ Examples:
gnupload executes a program ncftpput to do the transfers; if you don't
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.
+(https://savannah.gnu.org/projects/gnulib) may serve as a replacement.
Send patches and bug reports to ."
@@ -125,7 +148,7 @@ while test -n "$1"; do
-*)
collect_var=
case $1 in
- --help)
+ -h | --help)
echo "$usage"
exit $?
;;
@@ -171,7 +194,7 @@ while test -n "$1"; do
--symlink)
collect_var=symlink_files
;;
- --dry-run|-n)
+ -n | --dry-run)
dry_run=:
;;
--version)
@@ -432,9 +455,9 @@ done
exit 0
# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
+# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End: