aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDominique Martinet <asmadeus@codewreck.org>2023-04-02 12:24:49 +0900
committerKonstantin Ryabitsev <konstantin@linuxfoundation.org>2023-05-26 14:05:22 -0400
commitbf2bb043b60cd8907f144a2d646c799c882ec711 (patch)
tree7a25c770a583762e75cea66e617a228533bde044
parent229b766fdd3b9d5561e76a5cf569aa946dcc2ef0 (diff)
downloadb4-bf2bb043b60cd8907f144a2d646c799c882ec711.tar.gz
b4.sh: keep existing PYTHONPATH if set
for setups depending on PYTHONPATH being set to provide dependencies e.g. requests, b4.sh overriding of the variable is too strong. Set current directory and patatt's first but keep PYTHONPATH if it was not empty. While we are here, remove useless use of env: the shell does the job just fine if the variable is set before exec Signed-off-by: Dominique Martinet <asmadeus@codewreck.org> Link: https://msgid.link/20230402-wrapper-keep-pythonpath-v1-1-e2bc5e556a67@codewreck.org Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
-rwxr-xr-xb4.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/b4.sh b/b4.sh
index 10d33b7..bd7e587 100755
--- a/b4.sh
+++ b/b4.sh
@@ -6,4 +6,5 @@
REAL_SCRIPT=$(realpath -e ${BASH_SOURCE[0]})
SCRIPT_TOP="${SCRIPT_TOP:-$(dirname ${REAL_SCRIPT})}"
-exec env PYTHONPATH="${SCRIPT_TOP}:${SCRIPT_TOP}/patatt" python3 "${SCRIPT_TOP}/b4/command.py" "${@}"
+PYTHONPATH="${SCRIPT_TOP}:${SCRIPT_TOP}/patatt${PYTHONPATH:+:$PYTHONPATH}" \
+ exec python3 "${SCRIPT_TOP}/b4/command.py" "${@}"