mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] ptxdist variable BASH and BASH_VERSION are shadowed
@ 2020-02-11 11:12 Christian Hermann
  2020-02-14  8:30 ` Michael Olbrich
  0 siblings, 1 reply; 2+ messages in thread
From: Christian Hermann @ 2020-02-11 11:12 UTC (permalink / raw)
  To: ptxdist

Hi list,

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


Kind regards.

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] ptxdist variable BASH and BASH_VERSION are shadowed
  2020-02-11 11:12 [ptxdist] ptxdist variable BASH and BASH_VERSION are shadowed Christian Hermann
@ 2020-02-14  8:30 ` Michael Olbrich
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Olbrich @ 2020-02-14  8:30 UTC (permalink / raw)
  To: ptxdist

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

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

end of thread, other threads:[~2020-02-14  8:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-11 11:12 [ptxdist] ptxdist variable BASH and BASH_VERSION are shadowed Christian Hermann
2020-02-14  8:30 ` Michael Olbrich

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