docbook-xsl-update 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #!/bin/bash
  2. # vim: number
  3. # docbook-xsl-update - Update environment to latest docbook-xsl snapshot
  4. # $Id: docbook-xsl-update 9628 2012-10-20 23:52:01Z dcramer $
  5. if [ -z $DOCBOOK_MIRROR ]; then
  6. myhost=docbook.xml-doc.org:5873;
  7. else
  8. myhost=$DOCBOOK_MIRROR;
  9. fi
  10. mydir=$(readlink -f $(dirname $0))
  11. mydocbook_xsl_base=$(readlink -f $(dirname $0)/../..)
  12. if [ ! -f $mydocbook_xsl_base/VERSION.xsl ]; then
  13. cat <<- EOF
  14. $(basename $0): error: not in snapshot directory. Stopping.
  15. The $(basename $0) script must be installed within its original
  16. location in the tools/bin directory in the docbook-xsl distribution.
  17. EOF
  18. exit 1
  19. fi
  20. usage="Usage:
  21. $(basename $0) [-h HOST[:PORT]]
  22. -h HOST[:PORT] Specifies the rsync host and port number to use.
  23. If not specified, uses the value of the
  24. \$DOCBOOK_MIRROR environment variable. If that
  25. environment variable is not specified, defaults
  26. to a hard-coded value.
  27. "
  28. while getopts "h:" opt; do
  29. case $opt in
  30. h ) myhost=$OPTARG ;;
  31. \? ) printf "$usage"
  32. printf "$opts_admon"
  33. exit 1 ;;
  34. esac
  35. done
  36. shift $(($OPTIND - 1))
  37. if [ -z $myhost ]; then
  38. myhost=$DOCBOOK_MIRROR
  39. fi
  40. rsync -auv rsync://$myhost/xsl $mydocbook_xsl_base