mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH] configure_helper.py: check for emptyish ptxdist environment variables
@ 2019-09-11  7:50 Roland Hieber
  2019-09-23  8:46 ` Roland Hieber
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Roland Hieber @ 2019-09-11  7:50 UTC (permalink / raw)
  To: ptxdist; +Cc: Roland Hieber

When the environment variable exists, but is empty, os.environment.get()
will return its value instead of using the supplied default. Check for
cases like that to prevent calling an empty command.

Signed-off-by: Roland Hieber <rhi@pengutronix.de>
---
 scripts/configure_helper.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/scripts/configure_helper.py b/scripts/configure_helper.py
index c7b46f3b3846..3261a548ec96 100755
--- a/scripts/configure_helper.py
+++ b/scripts/configure_helper.py
@@ -151,7 +151,12 @@ def abort(message):
 	exit(1)
 
 def ask_ptxdist(pkg):
-	ptxdist = os.environ.get("PTXDIST", os.environ.get("ptxdist", "ptxdist"))
+	ptxdist = os.environ.get("PTXDIST")
+	if not ptxdist.strip():
+		ptxdist = os.environ.get("ptxdist")
+	if not ptxdist.strip():
+		ptxdist = "ptxdist"
+	
 	p = subprocess.Popen([ ptxdist, "-k", "make",
 		"/print-%s_DIR" % pkg,
 		"/print-%s_SUBDIR" % pkg,
-- 
2.23.0


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

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

end of thread, other threads:[~2019-10-17  8:41 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-11  7:50 [ptxdist] [PATCH] configure_helper.py: check for emptyish ptxdist environment variables Roland Hieber
2019-09-23  8:46 ` Roland Hieber
2019-09-25 13:13 ` [ptxdist] [PATCH v2] " Roland Hieber
2019-10-16 10:53   ` Roland Hieber
2019-10-16 11:38     ` Michael Olbrich
2019-10-16 11:58       ` Roland Hieber
2019-10-16 13:26         ` Michael Olbrich
2019-10-17  8:24           ` Roland Hieber
2019-10-17  8:41 ` [ptxdist] [PATCH v3] configure_helper.py: be more verbose when calling ptxdist fails Roland Hieber

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox