[bitbake-devel] [WIP 0/2] Adding support for shell arithmetics

Richard Purdie richard.purdie at linuxfoundation.org
Mon Jun 17 16:36:28 UTC 2013


On Fri, 2013-06-14 at 15:55 +0200, Olof Johansson wrote:
> On 2013-05-07 11:22, Olof Johansson wrote:
> > Hi,
> > 
> > A week or so I found out that shell fragments in bitbake recipes
> > don't support shell arithmetics (`$((1+1))`). The reason for this
> > is the shell lexing throwing NotImplemented exceptions. I've made
> > some progress in adding support for shell arithmetics, but I have
> > a hard time getting support for corner cases.
> > 
> > It was suprising to see that currently, only a subset of posix
> > shell scripts is supported, even though they are sent through to
> > be executed by the system shell. I think I understand the reason
> > for having to do the shell lexing; knowing what functions and
> > variables to export right? But I wonder if it's possible to do
> > the shell lexing as a best effort, and ignore any errors.
> > 
> > What are the risks with this approach? Is it feasibile to do so?
> > 
> > This patch series is a work in progress, and does support the use
> > cases we had issues with, however, I currently skip one unit
> > test, as I can't get it to work. Comments and feedback much
> > appreciated!
> 
> Did anybody have any feedback on this? I have had a hard time
> understanding the design of the lexing. I really could use some
> pointers --- is there some documents somewhere that could make me
> understand it better? I haven't had time to work on this lately,
> but it would be great to get this fixed, so I figured I'll try to
> take some time in the near future.
> 
> /Olof
> 
> PS. Saw that RP merged the exception message patch, thanks :).

That one was easy :)

I'm afraid I don't have much knowledge of the sh lexing code, Chris
might have more knowledge than me...

Cheers,

Richard





More information about the bitbake-devel mailing list