diff options
Diffstat (limited to 'meta/classes/distro_features_check.bbclass')
-rw-r--r-- | meta/classes/distro_features_check.bbclass | 35 |
1 files changed, 5 insertions, 30 deletions
diff --git a/meta/classes/distro_features_check.bbclass b/meta/classes/distro_features_check.bbclass index eeaa3b44cb..8124a8ca27 100644 --- a/meta/classes/distro_features_check.bbclass +++ b/meta/classes/distro_features_check.bbclass | |||
@@ -1,32 +1,7 @@ | |||
1 | # Allow checking of required and conflicting DISTRO_FEATURES | 1 | # Temporarily provide fallback to the old name of the class |
2 | # | ||
3 | # ANY_OF_DISTRO_FEATURES: ensure at least one item on this list is included | ||
4 | # in DISTRO_FEATURES. | ||
5 | # REQUIRED_DISTRO_FEATURES: ensure every item on this list is included | ||
6 | # in DISTRO_FEATURES. | ||
7 | # CONFLICT_DISTRO_FEATURES: ensure no item in this list is included in | ||
8 | # DISTRO_FEATURES. | ||
9 | # | ||
10 | # Copyright 2013 (C) O.S. Systems Software LTDA. | ||
11 | 2 | ||
12 | python () { | 3 | python __anonymous() { |
13 | # Assume at least one var is set. | 4 | bb.warn("distro_features_check.bbclass is deprecated, please use features_check.bbclass instead") |
14 | distro_features = set((d.getVar('DISTRO_FEATURES') or '').split()) | ||
15 | |||
16 | any_of_distro_features = set((d.getVar('ANY_OF_DISTRO_FEATURES') or '').split()) | ||
17 | if any_of_distro_features: | ||
18 | if set.isdisjoint(any_of_distro_features, distro_features): | ||
19 | raise bb.parse.SkipRecipe("one of '%s' needs to be in DISTRO_FEATURES" % ' '.join(any_of_distro_features)) | ||
20 | |||
21 | required_distro_features = set((d.getVar('REQUIRED_DISTRO_FEATURES') or '').split()) | ||
22 | if required_distro_features: | ||
23 | missing = set.difference(required_distro_features, distro_features) | ||
24 | if missing: | ||
25 | raise bb.parse.SkipRecipe("missing required distro feature%s '%s' (not in DISTRO_FEATURES)" % ('s' if len(missing) > 1 else '', ' '.join(missing))) | ||
26 | |||
27 | conflict_distro_features = set((d.getVar('CONFLICT_DISTRO_FEATURES') or '').split()) | ||
28 | if conflict_distro_features: | ||
29 | conflicts = set.intersection(conflict_distro_features, distro_features) | ||
30 | if conflicts: | ||
31 | raise bb.parse.SkipRecipe("conflicting distro feature%s '%s' (in DISTRO_FEATURES)" % ('s' if len(conflicts) > 1 else '', ' '.join(conflicts))) | ||
32 | } | 5 | } |
6 | |||
7 | inherit features_check | ||