[bitbake-devel] [PATCH] data_smart: Add _remove operator

Paul Eggleton paul.eggleton at linux.intel.com
Sun Mar 10 20:39:07 UTC 2013


On Saturday 09 March 2013 16:20:10 Chris Larson wrote:
> On Sat, Mar 9, 2013 at 5:47 AM, Richard Purdie <
> 
> richard.purdie at linuxfoundation.org> wrote:
> > There are long standing complaints about the fact its very difficult
> > to remove a portion of a variable. The immediate request is for a -=
> > and =- operator. The trouble is that += and =+ are "immediate"
> > operators and are applied straight away. Most people would expect
> > -= and =- to be deferred to have the effect most people desire and
> > therefore implementing -= and =- would just make the situation more
> > confusing.
> > 
> > This deferred operation is much more similar to the override syntax
> > which happens at data store finalisation. The _remove operator is
> > therefore in keeping with the _append and _prepend operations.
> > 
> > This code is loosely based on a patch from Peter Seebach although it
> > has been rewritten to be simpler, more efficient and avoid some
> > potential bugs.
> 
> This is a nice idea, though I'm slightly concerned about the naive
> implementation (use of str.replace). Without it being either word-based
> (limits flexibility to optimize for the common case) or regex-based (more
> complex), we may be greatly limiting the usefulness. I wouldn't want to try
> to remove a word from DISTRO_FEATURES and end up removing part of a word,
> for example.

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 language 
elements that understood how to behave in this situation.

(I've been thinking about this for a while. It could also help to implement 
better dependencies on values of list variables, to only rebuild what's really 
necessary when DISTRO_FEATURES changes for example).

Cheers,
Paul

-- 

Paul Eggleton
Intel Open Source Technology Centre




More information about the bitbake-devel mailing list