2020-02-07 00:44:35 +01:00
|
|
|
#!/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
|
2022-11-13 11:14:06 +01:00
|
|
|
echo "Generating TOS for language $l"
|
2022-10-20 13:02:56 +02:00
|
|
|
cat conf.py.in | sed -e "s/%VERSION%/$VERSION/g" > conf.py
|
2020-02-07 00:44:35 +01:00
|
|
|
# '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
|
2022-11-13 11:14:06 +01:00
|
|
|
if test $f = "html"
|
|
|
|
then
|
|
|
|
htmlark -o $l/${VERSION}.$f _build/$f/${VERSION}.$f
|
|
|
|
else
|
|
|
|
mv _build/$f/${VERSION}.$f $l/${VERSION}.$f
|
|
|
|
fi
|
2020-02-07 00:44:35 +01:00
|
|
|
done
|
|
|
|
done
|
|
|
|
cd ..
|
2022-10-20 13:02:56 +02:00
|
|
|
echo "Success"
|