summaryrefslogtreecommitdiffstats
path: root/meta/lib
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib')
-rw-r--r--meta/lib/oe/utils.py20
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):
88def inherits(d, *classes): 88def 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
92def 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 ""