[bitbake-devel] Half-baked proposal: Introduce @{foo} variable expansion for bitbake

Chris Larson clarson at kergoth.com
Tue Jan 22 23:34:34 UTC 2013


On Tue, Jan 22, 2013 at 1:24 PM, Peter Seebach
<peter.seebach at windriver.com>wrote:

> PREFIX = "${@['', (d.getVar("BBEXTENDVARIANT", True) or "") +
> '-'][(d.getVar("BBEXTENDVARIANT", True) or "") != ""]}"
>
> and then use ${PREFIX}${FOO}.
>
> ... wait, that's horrible. What if I could write:
>         @{BBEXTENDVARIANT+@{BBEXTENDVARIANT}-}
> instead? That's practically legible by comparison. Or, with the new
> bonus features,
>

BBEXTENDVARIANT ??= ""
PREFIX = "${@BBEXTENDVARIANT + '-' if BBEXTENDVARIANT else ''}"

Which leverages the python inline if statement syntax, coupled with the
bitbake feature which allows you to reference variables as though they were
python variables.
-- 
Christopher Larson
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/bitbake-devel/attachments/20130122/5dd9e191/attachment-0001.html>


More information about the bitbake-devel mailing list