OLD | NEW |
1 #!/bin/bash -e | 1 #!/bin/bash -e |
2 shopt -s nullglob | 2 shopt -s nullglob |
3 | 3 |
4 cd $(dirname "$0") | 4 cd $(dirname "$0") |
5 | 5 |
6 # Script which takes all the asciidoc git-*.txt files in this directory, renders | 6 # Script which takes all the asciidoc git-*.txt files in this directory, renders |
7 # them to html + manpage format using git 1.9's doc toolchain, then puts | 7 # them to html + manpage format using git 1.9's doc toolchain, then puts |
8 # them in depot_tools to be committed. | 8 # them in depot_tools to be committed. |
9 | 9 |
10 ensure_in_path() { | 10 ensure_in_path() { |
11 local CMD=$1 | 11 local CMD=$1 |
12 local PTH=$(which "$CMD") | 12 local PTH=$(which "$CMD") |
13 if [[ ! $PTH ]] | 13 if [[ ! $PTH ]] |
14 then | 14 then |
15 echo Must have "$CMD" on your PATH! | 15 echo Must have "$CMD" on your PATH! |
16 exit 1 | 16 exit 1 |
17 else | 17 else |
18 echo Using \'$PTH\' for ${CMD}. | 18 echo Using \'$PTH\' for ${CMD}. |
19 fi | 19 fi |
20 } | 20 } |
21 | 21 |
22 ensure_in_path xmlto | 22 ensure_in_path xmlto |
23 ensure_in_path asciidoc | |
24 | 23 |
25 DFLT_CATALOG_PATH="/usr/local/etc/xml/catalog" | 24 DFLT_CATALOG_PATH="/usr/local/etc/xml/catalog" |
26 if [[ ! $XML_CATALOG_FILES && -f "$DFLT_CATALOG_PATH" ]] | 25 if [[ ! $XML_CATALOG_FILES && -f "$DFLT_CATALOG_PATH" ]] |
27 then | 26 then |
28 # Default if you install doctools with homebrew on mac | 27 # Default if you install doctools with homebrew on mac |
29 export XML_CATALOG_FILES="$DFLT_CATALOG_PATH" | 28 export XML_CATALOG_FILES="$DFLT_CATALOG_PATH" |
30 echo Using \'$DFLT_CATALOG_PATH\' for \$XML_CATALOG_FILES. | 29 echo Using \'$DFLT_CATALOG_PATH\' for \$XML_CATALOG_FILES. |
31 fi | 30 fi |
32 | 31 |
| 32 # We pull asciidoc to get the right version |
| 33 BRANCH=8.6.9 |
| 34 ASCIIDOC_HASH=7fed0aff1b30 |
| 35 if [[ ! -d asciidoc || $(cd asciidoc && hg id -i) != $ASCIIDOC_HASH ]] |
| 36 then |
| 37 echo Cloning asciidoc |
| 38 rm -rf asciidoc |
| 39 hg clone -r $BRANCH https://asciidoc.googlecode.com/hg/ asciidoc |
| 40 (cd asciidoc && ln -s asciidoc.py asciidoc) |
| 41 fi |
| 42 echo Asciidoc up to date at $ASCIIDOC_HASH \($BRANCH\) |
| 43 |
| 44 export PATH=`pwd`/asciidoc:$PATH |
| 45 |
33 # We pull git to get its documentation toolchain | 46 # We pull git to get its documentation toolchain |
34 BRANCH=v1.9.0 | 47 BRANCH=v1.9.0 |
35 GITHASH=5f95c9f850b19b368c43ae399cc831b17a26a5ac | 48 GITHASH=5f95c9f850b19b368c43ae399cc831b17a26a5ac |
36 if [[ ! -d git || $(git -C git rev-parse HEAD) != $GITHASH ]] | 49 if [[ ! -d git || $(git -C git rev-parse HEAD) != $GITHASH ]] |
37 then | 50 then |
38 echo Cloning git | 51 echo Cloning git |
39 rm -rf git | 52 rm -rf git |
40 git clone --single-branch --branch $BRANCH --depth 1 \ | 53 git clone --single-branch --branch $BRANCH --depth 1 \ |
41 https://kernel.googlesource.com/pub/scm/git/git.git 2> /dev/null | 54 https://kernel.googlesource.com/pub/scm/git/git.git 2> /dev/null |
42 | 55 |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 do | 197 do |
185 echo Copying ../man1/$x | 198 echo Copying ../man1/$x |
186 cp "git/Documentation/$x" ../man1 | 199 cp "git/Documentation/$x" ../man1 |
187 done | 200 done |
188 | 201 |
189 for x in "${MAN7_TARGETS[@]}" | 202 for x in "${MAN7_TARGETS[@]}" |
190 do | 203 do |
191 echo Copying ../man7/$x | 204 echo Copying ../man7/$x |
192 cp "git/Documentation/$x" ../man7 | 205 cp "git/Documentation/$x" ../man7 |
193 done | 206 done |
OLD | NEW |