From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iCJz1-0001JW-7X for ptxdist@pengutronix.de; Mon, 23 Sep 2019 10:46:11 +0200 Received: from rhi by ptx.hi.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1iCJz0-0003rI-VK for ptxdist@pengutronix.de; Mon, 23 Sep 2019 10:46:10 +0200 Date: Mon, 23 Sep 2019 10:46:10 +0200 From: Roland Hieber Message-ID: <20190923084610.umjmbzfclc7bvsv5@pengutronix.de> References: <20190911075048.8125-1-rhi@pengutronix.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190911075048.8125-1-rhi@pengutronix.de> Subject: Re: [ptxdist] [PATCH] configure_helper.py: check for emptyish ptxdist environment variables List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ptxdist-bounces@pengutronix.de Sender: "ptxdist" To: ptxdist@pengutronix.de mol, any comments to this? - Roland On Wed, Sep 11, 2019 at 09:50:49AM +0200, Roland Hieber wrote: > 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 > --- > 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 > -- Roland Hieber | r.hieber@pengutronix.de | Pengutronix e.K. | https://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim | Phone: +49-5121-206917-5086 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ ptxdist mailing list ptxdist@pengutronix.de