summaryrefslogtreecommitdiff
path: root/build-aux/gnupload
diff options
context:
space:
mode:
Diffstat (limited to 'build-aux/gnupload')
-rwxr-xr-xbuild-aux/gnupload39
1 files changed, 31 insertions, 8 deletions
diff --git a/build-aux/gnupload b/build-aux/gnupload
index 2da97d89..82b7e8a1 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-2014 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 <http://www.gnu.org/licenses/>.
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
# Originally written by Alexandre Duret-Lutz <adl@gnu.org>.
# 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
@@ -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.
-<http://www.gnu.org/prep/maintain/html_node/Automated-FTP-Uploads.html>
+<https://www.gnu.org/prep/maintain/html_node/Automated-FTP-Uploads.html>
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 <bug-gnulib@gnu.org>."
@@ -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: