summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Müller-Klieser <s.mueller-klieser@phytec.de>2015-11-06 14:21:44 (GMT)
committerStefan Müller-Klieser <s.mueller-klieser@phytec.de>2015-11-09 08:55:11 (GMT)
commitc7319728813a89df24066e6c0817dcc56c413fb4 (patch)
tree2a2c8020edfad7e56b317906683306f0c5ae1dc5
parentb02a1d6600137eb8147bd3deea043a8e89e62208 (diff)
downloadmeta-phytec-c7319728813a89df24066e6c0817dcc56c413fb4.zip
meta-phytec-c7319728813a89df24066e6c0817dcc56c413fb4.tar.bz2
tune_features_check.bbclass: Add class
This class can be used by recipes pulling binaries into the rootfs which have been compiled outside of the build. Two variables are provided: REQUIRED_TUNE_FEATURES and CONFLICT_TUNE_FEATURES Those can be used to check for basic ABI mismatches. For ABI compatibility a lot more requirements must be met. QA sanity tests can provide some information. The code is based on distro_features_check.bbclass. Signed-off-by: Stefan Müller-Klieser <s.mueller-klieser@phytec.de>
-rw-r--r--classes/tune_features_check.bbclass26
1 files changed, 26 insertions, 0 deletions
diff --git a/classes/tune_features_check.bbclass b/classes/tune_features_check.bbclass
new file mode 100644
index 0000000..2ac4958
--- /dev/null
+++ b/classes/tune_features_check.bbclass
@@ -0,0 +1,26 @@
+# Allow checking of required and conflicting TUNE_FEATURES
+#
+# REQUIRED_TUNE_FEATURES: ensure every item on this list is included
+# in TUNE_FEATURES.
+# CONFLICT_TUNE_FEATURES: ensure no item in this list is included in
+# TUNE_FEATURES.
+
+python () {
+ required_tune_features = d.getVar('REQUIRED_TUNE_FEATURES', True)
+ if required_tune_features:
+ required_tune_features = required_tune_features.split()
+ tune_features = (d.getVar('TUNE_FEATURES', True) or "").split()
+ for f in required_tune_features:
+ if f in tune_features:
+ continue
+ else:
+ raise bb.parse.SkipPackage("missing required tune feature '%s' (not in TUNE_FEATURES)" % f)
+
+ conflict_tune_features = d.getVar('CONFLICT_TUNE_FEATURES', True)
+ if conflict_tune_features:
+ conflict_tune_features = conflict_tune_features.split()
+ tune_features = (d.getVar('TUNE_FEATURES', True) or "").split()
+ for f in conflict_tune_features:
+ if f in tune_features:
+ raise bb.parse.SkipPackage("conflicting tune feature '%s' (in TUNE_FEATURES)" % f)
+}