~ubuntu-branches/ubuntu/utopic/coreutils/utopic-proposed

« back to all changes in this revision

Viewing changes to build-aux/gnupload

  • Committer: Package Import Robot
  • Author(s): Colin Watson
  • Date: 2012-11-28 03:03:42 UTC
  • mfrom: (8.3.4 sid)
  • Revision ID: package-import@ubuntu.com-20121128030342-21zanj8354gas5gr
Tags: 8.20-3ubuntu1
* Resynchronise with Debian.  Remaining changes:
  - Make 'uname -i -p' return the real processor/hardware, instead of
    unknown.
  - Build-depend on gettext:any instead of on gettext, so that apt-get can
    properly resolve build-dependencies on the tool when cross-building.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/bin/sh
2
2
# Sign files and upload them.
3
3
 
4
 
scriptversion=2010-05-23.15; # UTC
 
4
scriptversion=2012-06-11.00; # UTC
5
5
 
6
 
# Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
7
 
# Foundation, Inc.
 
6
# Copyright (C) 2004-2012 Free Software Foundation, Inc.
8
7
#
9
8
# This program is free software; you can redistribute it and/or modify
10
9
# it under the terms of the GNU General Public License as published by
20
19
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
21
20
 
22
21
# Originally written by Alexandre Duret-Lutz <adl@gnu.org>.
 
22
# The master copy of this file is maintained in the gnulib Git repository.
 
23
# Please send bug reports and feature requests to bug-gnulib@gnu.org.
23
24
 
24
25
set -e
25
26
 
27
28
conffile=.gnuploadrc
28
29
to=
29
30
dry_run=false
 
31
replace=
30
32
symlink_files=
31
33
delete_files=
32
34
delete_symlinks=
52
54
  --to DEST                specify one destination for FILES
53
55
                           (multiple --to options are allowed)
54
56
  --user NAME              sign with key NAME
 
57
  --replace                allow replacements of existing files
55
58
  --symlink-regex[=EXPR]   use sed script EXPR to compute symbolic link names
56
59
  --dry-run                do nothing, show what would have been done
 
60
                           (including the constructed directive file)
57
61
  --version                output version information and exit
58
62
 
59
63
If --symlink-regex is given without EXPR, then the link target name
60
 
is created by replacing the version information with \`-latest', e.g.:
 
64
is created by replacing the version information with '-latest', e.g.:
61
65
 
62
66
  foo-1.3.4.tar.gz -> foo-latest.tar.gz
63
67
 
105
109
the build-aux/ directory of the gnulib package
106
110
(http://savannah.gnu.org/projects/gnulib) may serve as a replacement.
107
111
 
108
 
Report bugs to <bug-automake@gnu.org>.
109
 
Send patches to <automake-patches@gnu.org>."
 
112
Send patches and bug reports to <bug-gnulib@gnu.org>."
110
113
 
111
114
# Read local configuration file
112
115
if test -r "$conffile"; then
146
149
    --delete)
147
150
      collect_var=delete_files
148
151
      ;;
 
152
    --replace)
 
153
      replace="replace: true"
 
154
      ;;
149
155
    --rmsymlink)
150
156
      collect_var=delete_symlinks
151
157
      ;;
170
176
      break
171
177
      ;;
172
178
    -*)
173
 
      echo "$0: Unknown option \`$1', try \`$0 --help'" 1>&2
 
179
      echo "$0: Unknown option '$1', try '$0 --help'" 1>&2
174
180
      exit 1
175
181
      ;;
176
182
    esac
219
225
  for file
220
226
  do
221
227
    if test ! -f $file; then
222
 
      echo "$0: Cannot find \`$file'" 1>&2
 
228
      echo "$0: Cannot find '$file'" 1>&2
223
229
      exit 1
224
230
    elif test -n "$symlink_expr"; then
225
231
      linkname=`echo $file | sed "$symlink_expr"`
238
244
unset passphrase
239
245
 
240
246
# Reset PATH to be sure that echo is a built-in.  We will later use
241
 
# `echo $passphrase' to output the passphrase, so it is important that
242
 
# it is a built-in (third-party programs tend to appear in `ps'
 
247
# 'echo $passphrase' to output the passphrase, so it is important that
 
248
# it is a built-in (third-party programs tend to appear in 'ps'
243
249
# listings with their arguments...).
244
 
# Remember this script runs with `set -e', so if echo is not built-in
 
250
# Remember this script runs with 'set -e', so if echo is not built-in
245
251
# it will exit now.
246
 
PATH=/empty echo -n "Enter GPG passphrase: "
247
 
stty -echo
248
 
read -r passphrase
249
 
stty echo
250
 
echo
 
252
if $dry_run; then :; else
 
253
  PATH=/empty echo -n "Enter GPG passphrase: "
 
254
  stty -echo
 
255
  read -r passphrase
 
256
  stty echo
 
257
  echo
 
258
fi
251
259
 
252
260
if test $# -ne 0; then
253
261
  for file
270
278
  fi
271
279
 
272
280
  cat >${2}.directive<<EOF
273
 
version: 1.1
 
281
version: 1.2
274
282
directory: $1
275
283
comment: gnupload v. $scriptversion$stmt
276
284
EOF
393
401
  do
394
402
    echo "Uploading $file to $dest ..."
395
403
    stmt=
 
404
    #
 
405
    # allowing file replacement is all or nothing.
 
406
    if test -n "$replace"; then stmt="$stmt
 
407
$replace"
 
408
    fi
 
409
    #
396
410
    files="$file $file.sig"
397
411
    destdir=`echo $dest | sed 's/[^:]*://'`
398
412
    if test -n "$symlink_expr"; then