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.
10 VERSION=2009-07-21.16; # UTC
12 # Copyright (C) 2009-2012 Free Software Foundation, Inc.
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.
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.
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/>.
27 # Requirements: everything required to bootstrap your package,
28 # plus these: git, cvs, cvsu, rsync, mktemp
31 warn() { printf '%s: %s\n' "$ME" "$*" >&2; }
32 die() { warn "$*"; exit 1; }
39 Run this script from top_srcdir (no options or arguments) after each
40 non-alpha release, to update the web documentation at
41 http://www.gnu.org/software/\$pkg/manual/ Run it from your project's
42 the top-level directory.
45 -C, --builddir=DIR location of (configured) Makefile (default: .)
46 --help print this help, then exit
47 --version print version number, then exit
49 Report bugs and patches to <bug-gnulib@gnu.org>.
56 year=$(echo "$VERSION" | sed 's/[^0-9].*//')
59 Copyright (C) $year Free Software Foundation, Inc,
60 License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
61 This is free software: you are free to change and redistribute it.
62 There is NO WARRANTY, to the extent permitted by law.
70 # Handle --option=value by splitting apart and putting back on argv.
73 opt=$(echo "$1" | sed -e 's/=.*//')
74 val=$(echo "$1" | sed -e 's/[^=]*=//')
76 set dummy "$opt" "$val" ${1+"$@"}; shift
81 --help|--version) ${1#--};;
82 -C|--builddir) shift; builddir=$1; shift ;;
83 --*) die "unrecognized option: $1";;
89 || die "$ME: too many arguments"
92 version=$(cat $prev) || die "$ME: no $prev file?"
93 pkg=$(sed -n 's/^PACKAGE = \(.*\)/\1/p' $builddir/Makefile) \
94 || die "$ME: no Makefile?"
95 tmp_branch=web-doc-$version-$$
96 current_branch=$(git branch | sed -ne '/^\* /{s///;p;q;}')
102 git checkout "$current_branch"
103 git submodule update --recursive
104 git branch -d $tmp_branch
108 trap 'exit $?' 1 2 13 15
110 # We must build using sources for which --version reports the
111 # just-released version number, not some string like 7.6.18-20761.
112 # That version string propagates into all documentation.
114 git checkout -b $tmp_branch v$version
115 git submodule update --recursive
119 ./config.status --recheck
126 tmp=$(mktemp -d web-doc-update.XXXXXX) || exit 1
128 && cvs -d $USER@cvs.sv.gnu.org:/webcvs/$pkg co $pkg )
129 rsync -avP "$builddir"/doc/manual/ $tmp/$pkg/manual
135 cvsu --types='?'|sed s/..// | xargs --no-run-if-empty -- cvs add -ko
141 # eval: (add-hook 'write-file-hooks 'time-stamp)
142 # time-stamp-start: "VERSION="
143 # time-stamp-format: "%:y-%02m-%02d.%02H"
144 # time-stamp-time-zone: "UTC"
145 # time-stamp-end: "; # UTC"