X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=build-aux%2Fgnu-web-doc-update;h=851f8b899bb21f2664488debf5ee162c5e106091;hb=dc84183747ce1703eb99685b5dbde1f65a143c06;hp=2c1a0cc6eb28ec6932730700f229662549f784f9;hpb=a2016c1de6e4884f6c8ed5cc498f3bf821c25ca4;p=debian%2Fgzip diff --git a/build-aux/gnu-web-doc-update b/build-aux/gnu-web-doc-update index 2c1a0cc..851f8b8 100755 --- a/build-aux/gnu-web-doc-update +++ b/build-aux/gnu-web-doc-update @@ -9,7 +9,7 @@ VERSION=2009-07-21.16; # UTC -# Copyright (C) 2009, 2010 Free Software Foundation, Inc. +# Copyright (C) 2009-2012 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 @@ -27,59 +27,80 @@ VERSION=2009-07-21.16; # UTC # Requirements: everything required to bootstrap your package, # plus these: git, cvs, cvsu, rsync, mktemp -ME=`basename "$0"` +ME=$(basename "$0") warn() { printf '%s: %s\n' "$ME" "$*" >&2; } die() { warn "$*"; exit 1; } -help_version() +help() { - case $1 in - --help) cat <. EOF - exit ;; + exit +} - --version) - year=`echo "$VERSION" | sed 's/[^0-9].*//'` - cat < This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. EOF - exit ;; + exit +} + +builddir=. +while test $# != 0 +do + # Handle --option=value by splitting apart and putting back on argv. + case $1 in + --*=*) + opt=$(echo "$1" | sed -e 's/=.*//') + val=$(echo "$1" | sed -e 's/[^=]*=//') + shift + set dummy "$opt" "$val" ${1+"$@"}; shift + ;; + esac - *) die "unrecognized option: $1";; + case $1 in + --help|--version) ${1#--};; + -C|--builddir) shift; builddir=$1; shift ;; + --*) die "unrecognized option: $1";; + *) break;; esac -} +done -case $# in - 0) ;; - 1) help_version $1 ;; - *) die "$ME: too many options" ;; -esac +test $# = 0 \ + || die "$ME: too many arguments" prev=.prev-version version=$(cat $prev) || die "$ME: no $prev file?" -pkg=$(sed -n 's/^PACKAGE = \(.*\)/\1/p' Makefile) || die "$ME: no Makefile?" +pkg=$(sed -n 's/^PACKAGE = \(.*\)/\1/p' $builddir/Makefile) \ + || die "$ME: no Makefile?" tmp_branch=web-doc-$version-$$ +current_branch=$(git branch | sed -ne '/^\* /{s///;p;q;}') cleanup() { - __st=$?; + __st=$? rm -rf "$tmp" - git checkout master + git checkout "$current_branch" + git submodule update --recursive git branch -d $tmp_branch exit $__st } @@ -89,13 +110,23 @@ 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. +set -e git checkout -b $tmp_branch v$version -./bootstrap && ./configure && make && make web-manual - -tmp=$(mktemp -d --tmpdir=. web-doc-update.XXXXXX) || exit 1 +git submodule update --recursive +./bootstrap +srcdir=$(pwd) +cd "$builddir" + ./config.status --recheck + ./config.status + make + make web-manual +cd "$srcdir" +set +e + +tmp=$(mktemp -d web-doc-update.XXXXXX) || exit 1 ( cd $tmp \ && cvs -d $USER@cvs.sv.gnu.org:/webcvs/$pkg co $pkg ) -rsync -avP doc/manual/ $tmp/$pkg/manual +rsync -avP "$builddir"/doc/manual/ $tmp/$pkg/manual ( cd $tmp/$pkg/manual