This add support to list required/confliting distro features for a recipe; this avoids user mistake when building recipes/images which would not work depending on DISTRO_FEATURES option set. Adding: ,----[ Use example ] | inherit distro_features_check | | REQUIRED_DISTRO_FEATURES = "x11" | CONFLICT_DISTRO_FEATURES_mx6 = "wayland" `---- In the image recipe allow us to make clear to user that this image needs X11 and /cannot/ be build with Wayland support in i.MX6 platforms, for example. (From OE-Core rev: a7519be6a23869ebafbf712370dab86ab92f68a5) Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
29 lines
1.3 KiB
Text
29 lines
1.3 KiB
Text
# Allow checking of required and conflicting 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.
|
|
|
|
python () {
|
|
required_distro_features = d.getVar('REQUIRED_DISTRO_FEATURES', True)
|
|
if required_distro_features:
|
|
required_distro_features = required_distro_features.split()
|
|
distro_features = (d.getVar('DISTRO_FEATURES', True) or "").split()
|
|
for f in required_distro_features:
|
|
if f in distro_features:
|
|
break
|
|
else:
|
|
raise bb.parse.SkipPackage("missing required distro feature %s (not in DISTRO_FEATURES)" % required_distro_features)
|
|
|
|
conflict_distro_features = d.getVar('CONFLICT_DISTRO_FEATURES', True)
|
|
if conflict_distro_features:
|
|
conflict_distro_features = conflict_distro_features.split()
|
|
distro_features = (d.getVar('DISTRO_FEATURES', True) or "").split()
|
|
for f in conflict_distro_features:
|
|
if f in distro_features:
|
|
raise bb.parse.SkipPackage("conflicting distro feature %s (in DISTRO_FEATURES)" % conflict_distro_features)
|
|
}
|