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

Chris Larson clarson at kergoth.com
Sat Mar 9 23:20:10 UTC 2013


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.
-- 
Christopher Larson
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/bitbake-devel/attachments/20130309/99f3a1ca/attachment-0001.html>


More information about the bitbake-devel mailing list