comparison build-aux/gnupload @ 17362:7a2e583edf71

check for (erroneous) ftp-upload.gnu.org
author Karl Berry <karl@freefriends.org>
date Tue, 19 Mar 2013 10:47:12 -0700
parents e542fd46ad6f
children 344018b6e5d7
comparison
equal deleted inserted replaced
17361:8c32877a40e6 17362:7a2e583edf71
1 #!/bin/sh 1 #!/bin/sh
2 # Sign files and upload them. 2 # Sign files and upload them.
3 3
4 scriptversion=2012-12-11.16; # UTC 4 scriptversion=2013-03-19.17; # UTC
5 5
6 # Copyright (C) 2004-2013 Free Software Foundation, Inc. 6 # Copyright (C) 2004-2013 Free Software Foundation, Inc.
7 # 7 #
8 # This program is free software; you can redistribute it and/or modify 8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by 9 # it under the terms of the GNU General Public License as published by
37 nl=' 37 nl='
38 ' 38 '
39 39
40 usage="Usage: $0 [OPTION]... [CMD] FILE... [[CMD] FILE...] 40 usage="Usage: $0 [OPTION]... [CMD] FILE... [[CMD] FILE...]
41 41
42 Sign all FILES, and process them at selected destinations according to CMD. 42 Sign all FILES, and process them at the destinations specified with --to.
43 <http://www.gnu.org/prep/maintain/html_node/Automated-FTP-Uploads.html> 43 If CMD is not given, it defaults to uploading. See examples below.
44 explains further.
45 44
46 Commands: 45 Commands:
47 --delete delete FILES from destination 46 --delete delete FILES from destination
48 --symlink create symbolic links 47 --symlink create symbolic links
49 --rmsymlink remove symbolic links 48 --rmsymlink remove symbolic links
50 -- treat the remaining arguments as files to upload 49 -- treat the remaining arguments as files to upload
51 50
52 Options: 51 Options:
53 --help print this help text and exit 52 --to DEST specify a destination DEST for FILES
54 --to DEST specify one destination for FILES
55 (multiple --to options are allowed) 53 (multiple --to options are allowed)
56 --user NAME sign with key NAME 54 --user NAME sign with key NAME
57 --replace allow replacements of existing files 55 --replace allow replacements of existing files
58 --symlink-regex[=EXPR] use sed script EXPR to compute symbolic link names 56 --symlink-regex[=EXPR] use sed script EXPR to compute symbolic link names
59 --dry-run do nothing, show what would have been done 57 --dry-run do nothing, show what would have been done
60 (including the constructed directive file) 58 (including the constructed directive file)
61 --version output version information and exit 59 --version output version information and exit
60 --help print this help text and exit
62 61
63 If --symlink-regex is given without EXPR, then the link target name 62 If --symlink-regex is given without EXPR, then the link target name
64 is created by replacing the version information with '-latest', e.g.: 63 is created by replacing the version information with '-latest', e.g.:
65
66 foo-1.3.4.tar.gz -> foo-latest.tar.gz 64 foo-1.3.4.tar.gz -> foo-latest.tar.gz
67 65
68 Recognized destinations are: 66 Recognized destinations are:
69 alpha.gnu.org:DIRECTORY 67 alpha.gnu.org:DIRECTORY
70 savannah.gnu.org:DIRECTORY 68 savannah.gnu.org:DIRECTORY
78 Options and commands are applied in order. If the file $conffile exists 76 Options and commands are applied in order. If the file $conffile exists
79 in the current working directory, its contents are prepended to the 77 in the current working directory, its contents are prepended to the
80 actual command line options. Use this to keep your defaults. Comments 78 actual command line options. Use this to keep your defaults. Comments
81 (#) and empty lines in $conffile are allowed. 79 (#) and empty lines in $conffile are allowed.
82 80
81 <http://www.gnu.org/prep/maintain/html_node/Automated-FTP-Uploads.html>
82 gives some further background.
83
83 Examples: 84 Examples:
84 1. Upload foobar-1.0.tar.gz to ftp.gnu.org: 85 1. Upload foobar-1.0.tar.gz to ftp.gnu.org:
85 gnupload --to ftp.gnu.org:foobar foobar-1.0.tar.gz 86 gnupload --to ftp.gnu.org:foobar foobar-1.0.tar.gz
86 87
87 2. Upload foobar-1.0.tar.gz and foobar-1.0.tar.xz to ftp.gnu.org: 88 2. Upload foobar-1.0.tar.gz and foobar-1.0.tar.xz to ftp.gnu.org:
102 gnupload --to alpha.gnu.org:foobar \\ 103 gnupload --to alpha.gnu.org:foobar \\
103 --to sources.redhat.com:~ftp/pub/foobar \\ 104 --to sources.redhat.com:~ftp/pub/foobar \\
104 --delete oopsbar-0.9.91.tar.gz \\ 105 --delete oopsbar-0.9.91.tar.gz \\
105 -- foobar-0.9.91.tar.gz 106 -- foobar-0.9.91.tar.gz
106 107
107 gnupload uses the ncftpput program to do the transfers; if you don't 108 gnupload executes a program ncftpput to do the transfers; if you don't
108 happen to have an ncftp package installed, the ncftpput-ftp script in 109 happen to have an ncftp package installed, the ncftpput-ftp script in
109 the build-aux/ directory of the gnulib package 110 the build-aux/ directory of the gnulib package
110 (http://savannah.gnu.org/projects/gnulib) may serve as a replacement. 111 (http://savannah.gnu.org/projects/gnulib) may serve as a replacement.
111 112
112 Send patches and bug reports to <bug-gnulib@gnu.org>." 113 Send patches and bug reports to <bug-gnulib@gnu.org>."
129 exit $? 130 exit $?
130 ;; 131 ;;
131 --to) 132 --to)
132 if test -z "$2"; then 133 if test -z "$2"; then
133 echo "$0: Missing argument for --to" 1>&2 134 echo "$0: Missing argument for --to" 1>&2
135 exit 1
136 elif echo "$2" | grep 'ftp-upload\.gnu\.org' >/dev/null; then
137 echo "$0: Use ftp.gnu.org:PKGNAME or alpha.gnu.org:PKGNAME" >&2
138 echo "$0: for the destination, not ftp-upload.gnu.org (which" >&2
139 echo "$0: is used for direct ftp uploads, not with gnupload)." >&2
140 echo "$0: See --help and its examples if need be." >&2
134 exit 1 141 exit 1
135 else 142 else
136 to="$to $2" 143 to="$to $2"
137 shift 144 shift
138 fi 145 fi