diff options
author | Jacob Kroon <jacob.kroon@gmail.com> | 2020-06-10 19:52:43 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-06-12 08:25:05 +0100 |
commit | 89d289ee85adbebf621619741b5fcd562ad9902d (patch) | |
tree | 243e8ae5dbfcc2ad3b416d7950dc5300d931342d /meta | |
parent | 7a4cc257a73a8c7d973144e667a9c73e268cc890 (diff) | |
download | poky-89d289ee85adbebf621619741b5fcd562ad9902d.tar.gz |
features_check: Warn if not used
(From OE-Core rev: 56c1fe3bc89af86a2524ed5b724fe74ba514acc5)
Signed-off-by: Jacob Kroon <jacob.kroon@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/classes/features_check.bbclass | 15 |
1 files changed, 15 insertions, 0 deletions
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 () { | |||
16 | if d.getVar('PARSE_ALL_RECIPES', False): | 16 | if d.getVar('PARSE_ALL_RECIPES', False): |
17 | return | 17 | return |
18 | 18 | ||
19 | unused = True | ||
20 | |||
19 | for kind in ['DISTRO', 'MACHINE', 'COMBINED']: | 21 | for kind in ['DISTRO', 'MACHINE', 'COMBINED']: |
22 | if d.getVar('ANY_OF_' + kind + '_FEATURES') is None and \ | ||
23 | d.overridedata.get('ANY_OF_' + kind + '_FEATURES') is None and \ | ||
24 | d.getVar('REQUIRED_' + kind + '_FEATURES') is None and \ | ||
25 | d.overridedata.get('REQUIRED_' + kind + '_FEATURES') is None and \ | ||
26 | d.getVar('CONFLICT_' + kind + '_FEATURES') is None and \ | ||
27 | d.overridedata.get('CONFLICT_' + kind + '_FEATURES') is None: | ||
28 | continue | ||
29 | |||
30 | unused = False | ||
31 | |||
20 | # Assume at least one var is set. | 32 | # Assume at least one var is set. |
21 | features = set((d.getVar(kind + '_FEATURES') or '').split()) | 33 | features = set((d.getVar(kind + '_FEATURES') or '').split()) |
22 | 34 | ||
@@ -39,4 +51,7 @@ python () { | |||
39 | if conflicts: | 51 | if conflicts: |
40 | raise bb.parse.SkipRecipe("conflicting %s feature%s '%s' (in %s_FEATURES)" | 52 | raise bb.parse.SkipRecipe("conflicting %s feature%s '%s' (in %s_FEATURES)" |
41 | % (kind.lower(), 's' if len(conflicts) > 1 else '', ' '.join(conflicts), kind)) | 53 | % (kind.lower(), 's' if len(conflicts) > 1 else '', ' '.join(conflicts), kind)) |
54 | |||
55 | if unused: | ||
56 | bb.warn("Recipe inherits features_check but doesn't use it") | ||
42 | } | 57 | } |