[oe] RFC: strip "-native" from $S for native packages automatically (bug 1856)

pHilipp Zabel philipp.zabel at gmail.com
Thu Jan 31 12:06:49 UTC 2008


On Jan 27, 2008 1:23 AM, Richard Purdie <rpurdie at rpsys.net> wrote:
> On Sat, 2008-01-26 at 13:43 +0000, Richard Purdie wrote:
> > On Sat, 2008-01-26 at 01:51 +0100, Michael 'Mickey' Lauer wrote:
> > > If we really want to have that (I'm -0 on that), I would rather propose
> > >
> > > S = ${@"%s/%s" % ( bb.data.getVar("WORKDIR", d, 1), bb.data.getVar("P", d, 1).replace( "-native", "" ) ) }
> >
> > Would it be worth adding syntax to bitbake for this kind of operation,
> > something like:
> >
> > S *= "${S}-native"
> >
> > ?
>
> This syntax doesn't solve the original problem of course.
>
> People have requested -= and I've been wondering if we should add that
> as a search and remove operator. To match the existing language that
> would have to work on space delimited lists though so its of no use to
> this use case. We could pair this with a *= or operator which worked the
> same way without the space delimiter like .= does...
>
> S *= "-native"
>
> ?
>
> maybe ~= would be a better pairing with -=?
>
> Having syntax which allowed variable reuse like the original example
> above could also be useful:
>
> S = "foo"
> S *= "${S}-native"
> print bb.data.getVar("S", d, 1)
>     foo-native
>
> Does anyone have any other language enhancement requests for bitbake
> while I'm thinking about it (or any thoughts on the above)?

While you're already busy proposing obscure syntax enhancements :)
What about allowing bashisms/dashisms in the ${...} variable expansion?
We could write
S = "${S%-native}"
or
S = "${S/-native/}"
then.

regards
Philipp




More information about the Openembedded-devel mailing list