From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from dude02.hi.pengutronix.de ([2001:67c:670:100:1d::28] helo=dude02.lab.pengutronix.de) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1j2WNE-00029O-DC for ptxdist@pengutronix.de; Fri, 14 Feb 2020 09:30:56 +0100 Received: from mol by dude02.lab.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1j2WNE-0000oL-5p for ptxdist@pengutronix.de; Fri, 14 Feb 2020 09:30:56 +0100 Date: Fri, 14 Feb 2020 09:30:56 +0100 From: Michael Olbrich Message-ID: <20200214083056.GA13619@pengutronix.de> References: <35cd5405-fccf-7019-9b0c-b57115d218c9@hytera.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <35cd5405-fccf-7019-9b0c-b57115d218c9@hytera.de> Subject: Re: [ptxdist] ptxdist variable BASH and BASH_VERSION are shadowed 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 Hi, On Tue, Feb 11, 2020 at 12:12:39PM +0100, Christian Hermann wrote: > I found an issue where ptxdist internal variables BASH and BASH_VERSION (as > defined in rules/bash.make) are shadowed. > I suspect this is because makefiles require $BASH to be set to host's bash > path. > > Maybe this could have some undesired side-effects? > > ``` > $ ptxdist print BASH > /bin/bash > > $ ptxdist print BASH_VERSION > 5.0.11(1)-release > ``` > > the expected version as of 94a6a99e87 is: 4.3.30 This is just a side effect of how 'ptxdist print' works: If a shell variable with the given name exists, then it's value is printed. Otherwise 'make' is called to print the variable. Try 'ptxdist make /print-BASH_VERSION'. This will give the correct result. And we only use our own BASH / BASH_VERSION inside make. They are not exported anyways, so when bash starts again, we don't expect these variables to be available. Michael -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ ptxdist mailing list ptxdist@pengutronix.de