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 HASH=7fed0aff1b30 | |
ghost stip (do not use)
2014/04/02 23:04:50
ASCIIDOC_HASH?
| |
35 if [[ ! -d asciidoc || $(cd asciidoc && hg id -i) != $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 $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 HASH=5f95c9f850b19b368c43ae399cc831b17a26a5ac |
ghost stip (do not use)
2014/04/02 23:04:50
why not leave this at GITHASH
| |
36 if [[ ! -d git || $(git -C git rev-parse HEAD) != $GITHASH ]] | 49 if [[ ! -d git || $(git -C git rev-parse HEAD) != $HASH ]] |
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 |
43 # Replace the 'source' and 'package' strings. | 56 # Replace the 'source' and 'package' strings. |
44 ed git/Documentation/asciidoc.conf <<EOF | 57 ed git/Documentation/asciidoc.conf <<EOF |
45 H | 58 H |
46 81 | 59 81 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
86 /^\$(MAN_HTML): | 99 /^\$(MAN_HTML): |
87 a | 100 a |
88 asciidoc-override.css | 101 asciidoc-override.css |
89 . | 102 . |
90 -1 | 103 -1 |
91 j | 104 j |
92 wq | 105 wq |
93 EOF | 106 EOF |
94 | 107 |
95 fi | 108 fi |
96 echo Git up to date at $GITHASH \($BRANCH\) | 109 echo Git up to date at $HASH \($BRANCH\) |
97 | 110 |
98 # build directory files for 'essential' and 'helper' sections of the depot_tools | 111 # build directory files for 'essential' and 'helper' sections of the depot_tools |
99 # manpage. | 112 # manpage. |
100 for category in helper essential | 113 for category in helper essential |
101 do | 114 do |
102 { | 115 { |
103 PRINTED_BANNER=0 | 116 PRINTED_BANNER=0 |
104 for x in *.${category}.txt | 117 for x in *.${category}.txt |
105 do | 118 do |
106 # If we actually have tools in the category, print the banner first. | 119 # If we actually have tools in the category, print the banner first. |
(...skipping 77 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 |