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