FYI, I've just pushed this script, since I'm using it from coreutils and also used it for the just-announced gzip release:
http://article.gmane.org/gmane.comp.gnu.gzip.bugs/258 It makes lots of assumptions (see comments), and fiddles with your git repository by creating a temporary branch, and removing it when done. >From ee6bf517990504ad29488024f2f7dd089e91668c Mon Sep 17 00:00:00 2001 From: Jim Meyering <meyer...@redhat.com> Date: Fri, 2 Oct 2009 11:03:48 +0200 Subject: [PATCH 1/2] gnu-web-doc-update: New module. Use this script to automatically update the on-line web documentation for your GNU project at http://www.gnu.org/software/$pkg/manual/ * modules/gnu-web-doc-update: New file. * build-aux/gnu-web-doc-update: New script, from coreutils. * MODULES.html.sh (Support for maintaining and releasing projects): Add gnu-web-doc-update. --- ChangeLog | 8 ++++++++ MODULES.html.sh | 1 + build-aux/gnu-web-doc-update | 40 ++++++++++++++++++++++++++++++++++++++++ modules/gnu-web-doc-update | 20 ++++++++++++++++++++ 4 files changed, 69 insertions(+), 0 deletions(-) create mode 100755 build-aux/gnu-web-doc-update create mode 100644 modules/gnu-web-doc-update diff --git a/ChangeLog b/ChangeLog index 0d14e35..15e91dd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2009-10-02 Jim Meyering <meyer...@redhat.com> + + gnu-web-doc-update: New module. + Use this script to automatically update the on-line web documentation + for your GNU project at http://www.gnu.org/software/$pkg/manual/ + * modules/gnu-web-doc-update: New file, from coreutils. + * build-aux/gnu-web-doc-update: New script. + 2009-10-01 Paolo Bonzini <bonz...@gnu.org> link: LoadLibrary is not needed. diff --git a/MODULES.html.sh b/MODULES.html.sh index 42cb57c..e465e3a 100755 --- a/MODULES.html.sh +++ b/MODULES.html.sh @@ -3200,6 +3200,7 @@ func_all_modules () func_module autobuild func_module git-version-gen func_module gitlog-to-changelog + func_module gnu-web-doc-update func_module gnumakefile func_module gnupload func_module maintainer-makefile diff --git a/build-aux/gnu-web-doc-update b/build-aux/gnu-web-doc-update new file mode 100755 index 0000000..41e989a --- /dev/null +++ b/build-aux/gnu-web-doc-update @@ -0,0 +1,40 @@ +#!/bin/sh +# Run this after each non-alpha release, to update the web documentation at +# http://www.gnu.org/software/$pkg/manual/ +# 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) +tmp_branch=web-doc-$version-$$ + +cleanup() +{ + __st=$?; + rm -rf "$tmp" + git checkout master + git branch -d $tmp_branch + exit $__st +} +trap cleanup 0 +trap 'exit $?' 1 2 13 15 + +# We must build using sources for which --version reports the +# just-released version number, not some string like 7.6.18-20761. +# That version string propagates into all documentation. +git checkout -b $tmp_branch v$version +./bootstrap && ./configure && make && make web-manual + +tmp=$(mktemp -d --tmpdir=. web-doc-update.XXXXXX) || exit 1 +( cd $tmp \ + && cvs -d $u...@cvs.sv.gnu.org:/webcvs/$pkg co $pkg ) +rsync -avP doc/manual/ $tmp/$pkg/manual + +( + cd $tmp/$pkg/manual + + # Add any new files: + cvsu --types='?'|sed s/..// | xargs --no-run-if-empty -- cvs add -ko + + cvs ci -m $version +) diff --git a/modules/gnu-web-doc-update b/modules/gnu-web-doc-update new file mode 100644 index 0000000..5b3e8ac --- /dev/null +++ b/modules/gnu-web-doc-update @@ -0,0 +1,20 @@ +Description: +update the official GNU web documentation for your project + +Files: +build-aux/gnu-web-doc-update + +Depends-on: +gendocs + +configure.ac: + +Makefile.am: + +Include: + +License: +GPLed build tool + +Maintainer: +coreutils -- 1.6.5.rc2.177.ga9dd6 >From faf52e824a51a93d173ed97c8901415a0be19481 Mon Sep 17 00:00:00 2001 From: Jim Meyering <meyer...@redhat.com> Date: Fri, 2 Oct 2009 12:05:03 +0200 Subject: [PATCH 2/2] gnu-web-doc-update: add standard options * build-aux/gnu-web-doc-update: Add --help, --version, etc. --- ChangeLog | 3 ++ build-aux/gnu-web-doc-update | 78 ++++++++++++++++++++++++++++++++++++++++- 2 files changed, 79 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 15e91dd..73dadbb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2009-10-02 Jim Meyering <meyer...@redhat.com> + gnu-web-doc-update: add standard options + * build-aux/gnu-web-doc-update: Add --help, --version, etc. + gnu-web-doc-update: New module. Use this script to automatically update the on-line web documentation for your GNU project at http://www.gnu.org/software/$pkg/manual/ diff --git a/build-aux/gnu-web-doc-update b/build-aux/gnu-web-doc-update index 41e989a..adf6c51 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: -- 1.6.5.rc2.177.ga9dd6