mirror of
https://git.yoctoproject.org/poky
synced 2026-05-30 00:20:08 +00:00
distro_features_check: expand with MACHINE_FEATURES and COMBINED_FEATURES, rename
Besides checking DISTRO_FEATURES for required or conflicting features, being able to check MACHINE_FEATURES and/or COMBINED_FEATURES may also be useful at times. Temporarily support the old class name with a warning about future deprecation. (From OE-Core rev: 5f4875b950ce199e91f99c8e945a0c709166dc14) Signed-off-by: Denys Dmytriyenko <denys@ti.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
a616ffebdc
commit
9702544b3e
@@ -1,32 +1,7 @@
|
||||
# Allow checking of required and conflicting DISTRO_FEATURES
|
||||
#
|
||||
# ANY_OF_DISTRO_FEATURES: ensure at least one item on this list is included
|
||||
# in DISTRO_FEATURES.
|
||||
# REQUIRED_DISTRO_FEATURES: ensure every item on this list is included
|
||||
# in DISTRO_FEATURES.
|
||||
# CONFLICT_DISTRO_FEATURES: ensure no item in this list is included in
|
||||
# DISTRO_FEATURES.
|
||||
#
|
||||
# Copyright 2013 (C) O.S. Systems Software LTDA.
|
||||
# Temporarily provide fallback to the old name of the class
|
||||
|
||||
python () {
|
||||
# Assume at least one var is set.
|
||||
distro_features = set((d.getVar('DISTRO_FEATURES') or '').split())
|
||||
|
||||
any_of_distro_features = set((d.getVar('ANY_OF_DISTRO_FEATURES') or '').split())
|
||||
if any_of_distro_features:
|
||||
if set.isdisjoint(any_of_distro_features, distro_features):
|
||||
raise bb.parse.SkipRecipe("one of '%s' needs to be in DISTRO_FEATURES" % ' '.join(any_of_distro_features))
|
||||
|
||||
required_distro_features = set((d.getVar('REQUIRED_DISTRO_FEATURES') or '').split())
|
||||
if required_distro_features:
|
||||
missing = set.difference(required_distro_features, distro_features)
|
||||
if missing:
|
||||
raise bb.parse.SkipRecipe("missing required distro feature%s '%s' (not in DISTRO_FEATURES)" % ('s' if len(missing) > 1 else '', ' '.join(missing)))
|
||||
|
||||
conflict_distro_features = set((d.getVar('CONFLICT_DISTRO_FEATURES') or '').split())
|
||||
if conflict_distro_features:
|
||||
conflicts = set.intersection(conflict_distro_features, distro_features)
|
||||
if conflicts:
|
||||
raise bb.parse.SkipRecipe("conflicting distro feature%s '%s' (in DISTRO_FEATURES)" % ('s' if len(conflicts) > 1 else '', ' '.join(conflicts)))
|
||||
python __anonymous() {
|
||||
bb.warn("distro_features_check.bbclass is deprecated, please use features_check.bbclass instead")
|
||||
}
|
||||
|
||||
inherit features_check
|
||||
|
||||
Reference in New Issue
Block a user