mirror of
https://git.yoctoproject.org/poky
synced 2026-05-30 00:20:08 +00:00
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>
This commit is contained in:
@@ -11,27 +11,22 @@
|
|||||||
|
|
||||||
python () {
|
python () {
|
||||||
# Assume at least one var is set.
|
# Assume at least one var is set.
|
||||||
distro_features = (d.getVar('DISTRO_FEATURES') or "").split()
|
distro_features = set((d.getVar('DISTRO_FEATURES') or '').split())
|
||||||
|
|
||||||
any_of_distro_features = d.getVar('ANY_OF_DISTRO_FEATURES')
|
any_of_distro_features = set((d.getVar('ANY_OF_DISTRO_FEATURES') or '').split())
|
||||||
if any_of_distro_features:
|
if any_of_distro_features:
|
||||||
any_of_distro_features = any_of_distro_features.split()
|
if set.isdisjoint(any_of_distro_features, distro_features):
|
||||||
if set.isdisjoint(set(any_of_distro_features),set(distro_features)):
|
raise bb.parse.SkipRecipe("one of '%s' needs to be in DISTRO_FEATURES" % ' '.join(any_of_distro_features))
|
||||||
raise bb.parse.SkipRecipe("one of '%s' needs to be in DISTRO_FEATURES" % any_of_distro_features)
|
|
||||||
|
|
||||||
required_distro_features = d.getVar('REQUIRED_DISTRO_FEATURES')
|
required_distro_features = set((d.getVar('REQUIRED_DISTRO_FEATURES') or '').split())
|
||||||
if required_distro_features:
|
if required_distro_features:
|
||||||
required_distro_features = required_distro_features.split()
|
missing = set.difference(required_distro_features, distro_features)
|
||||||
for f in required_distro_features:
|
if missing:
|
||||||
if f in distro_features:
|
raise bb.parse.SkipRecipe("missing required distro feature%s '%s' (not in DISTRO_FEATURES)" % ('s' if len(missing) > 1 else '', ' '.join(missing)))
|
||||||
continue
|
|
||||||
else:
|
|
||||||
raise bb.parse.SkipRecipe("missing required distro feature '%s' (not in DISTRO_FEATURES)" % f)
|
|
||||||
|
|
||||||
conflict_distro_features = d.getVar('CONFLICT_DISTRO_FEATURES')
|
conflict_distro_features = set((d.getVar('CONFLICT_DISTRO_FEATURES') or '').split())
|
||||||
if conflict_distro_features:
|
if conflict_distro_features:
|
||||||
conflict_distro_features = conflict_distro_features.split()
|
conflicts = set.intersection(conflict_distro_features, distro_features)
|
||||||
for f in conflict_distro_features:
|
if conflicts:
|
||||||
if f in distro_features:
|
raise bb.parse.SkipRecipe("conflicting distro feature%s '%s' (in DISTRO_FEATURES)" % ('s' if len(conflicts) > 1 else '', ' '.join(conflicts)))
|
||||||
raise bb.parse.SkipRecipe("conflicting distro feature '%s' (in DISTRO_FEATURES)" % f)
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user