From patchwork Thu Aug 16 22:28:47 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [V2, 1/6] utils.py: Modify and rename distro_features_backfill python function Date: Thu, 16 Aug 2012 22:28:47 -0000 From: Andrei Gherzan X-Patchwork-Id: 34749 Message-Id: <754a26c722091d5922d1ef095def13f1cf57f27f.1345155936.git.andrei@gherzan.ro> To: openembedded-core@lists.openembedded.org This function was written to be used with DISTRO_FEATURES. This behavior is usefull with MACHINE_FEATURES as well. Signed-off-by: Andrei Gherzan --- meta/lib/oe/utils.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/meta/lib/oe/utils.py b/meta/lib/oe/utils.py index e14743f..8d3efe4 100644 --- a/meta/lib/oe/utils.py +++ b/meta/lib/oe/utils.py @@ -87,15 +87,18 @@ 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): +def features_backfill(var,d): + # This construct allows the addition of new features to variable specified + # as var + # Example for var = "DISTRO_FEATURES" # 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() + backfill = (d.getVar(var+"_BACKFILL", True) or "").split() + considered = (d.getVar(var+"_BACKFILL_CONSIDERED", True) or "").split() addfeatures = [] for feature in backfill: