tools.linux.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dominique Martinet <asmadeus@codewreck.org>
To: "Kernel.org Tools" <tools@linux.kernel.org>
Cc: Konstantin Ryabitsev <konstantin@linuxfoundation.org>,
	 Dominique Martinet <asmadeus@codewreck.org>
Subject: [PATCH b4] b4.sh: keep existing PYTHONPATH if set
Date: Sun, 02 Apr 2023 12:24:49 +0900	[thread overview]
Message-ID: <20230402-wrapper-keep-pythonpath-v1-1-e2bc5e556a67@codewreck.org> (raw)

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


             reply	other threads:[~2023-04-02  3:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-02  3:24 Dominique Martinet [this message]
2023-05-26 18:11 ` [PATCH b4] b4.sh: keep existing PYTHONPATH if set Konstantin Ryabitsev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230402-wrapper-keep-pythonpath-v1-1-e2bc5e556a67@codewreck.org \
    --to=asmadeus@codewreck.org \
    --cc=konstantin@linuxfoundation.org \
    --cc=tools@linux.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).