weboob_lint.sh 723 Bytes
Newer Older
1 2 3 4 5
#!/bin/sh

# stop on failure
set -e

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

8 9 10 11
[ -z "${TMPDIR}" ] && TMPDIR="/tmp"

# do not allow undefined variables anymore
set -u
12
WEBOOB_TMPDIR=$(mktemp -d "${TMPDIR}/weboob_lint.XXXXXX")
13 14

# path to sources
15
WEBOOB_DIR=$(cd $(dirname $0)/.. && pwd -P)
16 17 18 19 20
touch "${WEBOOB_TMPDIR}/backends"
chmod 600 "${WEBOOB_TMPDIR}/backends"
echo "file://$WEBOOB_DIR/modules" > "${WEBOOB_TMPDIR}/sources.list"

export WEBOOB_WORKDIR="${WEBOOB_TMPDIR}"
21
export WEBOOB_DATADIR="${WEBOOB_TMPDIR}"
22
export PYTHONPATH="${WEBOOB_DIR}"
23
$PYTHON "${WEBOOB_DIR}/scripts/weboob-config" update
24

25
$PYTHON "${WEBOOB_DIR}/tools/weboob_lint.py"
26 27 28 29 30 31 32

# allow failing commands past this point
STATUS=$?

rm -rf "${WEBOOB_TMPDIR}"

exit $STATUS