diff options
author | Dominique Martinet <asmadeus@codewreck.org> | 2023-04-02 12:24:49 +0900 |
---|---|---|
committer | Konstantin Ryabitsev <konstantin@linuxfoundation.org> | 2023-05-26 14:05:22 -0400 |
commit | bf2bb043b60cd8907f144a2d646c799c882ec711 (patch) | |
tree | 7a25c770a583762e75cea66e617a228533bde044 | |
parent | 229b766fdd3b9d5561e76a5cf569aa946dcc2ef0 (diff) | |
download | b4-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-x | b4.sh | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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" "${@}" |