diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2012-02-23 19:26:09 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-02-24 16:36:46 +0000 |
commit | 738658d9d5ddef026d2929188744aa225324bf26 (patch) | |
tree | 0eacc17ca93915ee1a4e5621c68a5233b3d5ea28 /meta/lib | |
parent | deb501b8a1cb3cdb1ea0a48ea08e411c2be365b3 (diff) | |
download | openembedded-core-738658d9d5ddef026d2929188744aa225324bf26.tar.gz openembedded-core-738658d9d5ddef026d2929188744aa225324bf26.tar.bz2 openembedded-core-738658d9d5ddef026d2929188744aa225324bf26.zip |
conf/bitbake.conf: add DISTRO_FEATURES_BACKFILL
When introducing new items to DISTRO_FEATURES that control functionality
that is already enabled, in order to leave existing distro configuration
unchanged we need a way to "backfill" these new feature items onto the
existing DISTRO_FEATURES value.
This introduces a DISTRO_FEATURES_BACKFILL variable whose items will be
added to the end of DISTRO_FEATURES, unless they also appear in
DISTRO_FEATURES_BACKFILL_CONSIDERED which distros can use in their
configuration to prevent specific items from being added.
Fixes [YOCTO #1946].
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r-- | meta/lib/oe/utils.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/meta/lib/oe/utils.py b/meta/lib/oe/utils.py index 02d5442940..8912dac3bb 100644 --- a/meta/lib/oe/utils.py +++ b/meta/lib/oe/utils.py @@ -88,3 +88,23 @@ def param_bool(cfg, field, dflt = None): def inherits(d, *classes): """Return True if the metadata inherits any of the specified classes""" return any(bb.data.inherits_class(cls, d) for cls in classes) + +def distro_features_backfill(d): + # This construct allows the addition of new features to DISTRO_FEATURES + # that if not present would disable existing functionality, without + # disturbing distributions that have already set DISTRO_FEATURES. + # Distributions wanting to elide a value in DISTRO_FEATURES_BACKFILL should + # add the feature to DISTRO_FEATURES_BACKFILL_CONSIDERED + + backfill = (d.getVar("DISTRO_FEATURES_BACKFILL", True) or "").split() + considered = (d.getVar("DISTRO_FEATURES_BACKFILL_CONSIDERED", True) or "").split() + + addfeatures = [] + for feature in backfill: + if feature not in considered: + addfeatures.append(feature) + + if addfeatures: + return " %s" % (" ".join(addfeatures)) + else: + return "" |