make_man.sh 840 Bytes
Newer Older
1 2 3 4 5
#!/bin/sh

# stop on failure
set -e

6
. "$(dirname $0)/common.sh"
7

Florent Fourcot's avatar
Florent Fourcot committed
8
# Use C local to avoid local dates in headers
Romain Bignon's avatar
Romain Bignon committed
9
export LANG=en_US.utf8
Florent Fourcot's avatar
Florent Fourcot committed
10

11 12 13
# disable termcolor
export ANSI_COLORS_DISABLED=1

14 15 16 17
[ -z "${TMPDIR}" ] && TMPDIR="/tmp"

# do not allow undefined variables anymore
set -u
18
WEBOOB_TMPDIR=$(mktemp -d "${TMPDIR}/weboob_man.XXXXXX")
19 20

# path to sources
21
WEBOOB_DIR=$(cd $(dirname $0)/.. && pwd -P)
22 23 24 25 26
touch "${WEBOOB_TMPDIR}/backends"
chmod 600 "${WEBOOB_TMPDIR}/backends"
echo "file://$WEBOOB_DIR/modules" > "${WEBOOB_TMPDIR}/sources.list"

export WEBOOB_WORKDIR="${WEBOOB_TMPDIR}"
27
export WEBOOB_DATADIR="${WEBOOB_TMPDIR}"
28
export PYTHONPATH="${WEBOOB_DIR}"
29
$PYTHON "${WEBOOB_DIR}/scripts/weboob-config" update
30

31
$PYTHON "${WEBOOB_DIR}/tools/make_man.py"
32 33 34 35 36 37 38

# allow failing commands past this point
STATUS=$?

rm -rf "${WEBOOB_TMPDIR}"

exit $STATUS