* [PATCH 0/1] DISTRO_FEATURES_BACKFILL implementation
@ 2012-02-23 19:26 Paul Eggleton
2012-02-23 19:26 ` [PATCH 1/1] conf/bitbake.conf: add DISTRO_FEATURES_BACKFILL Paul Eggleton
0 siblings, 1 reply; 3+ messages in thread
From: Paul Eggleton @ 2012-02-23 19:26 UTC (permalink / raw)
To: openembedded-core
Implements DISTRO_FEATURES_BACKFILL to allow introducing new
DISTRO_FEATURES that control existing functionality without breaking
existing distro configuration, as discussed in the following thread:
http://article.gmane.org/gmane.comp.handhelds.openembedded.core/13033
(No changes since the RFC except for rebasing on top of current master.)
The following changes since commit 55f72b98f606c1554eb6edd151292ffdfddf1384:
texi2html: Fix for multilib (2012-02-22 23:01:45 +0000)
are available in the git repository at:
git://git.openembedded.org/openembedded-core-contrib paule/distro-features-backfill
http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=paule/distro-features-backfill
Paul Eggleton (1):
conf/bitbake.conf: add DISTRO_FEATURES_BACKFILL
meta/conf/bitbake.conf | 3 +++
meta/lib/oe/utils.py | 20 ++++++++++++++++++++
2 files changed, 23 insertions(+), 0 deletions(-)
--
1.7.5.4
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/1] conf/bitbake.conf: add DISTRO_FEATURES_BACKFILL
2012-02-23 19:26 [PATCH 0/1] DISTRO_FEATURES_BACKFILL implementation Paul Eggleton
@ 2012-02-23 19:26 ` Paul Eggleton
2012-02-24 16:37 ` Richard Purdie
0 siblings, 1 reply; 3+ messages in thread
From: Paul Eggleton @ 2012-02-23 19:26 UTC (permalink / raw)
To: openembedded-core
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>
---
meta/conf/bitbake.conf | 3 +++
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 90e5f7a..2539ae0 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -694,6 +694,9 @@ MACHINE_ESSENTIAL_EXTRA_RDEPENDS ?= ""
MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS ?= ""
IMAGE_FEATURES += "${EXTRA_IMAGE_FEATURES}"
+DISTRO_FEATURES_BACKFILL = ""
+DISTRO_FEATURES_append = "${@oe.utils.distro_features_backfill(d)}"
+
COMBINED_FEATURES = "\
${@base_both_contain("DISTRO_FEATURES", "MACHINE_FEATURES", "alsa", d)} \
${@base_both_contain("DISTRO_FEATURES", "MACHINE_FEATURES", "bluetooth", d)} \
diff --git a/meta/lib/oe/utils.py b/meta/lib/oe/utils.py
index 95daace..2aaed3a 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 ""
--
1.7.5.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/1] conf/bitbake.conf: add DISTRO_FEATURES_BACKFILL
2012-02-23 19:26 ` [PATCH 1/1] conf/bitbake.conf: add DISTRO_FEATURES_BACKFILL Paul Eggleton
@ 2012-02-24 16:37 ` Richard Purdie
0 siblings, 0 replies; 3+ messages in thread
From: Richard Purdie @ 2012-02-24 16:37 UTC (permalink / raw)
To: Patches and discussions about the oe-core layer
On Thu, 2012-02-23 at 19:26 +0000, Paul Eggleton wrote:
> 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>
> ---
> meta/conf/bitbake.conf | 3 +++
> meta/lib/oe/utils.py | 20 ++++++++++++++++++++
> 2 files changed, 23 insertions(+), 0 deletions(-)
Merged to master, thanks.
Richard
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-02-24 16:45 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-23 19:26 [PATCH 0/1] DISTRO_FEATURES_BACKFILL implementation Paul Eggleton
2012-02-23 19:26 ` [PATCH 1/1] conf/bitbake.conf: add DISTRO_FEATURES_BACKFILL Paul Eggleton
2012-02-24 16:37 ` Richard Purdie
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox