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