[bitbake-devel] [PATCH] data_smart: Add _remove operator
clarson at kergoth.com
Wed Mar 13 23:04:02 UTC 2013
On Wed, Mar 13, 2013 at 11:28 AM, Peter Seebach <peter.seebach at windriver.com
> On Sun, 10 Mar 2013 20:39:07 +0000
> Paul Eggleton <paul.eggleton at linux.intel.com> wrote:
> > I can't recall if we've discussed this before, but shouldn't we be
> looking at
> > introducing some understanding of list type variables into BitBake
> itself? If
> > BitBake knew the variable was a list it would be possible to have
> > elements that understood how to behave in this situation.
Yeah, this gets brought up from time to time, it's something we've wanted
for a while, but nobody has taken the time to make it happen. I would love
to see some form of typing go in, and I know Richard has expressed a desire
to see this as well in the past.
I rather like this. I would like to have _remove, and it may even make sense
> to adopt _remove in the short term, but really I think most of the things
> where we're using append/remove should probably be lists, which would also
> eliminate the entire category of bugs in which it is unclear whether or not
> to add a space.
> Rough thoughts about implementation: Listness could be a flag.
> LIST[list] = " "
> LIST = "blah blah blah"
> # Oh, hey, what if...
> PATH[list] = ":"
We do have a flag-based typing implementation in the metadata, just not in
bitbake itself, see
http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?h=e4921fd for the
original implementation. I particularly like the bits that automatically
convert the function signature of the type callback (or class) into a
request for additional information via flags. An added required argument to
the function = a required flag of that name, same for optional. See
examples of that particular implementation.
or as shorthand:
> LIST = [blah blah blah]
I played briefly around with a *really* preliminary prototype of something
similar to this. See https://gist.github.com/kergoth/2788410 - any unquoted
values are interpreted as json types, and the append/prepend operations are
switched to better work with non-string values. It works surprisingly well
considering how naive the implementation is, see the functional local.conf
snippet in the gist.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the bitbake-devel