tools.linux.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH b4] b4.sh: keep existing PYTHONPATH if set
@ 2023-04-02  3:24 Dominique Martinet
  2023-05-26 18:11 ` Konstantin Ryabitsev
  0 siblings, 1 reply; 2+ messages in thread
From: Dominique Martinet @ 2023-04-02  3:24 UTC (permalink / raw)
  To: Kernel.org Tools; +Cc: Konstantin Ryabitsev, Dominique Martinet

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>
---
 b4.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/b4.sh b/b4.sh
index 10d33b740d5e..bd7e587151f2 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" "${@}"

---
base-commit: 00303592f25693cb4eddf58fb51063afcff8dceb
change-id: 20230402-wrapper-keep-pythonpath-cbac5c0cc618

Best regards,
-- 
Dominique Martinet | Asmadeus


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH b4] b4.sh: keep existing PYTHONPATH if set
  2023-04-02  3:24 [PATCH b4] b4.sh: keep existing PYTHONPATH if set Dominique Martinet
@ 2023-05-26 18:11 ` Konstantin Ryabitsev
  0 siblings, 0 replies; 2+ messages in thread
From: Konstantin Ryabitsev @ 2023-05-26 18:11 UTC (permalink / raw)
  To: Kernel.org Tools, Dominique Martinet


On Sun, 02 Apr 2023 12:24:49 +0900, Dominique Martinet wrote:
> 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
> 
> [...]

Applied, thanks!

[1/1] b4.sh: keep existing PYTHONPATH if set
      commit: bf2bb043b60cd8907f144a2d646c799c882ec711

Best regards,
-- 
Konstantin Ryabitsev <konstantin@linuxfoundation.org>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-05-26 18:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-02  3:24 [PATCH b4] b4.sh: keep existing PYTHONPATH if set Dominique Martinet
2023-05-26 18:11 ` Konstantin Ryabitsev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).