OLD | NEW |
1 #!/usr/bin/env bash | 1 #!/usr/bin/env bash |
2 | 2 |
3 set -e | 3 set -e |
4 | 4 |
5 shopt -s nullglob | 5 shopt -s nullglob |
6 | 6 |
7 cd $(dirname "$0") | 7 cd $(dirname "$0") |
8 | 8 |
9 # Script which takes all the asciidoc git-*.txt files in this directory, renders | 9 # Script which takes all the asciidoc git-*.txt files in this directory, renders |
10 # them to html + manpage format using git 1.9's doc toolchain, then puts | 10 # them to html + manpage format using git 1.9's doc toolchain, then puts |
11 # them in depot_tools to be committed. | 11 # them in depot_tools to be committed. |
12 | 12 |
13 ensure_in_path() { | 13 ensure_in_path() { |
14 local CMD=$1 | 14 local CMD=$1 |
15 local PTH=$(which "$CMD") | 15 local PTH=$(which "$CMD") |
16 if [[ ! $PTH ]] | 16 if [[ ! $PTH ]] |
17 then | 17 then |
18 echo Must have "$CMD" on your PATH! | 18 echo Must have "$CMD" on your PATH! |
19 exit 1 | 19 exit 1 |
20 else | 20 else |
21 echo Using \'$PTH\' for ${CMD}. | 21 echo Using \'$PTH\' for ${CMD}. |
22 fi | 22 fi |
23 } | 23 } |
24 | 24 |
25 ensure_in_path xmlto | 25 ensure_in_path xmlto |
26 ensure_in_path hg | 26 ensure_in_path git |
27 | 27 |
28 DFLT_CATALOG_PATH="/usr/local/etc/xml/catalog" | 28 DFLT_CATALOG_PATH="/usr/local/etc/xml/catalog" |
29 if [[ ! $XML_CATALOG_FILES && -f "$DFLT_CATALOG_PATH" ]] | 29 if [[ ! $XML_CATALOG_FILES && -f "$DFLT_CATALOG_PATH" ]] |
30 then | 30 then |
31 # Default if you install doctools with homebrew on mac | 31 # Default if you install doctools with homebrew on mac |
32 export XML_CATALOG_FILES="$DFLT_CATALOG_PATH" | 32 export XML_CATALOG_FILES="$DFLT_CATALOG_PATH" |
33 echo Using \'$DFLT_CATALOG_PATH\' for \$XML_CATALOG_FILES. | 33 echo Using \'$DFLT_CATALOG_PATH\' for \$XML_CATALOG_FILES. |
34 fi | 34 fi |
35 | 35 |
36 # We pull asciidoc to get the right version | 36 # We pull asciidoc to get the right version |
37 BRANCH=8.6.9 | 37 BRANCH=8.6.9 |
38 ASCIIDOC_HASH=7fed0aff1b30 | 38 ASCIIDOC_HASH=2ff8681 |
39 if [[ ! -d asciidoc || $(cd asciidoc && hg id -i) != $ASCIIDOC_HASH ]] | 39 if [[ ! -d asciidoc || $(cd asciidoc && git rev-parse --short HEAD) != $ASCIIDOC
_HASH ]] |
40 then | 40 then |
41 echo Cloning asciidoc | 41 echo Cloning asciidoc |
42 rm -rf asciidoc | 42 rm -rf asciidoc |
43 hg clone -r $BRANCH https://asciidoc.googlecode.com/hg/ asciidoc | 43 git clone --branch $BRANCH https://github.com/asciidoc/asciidoc asciidoc |
44 (cd asciidoc && ln -s asciidoc.py asciidoc) | 44 (cd asciidoc && ln -s asciidoc.py asciidoc) |
45 fi | 45 fi |
46 echo Asciidoc up to date at $ASCIIDOC_HASH \($BRANCH\) | 46 echo Asciidoc up to date at $ASCIIDOC_HASH \($BRANCH\) |
47 | 47 |
48 export PATH=`pwd`/asciidoc:$PATH | 48 export PATH=`pwd`/asciidoc:$PATH |
49 | 49 |
50 # We pull ansi2hash to convert demo script output | 50 # We pull ansi2hash to convert demo script output |
51 BRANCH=1.0.6 | 51 BRANCH=1.0.6 |
52 ANSI2HTML_HASH=6282ab7a24a5a7eab2e0b23bb0055234c533a6e9 | 52 ANSI2HTML_HASH=6282ab7a24a5a7eab2e0b23bb0055234c533a6e9 |
53 if [[ ! -d ansi2html || $(git -C ansi2html rev-parse HEAD) != $ANSI2HTML_HASH ]] | 53 if [[ ! -d ansi2html || $(git -C ansi2html rev-parse HEAD) != $ANSI2HTML_HASH ]] |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 do | 245 do |
246 echo Copying ../man1/$x | 246 echo Copying ../man1/$x |
247 cp "git/Documentation/$x" ../man1 | 247 cp "git/Documentation/$x" ../man1 |
248 done | 248 done |
249 | 249 |
250 for x in "${MAN7_TARGETS[@]}" | 250 for x in "${MAN7_TARGETS[@]}" |
251 do | 251 do |
252 echo Copying ../man7/$x | 252 echo Copying ../man7/$x |
253 cp "git/Documentation/$x" ../man7 | 253 cp "git/Documentation/$x" ../man7 |
254 done | 254 done |
OLD | NEW |