]> code.ossystems Code Review - openembedded-core.git/commitdiff
utils.py: Modify and rename distro_features_backfill python function
authorAndrei Gherzan <andrei@gherzan.ro>
Tue, 10 Jul 2012 13:38:02 +0000 (16:38 +0300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 17 Aug 2012 17:04:11 +0000 (18:04 +0100)
This function was written to be used with DISTRO_FEATURES. This behavior
is usefull with MACHINE_FEATURES as well.

Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
meta/lib/oe/utils.py

index e14743f3f336dab61b11cfff884751dc3eeece2d..8d3efe440c20917f4d12c47e759700d291086d3b 100644 (file)
@@ -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: