bitbake: data_smart: Add _remove operator
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 9 Mar 2013 12:47:21 +0000 (12:47 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 26 Aug 2013 10:29:46 +0000 (11:29 +0100)
commiteaaffa36ce4c3b8e9a55d69f378fb5ef291e57a4
tree03b1eac99259847f4cb95873232bc3efc72916d7
parentf1b628b881eae6971b27bdbc8c41ddbba8b89122
bitbake: data_smart: Add _remove operator

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.

The code currently only works on space delimited variables, which
are by far the most commom type. If bitbake is ehanced to support
types natively in future, we can adjust this code to adapt to that.

(Bitbake rev: 9c91948e10df278dad4832487fa56888cd58d187)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
bitbake/lib/bb/data_smart.py