aboutsummaryrefslogtreecommitdiff
path: root/bin/sphinx_update.sh
diff options
context:
space:
mode:
Diffstat (limited to 'bin/sphinx_update.sh')
-rwxr-xr-xbin/sphinx_update.sh35
1 files changed, 35 insertions, 0 deletions
diff --git a/bin/sphinx_update.sh b/bin/sphinx_update.sh
new file mode 100755
index 000000000..6d589667c
--- /dev/null
+++ b/bin/sphinx_update.sh
@@ -0,0 +1,35 @@
1# This is more portable than `which' but comes with
2# the caveat of not(?) properly working on busybox's ash:
3existence()
4{
5 type "$1" >/dev/null 2>&1
6}
7
8sphinx_update()
9{
10 echo "Updating handbook..."
11 if existence sphinx-build; then
12 cwd=$PWD
13 cd contrib/handbook || exit 1
14 if test -e _build; then
15 make clean
16 fi
17 # GNS
18 make html >/dev/null || exit 1
19 if test -e ../../doc/handbook/html; then
20 rm -r ../../doc/handbook/html || exit 1
21 fi
22 cp -r _build/html ../../doc/handbook/ || exit 1
23 if test -e ../../doc/handbook/texinfo; then
24 rm -r ../../doc/handbook/texinfo || exit 1
25 fi
26 make info >/dev/null || exit 1
27 cp -r _build/texinfo ../../doc/handbook/ || exit 1
28 cd $cwd
29 else
30 echo "ERROR: Sphinx not found! Unable to generate recent documentation."
31 exit 1
32 fi
33}
34
35sphinx_update