aboutsummaryrefslogtreecommitdiff
path: root/contrib/update-tos.sh
blob: 47d3af778ac00b743a2d40f5b95d7086a6738775 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/sh
# This file is in the public domain

# Should be called with the list of languages to generate, i.e.
# $ ./update-tos.sh en de fr it

# Error checking on
set -eu
echo "Generating TOS for ETag $VERSION"

rm -f sphinx.log sphinx.err
# We process inputs using Makefile in tos/ directory
cd tos
for l in $@
do
    mkdir -p $l
    echo Generating TOS for language $l
    # 'f' is for the supported formats, note that the 'make' target
    # MUST match the file extension.
    for f in html txt pdf epub xml
    do
        rm -rf _build
        echo "  Generating format $f"
        make -e SPHINXOPTS="-D language='$l'" $f >>sphinx.log 2>>sphinx.err < /dev/null
        mv _build/$f/tos.$f $l/${VERSION}.$f
    done
done
cd ..