aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJacob Kroon <jacob.kroon@gmail.com>2020-06-10 19:52:43 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-06-12 08:25:00 +0100
commit56c1fe3bc89af86a2524ed5b724fe74ba514acc5 (patch)
tree6197651098b5c83e86f823108f42ea821057a915
parente5591eb5165b1b7287a12928e2b179ae2b5ce5d6 (diff)
downloadopenembedded-core-contrib-56c1fe3bc89af86a2524ed5b724fe74ba514acc5.tar.gz
openembedded-core-contrib-56c1fe3bc89af86a2524ed5b724fe74ba514acc5.tar.bz2
openembedded-core-contrib-56c1fe3bc89af86a2524ed5b724fe74ba514acc5.zip
features_check: Warn if not used
Signed-off-by: Jacob Kroon <jacob.kroon@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/features_check.bbclass15
1 files changed, 15 insertions, 0 deletions
diff --git a/meta/classes/features_check.bbclass b/meta/classes/features_check.bbclass
index 4ba827d4aba..b3c8047861f 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")
}