Signed-off-by: Jacob Kroon <[email protected]>
---
 meta/classes/features_check.bbclass | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

Changes since v1:
  Always warn if unused, regardless of where the class is
  included/inherited from
diff --git a/meta/classes/features_check.bbclass 
b/meta/classes/features_check.bbclass
index 4ba827d4ab..b3c8047861 100644
--- a/meta/classes/features_check.bbclass
+++ b/meta/classes/features_check.bbclass
@@ -16,7 +16,19 @@ python () {
     if d.getVar('PARSE_ALL_RECIPES', False):
         return
 
+    unused = True
+
     for kind in ['DISTRO', 'MACHINE', 'COMBINED']:
+        if d.getVar('ANY_OF_' + kind + '_FEATURES') is None and \
+           d.overridedata.get('ANY_OF_' + kind + '_FEATURES') is None and \
+           d.getVar('REQUIRED_' + kind + '_FEATURES') is None and \
+           d.overridedata.get('REQUIRED_' + kind + '_FEATURES') is None and \
+           d.getVar('CONFLICT_' + kind + '_FEATURES') is None and \
+           d.overridedata.get('CONFLICT_' + kind + '_FEATURES') is None:
+            continue
+
+        unused = False
+
         # Assume at least one var is set.
         features = set((d.getVar(kind + '_FEATURES') or '').split())
 
@@ -39,4 +51,7 @@ python () {
             if conflicts:
                 raise bb.parse.SkipRecipe("conflicting %s feature%s '%s' (in 
%s_FEATURES)"
                     % (kind.lower(), 's' if len(conflicts) > 1 else '', ' 
'.join(conflicts), kind))
+
+    if unused:
+        bb.warn("Recipe inherits features_check but doesn't use it")
 }
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#139406): 
https://lists.openembedded.org/g/openembedded-core/message/139406
Mute This Topic: https://lists.openembedded.org/mt/74802465/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub  
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to