summaryrefslogtreecommitdiff
path: root/build-aux/gnu-web-doc-update
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2009-10-02 12:05:03 +0200
committerJim Meyering <meyering@redhat.com>2009-10-02 12:05:03 +0200
commitfaf52e824a51a93d173ed97c8901415a0be19481 (patch)
tree88905c505bec7af0722e0531343ffe498d903930 /build-aux/gnu-web-doc-update
parentee6bf517990504ad29488024f2f7dd089e91668c (diff)
downloadgnulib-faf52e824a51a93d173ed97c8901415a0be19481.tar.gz
gnu-web-doc-update: add standard options
* build-aux/gnu-web-doc-update: Add --help, --version, etc.
Diffstat (limited to 'build-aux/gnu-web-doc-update')
-rwxr-xr-xbuild-aux/gnu-web-doc-update78
1 files changed, 76 insertions, 2 deletions
diff --git a/build-aux/gnu-web-doc-update b/build-aux/gnu-web-doc-update
index 41e989add0..adf6c5179c 100755
--- a/build-aux/gnu-web-doc-update
+++ b/build-aux/gnu-web-doc-update
@@ -1,11 +1,77 @@
#!/bin/sh
# Run this after each non-alpha release, to update the web documentation at
# http://www.gnu.org/software/$pkg/manual/
+# This script must be run from the top-level directory,
+# assumes you're using git for revision control,
+# and requires a .prev-version file as well as a Makefile,
+# from which it extracts the version number and package name, respectively.
+# Also, it assumes all documentation is in the doc/ sub-directory.
+
+VERSION=2009-07-21.16; # UTC
+
+# Copyright (C) 2009 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
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# 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/>.
+
# Requirements: everything required to bootstrap your package,
# plus these: git, cvs, cvsu, rsync, mktemp
-version=$(cat .prev-version)
-pkg=$(sed -n 's/^PACKAGE = \(.*\)/\1/p' Makefile)
+ME=`basename "$0"`
+warn() { printf '%s: %s\n' "$ME" "$*" >&2; }
+die() { warn "$*"; exit 1; }
+
+help_version()
+{
+ case $1 in
+ --help) cat <<EOF
+Usage: $ME
+
+Output a list of version-controlled files in DIR (default .), relative to
+SRCDIR (default .). SRCDIR must be the top directory of a checkout.
+
+Options:
+ --help print this help, then exit
+ --version print version number, then exit
+
+Report bugs and patches to <bug-gnulib@gnu.org>.
+EOF
+ exit ;;
+
+ --version)
+ year=`echo "$VERSION" | sed 's/[^0-9].*//'`
+ cat <<EOF
+$ME $VERSION
+Copyright (C) $year Free Software Foundation, Inc,
+License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
+This is free software: you are free to change and redistribute it.
+There is NO WARRANTY, to the extent permitted by law.
+EOF
+ exit ;;
+
+ *) die "unrecognized option: $1";;
+ esac
+}
+
+case $# in
+ 0) ;;
+ 1) help_version $1 ;;
+ *) die "$ME: too many options" ;;
+esac
+
+prev=.prev-version
+version=$(cat $prev) || die "$ME: no $prev file?"
+pkg=$(sed -n 's/^PACKAGE = \(.*\)/\1/p' Makefile) || die "$ME: no Makefile?"
tmp_branch=web-doc-$version-$$
cleanup()
@@ -38,3 +104,11 @@ rsync -avP doc/manual/ $tmp/$pkg/manual
cvs ci -m $version
)
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "VERSION="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End: