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:37:07 +0000 |
commit | 72ce5c4cde612515451226a1b10f5b348a4a6a4c (patch) | |
tree | 4aac6cd016ce96e07299308102c39db120267169 | |
parent | 5ac604e67a267ae16a19ea8852098c58cf5f8ca2 (diff) | |
download | poky-72ce5c4cde612515451226a1b10f5b348a4a6a4c.tar.gz |
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].
(From OE-Core rev: 738658d9d5ddef026d2929188744aa225324bf26)
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/conf/bitbake.conf | 3 | ||||
-rw-r--r-- | meta/lib/oe/utils.py | 20 |
2 files changed, 23 insertions, 0 deletions
diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf index 90e5f7a3bc..2539ae0f0a 100644 --- a/meta/conf/bitbake.conf +++ b/meta/conf/bitbake.conf | |||
@@ -694,6 +694,9 @@ MACHINE_ESSENTIAL_EXTRA_RDEPENDS ?= "" | |||
694 | MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS ?= "" | 694 | MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS ?= "" |
695 | IMAGE_FEATURES += "${EXTRA_IMAGE_FEATURES}" | 695 | IMAGE_FEATURES += "${EXTRA_IMAGE_FEATURES}" |
696 | 696 | ||
697 | DISTRO_FEATURES_BACKFILL = "" | ||
698 | DISTRO_FEATURES_append = "${@oe.utils.distro_features_backfill(d)}" | ||
699 | |||
697 | COMBINED_FEATURES = "\ | 700 | COMBINED_FEATURES = "\ |
698 | ${@base_both_contain("DISTRO_FEATURES", "MACHINE_FEATURES", "alsa", d)} \ | 701 | ${@base_both_contain("DISTRO_FEATURES", "MACHINE_FEATURES", "alsa", d)} \ |
699 | ${@base_both_contain("DISTRO_FEATURES", "MACHINE_FEATURES", "bluetooth", d)} \ | 702 | ${@base_both_contain("DISTRO_FEATURES", "MACHINE_FEATURES", "bluetooth", d)} \ |
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): | |||
88 | def inherits(d, *classes): | 88 | def inherits(d, *classes): |
89 | """Return True if the metadata inherits any of the specified classes""" | 89 | """Return True if the metadata inherits any of the specified classes""" |
90 | return any(bb.data.inherits_class(cls, d) for cls in classes) | 90 | return any(bb.data.inherits_class(cls, d) for cls in classes) |
91 | |||
92 | def distro_features_backfill(d): | ||
93 | # This construct allows the addition of new features to DISTRO_FEATURES | ||
94 | # that if not present would disable existing functionality, without | ||
95 | # disturbing distributions that have already set DISTRO_FEATURES. | ||
96 | # Distributions wanting to elide a value in DISTRO_FEATURES_BACKFILL should | ||
97 | # add the feature to DISTRO_FEATURES_BACKFILL_CONSIDERED | ||
98 | |||
99 | backfill = (d.getVar("DISTRO_FEATURES_BACKFILL", True) or "").split() | ||
100 | considered = (d.getVar("DISTRO_FEATURES_BACKFILL_CONSIDERED", True) or "").split() | ||
101 | |||
102 | addfeatures = [] | ||
103 | for feature in backfill: | ||
104 | if feature not in considered: | ||
105 | addfeatures.append(feature) | ||
106 | |||
107 | if addfeatures: | ||
108 | return " %s" % (" ".join(addfeatures)) | ||
109 | else: | ||
110 | return "" | ||