Add tool to properly start make_man.py

Force using local modules / code.
This commit is contained in:
Laurent Bachelier 2012-03-27 11:00:49 +02:00 committed by Romain Bignon
commit a99cd8a0e5

29
tools/make_man.sh Executable file
View file

@ -0,0 +1,29 @@
#!/bin/sh
# stop on failure
set -e
[ -z "${TMPDIR}" ] && TMPDIR="/tmp"
# do not allow undefined variables anymore
set -u
WEBOOB_TMPDIR=$(mktemp -d "${TMPDIR}/weboob_man.XXXXX")
# path to sources
WEBOOB_DIR=$(readlink -e $(dirname $0)/..)
touch "${WEBOOB_TMPDIR}/backends"
chmod 600 "${WEBOOB_TMPDIR}/backends"
echo "file://$WEBOOB_DIR/modules" > "${WEBOOB_TMPDIR}/sources.list"
export WEBOOB_WORKDIR="${WEBOOB_TMPDIR}"
export PYTHONPATH="${WEBOOB_DIR}"
"${WEBOOB_DIR}/scripts/weboob-config" update
"${WEBOOB_DIR}/tools/make_man.py"
# allow failing commands past this point
STATUS=$?
rm -rf "${WEBOOB_TMPDIR}"
exit $STATUS