| 1 | #!/bin/sh
|
|---|
| 2 | # Run this after each non-alpha release, to update the web documentation at
|
|---|
| 3 | # http://www.gnu.org/software/$pkg/manual/
|
|---|
| 4 | # This script must be run from the top-level directory,
|
|---|
| 5 | # assumes you're using git for revision control,
|
|---|
| 6 | # and requires a .prev-version file as well as a Makefile,
|
|---|
| 7 | # from which it extracts the version number and package name, respectively.
|
|---|
| 8 | # Also, it assumes all documentation is in the doc/ sub-directory.
|
|---|
| 9 |
|
|---|
| 10 | VERSION=2009-07-21.16; # UTC
|
|---|
| 11 |
|
|---|
| 12 | # Copyright (C) 2009-2012 Free Software Foundation, Inc.
|
|---|
| 13 |
|
|---|
| 14 | # This program is free software: you can redistribute it and/or modify
|
|---|
| 15 | # it under the terms of the GNU General Public License as published by
|
|---|
| 16 | # the Free Software Foundation, either version 3 of the License, or
|
|---|
| 17 | # (at your option) any later version.
|
|---|
| 18 |
|
|---|
| 19 | # This program is distributed in the hope that it will be useful,
|
|---|
| 20 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|---|
| 21 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|---|
| 22 | # GNU General Public License for more details.
|
|---|
| 23 |
|
|---|
| 24 | # You should have received a copy of the GNU General Public License
|
|---|
| 25 | # along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|---|
| 26 |
|
|---|
| 27 | # Requirements: everything required to bootstrap your package,
|
|---|
| 28 | # plus these: git, cvs, cvsu, rsync, mktemp
|
|---|
| 29 |
|
|---|
| 30 | ME=`basename "$0"`
|
|---|
| 31 | warn() { printf '%s: %s\n' "$ME" "$*" >&2; }
|
|---|
| 32 | die() { warn "$*"; exit 1; }
|
|---|
| 33 |
|
|---|
| 34 | help_version()
|
|---|
| 35 | {
|
|---|
| 36 | case $1 in
|
|---|
| 37 | --help) cat <<EOF
|
|---|
| 38 | Usage: $ME
|
|---|
| 39 |
|
|---|
| 40 | Run this script (no options or arguments) after each non-alpha release,
|
|---|
| 41 | to update the web documentation at http://www.gnu.org/software/\$pkg/manual/
|
|---|
| 42 | Run it from your project's the top-level directory.
|
|---|
| 43 |
|
|---|
| 44 | Options:
|
|---|
| 45 | --help print this help, then exit
|
|---|
| 46 | --version print version number, then exit
|
|---|
| 47 |
|
|---|
| 48 | Report bugs and patches to <bug-gnulib@gnu.org>.
|
|---|
| 49 | EOF
|
|---|
| 50 | exit ;;
|
|---|
| 51 |
|
|---|
| 52 | --version)
|
|---|
| 53 | year=`echo "$VERSION" | sed 's/[^0-9].*//'`
|
|---|
| 54 | cat <<EOF
|
|---|
| 55 | $ME $VERSION
|
|---|
| 56 | Copyright (C) $year Free Software Foundation, Inc,
|
|---|
| 57 | License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
|
|---|
| 58 | This is free software: you are free to change and redistribute it.
|
|---|
| 59 | There is NO WARRANTY, to the extent permitted by law.
|
|---|
| 60 | EOF
|
|---|
| 61 | exit ;;
|
|---|
| 62 |
|
|---|
| 63 | *) die "unrecognized option: $1";;
|
|---|
| 64 | esac
|
|---|
| 65 | }
|
|---|
| 66 |
|
|---|
| 67 | case $# in
|
|---|
| 68 | 0) ;;
|
|---|
| 69 | 1) help_version $1 ;;
|
|---|
| 70 | *) die "$ME: too many options" ;;
|
|---|
| 71 | esac
|
|---|
| 72 |
|
|---|
| 73 | prev=.prev-version
|
|---|
| 74 | version=$(cat $prev) || die "$ME: no $prev file?"
|
|---|
| 75 | pkg=$(sed -n 's/^PACKAGE = \(.*\)/\1/p' Makefile) || die "$ME: no Makefile?"
|
|---|
| 76 | tmp_branch=web-doc-$version-$$
|
|---|
| 77 |
|
|---|
| 78 | cleanup()
|
|---|
| 79 | {
|
|---|
| 80 | __st=$?;
|
|---|
| 81 | rm -rf "$tmp"
|
|---|
| 82 | git checkout master
|
|---|
| 83 | git branch -d $tmp_branch
|
|---|
| 84 | exit $__st
|
|---|
| 85 | }
|
|---|
| 86 | trap cleanup 0
|
|---|
| 87 | trap 'exit $?' 1 2 13 15
|
|---|
| 88 |
|
|---|
| 89 | # We must build using sources for which --version reports the
|
|---|
| 90 | # just-released version number, not some string like 7.6.18-20761.
|
|---|
| 91 | # That version string propagates into all documentation.
|
|---|
| 92 | git checkout -b $tmp_branch v$version
|
|---|
| 93 | ok=0
|
|---|
| 94 | ./bootstrap && ./configure && make && make web-manual && ok=1
|
|---|
| 95 | test $ok = 1 || exit 1
|
|---|
| 96 |
|
|---|
| 97 | tmp=$(mktemp -d --tmpdir=. web-doc-update.XXXXXX) || exit 1
|
|---|
| 98 | ( cd $tmp \
|
|---|
| 99 | && cvs -d $USER@cvs.sv.gnu.org:/webcvs/$pkg co $pkg )
|
|---|
| 100 | rsync -avP doc/manual/ $tmp/$pkg/manual
|
|---|
| 101 |
|
|---|
| 102 | (
|
|---|
| 103 | cd $tmp/$pkg/manual
|
|---|
| 104 |
|
|---|
| 105 | # Add any new files:
|
|---|
| 106 | cvsu --types='?'|sed s/..// | xargs --no-run-if-empty -- cvs add -ko
|
|---|
| 107 |
|
|---|
| 108 | cvs ci -m $version
|
|---|
| 109 | )
|
|---|
| 110 |
|
|---|
| 111 | # Local variables:
|
|---|
| 112 | # eval: (add-hook 'write-file-hooks 'time-stamp)
|
|---|
| 113 | # time-stamp-start: "VERSION="
|
|---|
| 114 | # time-stamp-format: "%:y-%02m-%02d.%02H"
|
|---|
| 115 | # time-stamp-time-zone: "UTC"
|
|---|
| 116 | # time-stamp-end: "; # UTC"
|
|---|
| 117 | # End:
|
|---|