diff options
author | Kai Kang <kai.kang@windriver.com> | 2018-12-06 21:41:39 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-01-11 10:39:09 +0000 |
commit | 24d8aa6ec2d439c35a217bc3d021b37e0ddcdd8d (patch) | |
tree | 08778acd8d65870499802b74741b61af2ce95b19 /meta/classes/distro_features_check.bbclass | |
parent | 9c8b3aa20618e60bd1ec2ad369e8f4781a645972 (diff) | |
download | poky-24d8aa6ec2d439c35a217bc3d021b37e0ddcdd8d.tar.gz |
distro_features_check.bbclass: show all error info at one time
In distro_features_check.bbclass it checks whether items in
REQUIRED_DISTRO_FEATURES and CONFLICT_DISTRO_FEATURES exist in
DISTRO_FEATURES. But it only shows one required or conflict distro
feature when error occurs. Update to show them all at one time.
(From OE-Core rev: d0441c40afdba119a65189d6a5aca5c533f68279)
Signed-off-by: Kai Kang <kai.kang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/distro_features_check.bbclass')
-rw-r--r-- | meta/classes/distro_features_check.bbclass | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/meta/classes/distro_features_check.bbclass b/meta/classes/distro_features_check.bbclass index 9b78b03ef6..eeaa3b44cb 100644 --- a/meta/classes/distro_features_check.bbclass +++ b/meta/classes/distro_features_check.bbclass | |||
@@ -11,27 +11,22 @@ | |||
11 | 11 | ||
12 | python () { | 12 | python () { |
13 | # Assume at least one var is set. | 13 | # Assume at least one var is set. |
14 | distro_features = (d.getVar('DISTRO_FEATURES') or "").split() | 14 | distro_features = set((d.getVar('DISTRO_FEATURES') or '').split()) |
15 | 15 | ||
16 | any_of_distro_features = d.getVar('ANY_OF_DISTRO_FEATURES') | 16 | any_of_distro_features = set((d.getVar('ANY_OF_DISTRO_FEATURES') or '').split()) |
17 | if any_of_distro_features: | 17 | if any_of_distro_features: |
18 | any_of_distro_features = any_of_distro_features.split() | 18 | if set.isdisjoint(any_of_distro_features, distro_features): |
19 | if set.isdisjoint(set(any_of_distro_features),set(distro_features)): | 19 | raise bb.parse.SkipRecipe("one of '%s' needs to be in DISTRO_FEATURES" % ' '.join(any_of_distro_features)) |
20 | raise bb.parse.SkipRecipe("one of '%s' needs to be in DISTRO_FEATURES" % any_of_distro_features) | ||
21 | 20 | ||
22 | required_distro_features = d.getVar('REQUIRED_DISTRO_FEATURES') | 21 | required_distro_features = set((d.getVar('REQUIRED_DISTRO_FEATURES') or '').split()) |
23 | if required_distro_features: | 22 | if required_distro_features: |
24 | required_distro_features = required_distro_features.split() | 23 | missing = set.difference(required_distro_features, distro_features) |
25 | for f in required_distro_features: | 24 | if missing: |
26 | if f in distro_features: | 25 | raise bb.parse.SkipRecipe("missing required distro feature%s '%s' (not in DISTRO_FEATURES)" % ('s' if len(missing) > 1 else '', ' '.join(missing))) |
27 | continue | ||
28 | else: | ||
29 | raise bb.parse.SkipRecipe("missing required distro feature '%s' (not in DISTRO_FEATURES)" % f) | ||
30 | 26 | ||
31 | conflict_distro_features = d.getVar('CONFLICT_DISTRO_FEATURES') | 27 | conflict_distro_features = set((d.getVar('CONFLICT_DISTRO_FEATURES') or '').split()) |
32 | if conflict_distro_features: | 28 | if conflict_distro_features: |
33 | conflict_distro_features = conflict_distro_features.split() | 29 | conflicts = set.intersection(conflict_distro_features, distro_features) |
34 | for f in conflict_distro_features: | 30 | if conflicts: |
35 | if f in distro_features: | 31 | raise bb.parse.SkipRecipe("conflicting distro feature%s '%s' (in DISTRO_FEATURES)" % ('s' if len(conflicts) > 1 else '', ' '.join(conflicts))) |
36 | raise bb.parse.SkipRecipe("conflicting distro feature '%s' (in DISTRO_FEATURES)" % f) | ||
37 | } | 32 | } |