[yocto] bash specific syntax in bbclass files

Paul Eggleton paul.eggleton at linux.intel.com
Fri May 3 05:25:45 PDT 2013


On Friday 03 May 2013 07:40:24 Trevor Woerner wrote:
> If every other distribution, over the next year, switched to python-3
> as their default, but (instead of updating) future versions of Ubuntu
> installed a symlink called python-3 pointing back to python-2, would
> that hold back Yocto from adopting python-3-isms too?

That's not quite the same situation and I don't think they would do that. They 
might however (as I guess they do now) point the standard python binary at 
python2 and then expect those using python3 scripts to explicitly request 
python3.

> It's sad how Ubuntu has so effectively killed the adoption of all
> features of bash (the default shell on many Linux distributions)
> introduced in the last 10 years by masquerading their crippled shell
> as "bash". And it's even sadder to see how so many projects, in
> response, have simply said "let's write all our shell scripts in
> original Bourne shell syntax" as a result.

Well, that is one way of looking at it; the change to dash in Ubuntu has 
indeed been quite a painful road (not so much for us but for the Linux 
ecosystem in general). On the other hand, it's not that dash is masquerading 
as bash, it's selected as providing /bin/sh. If you have written a shell 
script that starts with #!/bin/sh and then proceeds to use bash-specific 
syntax, sure it might well work on most systems because they're using bash, 
but the script started with something that wasn't true - it's not in fact a 
standard Unix Bourne-compatible shell script, it's a bash script.

It's also worth mentioning that we have had some benefit out of these changes, 
in that the scripts that have been fixed that end up running on the target will 
now more likely run when /bin/sh is provided by ash (i.e. busybox).

Cheers,
Paul

-- 

Paul Eggleton
Intel Open Source Technology Centre



More information about the yocto mailing list