gnu-web-doc-update 3.4 KB

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