summaryrefslogtreecommitdiffstats
path: root/meta/classes/features_check.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2022-08-10 14:35:29 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-08-12 15:26:52 +0100
commitf5c128008365e141082c129417eb72d2751e8045 (patch)
treef5d969302d73813c56d3f871d456173ef63fe9a6 /meta/classes/features_check.bbclass
parent7c6c717a54423480c0ac9ed13861e3c1cc47e2b2 (diff)
downloadopenembedded-core-f5c128008365e141082c129417eb72d2751e8045.tar.gz
classes: Update classes to match new bitbake class scope functionality
Move classes to classes-global or classes-recipe as appropriate to take advantage of new bitbake functionality to check class scope/usage. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/features_check.bbclass')
-rw-r--r--meta/classes/features_check.bbclass57
1 files changed, 0 insertions, 57 deletions
diff --git a/meta/classes/features_check.bbclass b/meta/classes/features_check.bbclass
deleted file mode 100644
index 163a7bc3fc..0000000000
--- a/meta/classes/features_check.bbclass
+++ /dev/null
@@ -1,57 +0,0 @@
-# Allow checking of required and conflicting features
-#
-# xxx = [DISTRO,MACHINE,COMBINED,IMAGE]
-#
-# ANY_OF_xxx_FEATURES: ensure at least one item on this list is included
-# in xxx_FEATURES.
-# REQUIRED_xxx_FEATURES: ensure every item on this list is included
-# in xxx_FEATURES.
-# CONFLICT_xxx_FEATURES: ensure no item in this list is included in
-# xxx_FEATURES.
-#
-# Copyright 2019 (C) Texas Instruments Inc.
-# Copyright 2013 (C) O.S. Systems Software LTDA.
-#
-# SPDX-License-Identifier: MIT
-
-
-python () {
- if d.getVar('PARSE_ALL_RECIPES', False):
- return
-
- unused = True
-
- for kind in ['DISTRO', 'MACHINE', 'COMBINED', 'IMAGE']:
- if d.getVar('ANY_OF_' + kind + '_FEATURES') is None and not d.hasOverrides('ANY_OF_' + kind + '_FEATURES') and \
- d.getVar('REQUIRED_' + kind + '_FEATURES') is None and not d.hasOverrides('REQUIRED_' + kind + '_FEATURES') and \
- d.getVar('CONFLICT_' + kind + '_FEATURES') is None and not d.hasOverrides('CONFLICT_' + kind + '_FEATURES'):
- continue
-
- unused = False
-
- # Assume at least one var is set.
- features = set((d.getVar(kind + '_FEATURES') or '').split())
-
- any_of_features = set((d.getVar('ANY_OF_' + kind + '_FEATURES') or '').split())
- if any_of_features:
- if set.isdisjoint(any_of_features, features):
- raise bb.parse.SkipRecipe("one of '%s' needs to be in %s_FEATURES"
- % (' '.join(any_of_features), kind))
-
- required_features = set((d.getVar('REQUIRED_' + kind + '_FEATURES') or '').split())
- if required_features:
- missing = set.difference(required_features, features)
- if missing:
- raise bb.parse.SkipRecipe("missing required %s feature%s '%s' (not in %s_FEATURES)"
- % (kind.lower(), 's' if len(missing) > 1 else '', ' '.join(missing), kind))
-
- conflict_features = set((d.getVar('CONFLICT_' + kind + '_FEATURES') or '').split())
- if conflict_features:
- conflicts = set.intersection(conflict_features, features)
- 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")
-}