aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJacob Kroon <jacob.kroon@gmail.com>2020-06-10 19:52:45 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-06-12 08:25:00 +0100
commitc06489d102682504afe33f9fee3facd9628b3f57 (patch)
tree42feb083703577aef12b3f57a3e33ea4aafd0023
parent56c1fe3bc89af86a2524ed5b724fe74ba514acc5 (diff)
downloadopenembedded-core-contrib-c06489d102682504afe33f9fee3facd9628b3f57.tar.gz
openembedded-core-contrib-c06489d102682504afe33f9fee3facd9628b3f57.tar.bz2
openembedded-core-contrib-c06489d102682504afe33f9fee3facd9628b3f57.zip
insane: Check for feature check variables not being used
Add a package QA check for wether any of the variables used by features_check.bbclass is set while not inheriting the class itself. Signed-off-by: Jacob Kroon <jacob.kroon@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/insane.bbclass12
1 files changed, 11 insertions, 1 deletions
diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
index b7c613880b1..649aea1da19 100644
--- a/meta/classes/insane.bbclass
+++ b/meta/classes/insane.bbclass
@@ -26,7 +26,7 @@ WARN_QA ?= " libdir xorg-driver-abi \
textrel incompatible-license files-invalid \
infodir build-deps src-uri-bad symlink-to-sysroot multilib \
invalid-packageconfig host-user-contaminated uppercase-pn patch-fuzz \
- mime mime-xdg unlisted-pkg-lics \
+ mime mime-xdg unlisted-pkg-lics unhandled-features-check \
"
ERROR_QA ?= "dev-so debug-deps dev-deps debug-files arch pkgconfig la \
perms dep-cmp pkgvarcheck perm-config perm-line perm-link \
@@ -980,6 +980,16 @@ def package_qa_check_src_uri(pn, d, messages):
if re.search(r"github\.com/.+/.+/archive/.+", url):
package_qa_handle_error("src-uri-bad", "%s: SRC_URI uses unstable GitHub archives" % pn, d)
+QARECIPETEST[unhandled-features-check] = "package_qa_check_unhandled_features_check"
+def package_qa_check_unhandled_features_check(pn, d, messages):
+ if not bb.data.inherits_class('features_check', d):
+ var_set = False
+ for kind in ['DISTRO', 'MACHINE', 'COMBINED']:
+ for var in ['ANY_OF_' + kind + '_FEATURES', 'REQUIRED_' + kind + '_FEATURES', 'CONFLICT_' + kind + '_FEATURES']:
+ if d.getVar(var) is not None or d.overridedata.get(var) is not None:
+ var_set = True
+ if var_set:
+ package_qa_handle_error("unhandled-features-check", "%s: recipe doesn't inherit features_check" % pn, d)
# The PACKAGE FUNC to scan each package
python do_package_qa () {