diff options
author | Juergen Borleis <jbe@pengutronix.de> | 2017-11-14 13:03:02 +0100 |
---|---|---|
committer | Michael Olbrich <m.olbrich@pengutronix.de> | 2017-11-17 17:15:38 +0100 |
commit | f3e8c77057f266b0b673cebf540bbf6aa4f8c05d (patch) | |
tree | 15e01852cab74adf5c53e34e77ed0644ef113ee4 /bin | |
parent | efebcad7d3bd4d3d1e4cbdc280ce5bf29f298cdf (diff) | |
download | ptxdist-f3e8c77057f266b0b673cebf540bbf6aa4f8c05d.tar.gz ptxdist-f3e8c77057f266b0b673cebf540bbf6aa4f8c05d.tar.xz |
PTXdist: add virtual environment awareness
Required to work with local python tools.
Signed-off-by: Juergen Borleis <jbe@pengutronix.de>
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/ptxdist | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/bin/ptxdist b/bin/ptxdist index de70aa32d..82f263bff 100755 --- a/bin/ptxdist +++ b/bin/ptxdist @@ -866,13 +866,24 @@ check_premake() check_deps } +check_virtualenv() +{ + if [ -n "${PTXDIST_VIRTUALENV}" ]; then + if [ ! -e "${PTXDIST_VIRTUALENV}/bin/activate" ]; then + ptxd_bailout "Virtual Env '${PTXDIST_VIRTUALENV}' not found" + fi + . "${PTXDIST_VIRTUALENV}/bin/activate" + fi +} + # # runs the standard tests before calling into make + compiler check # check_premake_compiler() { check_premake && - check_compiler + check_compiler && + check_virtualenv } @@ -1056,6 +1067,9 @@ Options: --git use git to apply patches --auto-version automatically switch to the correct PTXdist version + + --virtualenv=<dir> Python virtual environment directory. It must + contain a 'bin/activate' shell script. EOF } @@ -1241,6 +1255,7 @@ create_docs() { cp -an "${dir}/${entry}" "${srcdir}/" || return done done && + check_virtualenv && sphinx-build -b "${builder}" -d "${outdir}/.doctrees" "${srcdir}" \ "${outdir}/${builder}" && if [ "${builder}" = "latex" ]; then @@ -1398,6 +1413,9 @@ parse_first() --auto-version) PTXDIST_AUTOVERSION=1 ;; + --virtualenv=*) + PTXDIST_VIRTUALENV="${arg#*=}" + ;; --) while [ ${#} -ne 0 ]; do arg="${1}" |