summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorAndrey Zhizhikin <andrey.z@gmail.com>2020-09-14 23:31:59 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-09-17 09:47:45 +0100
commite08adbd180ba61caf8985a7f65dc01ac117ec586 (patch)
treea2da448b4b8b86078e5623650b7e73e5839320f2 /meta
parentc433641a052045a81b7aa08e57adfb742d1c751c (diff)
downloadpoky-e08adbd180ba61caf8985a7f65dc01ac117ec586.tar.gz
insane: check for missing update-alternatives inherit
Add a package QA check to test if the recipe sets ALTERNATIVE variable for any of its packages, and does not inherit update-alternatives class. This causes the do_rootfs to fail since a proper alternative cannot be created. (From OE-Core rev: 24b5ccc76d5660fac38ac5346666380a0ecce359) Signed-off-by: Andrey Zhizhikin <andrey.z@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/insane.bbclass9
1 files changed, 9 insertions, 0 deletions
diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
index c38720afdb..c6dff9659c 100644
--- a/meta/classes/insane.bbclass
+++ b/meta/classes/insane.bbclass
@@ -27,6 +27,7 @@ WARN_QA ?= " libdir xorg-driver-abi \
27 infodir build-deps src-uri-bad symlink-to-sysroot multilib \ 27 infodir build-deps src-uri-bad symlink-to-sysroot multilib \
28 invalid-packageconfig host-user-contaminated uppercase-pn patch-fuzz \ 28 invalid-packageconfig host-user-contaminated uppercase-pn patch-fuzz \
29 mime mime-xdg unlisted-pkg-lics unhandled-features-check \ 29 mime mime-xdg unlisted-pkg-lics unhandled-features-check \
30 missing-update-alternatives \
30 " 31 "
31ERROR_QA ?= "dev-so debug-deps dev-deps debug-files arch pkgconfig la \ 32ERROR_QA ?= "dev-so debug-deps dev-deps debug-files arch pkgconfig la \
32 perms dep-cmp pkgvarcheck perm-config perm-line perm-link \ 33 perms dep-cmp pkgvarcheck perm-config perm-line perm-link \
@@ -989,6 +990,14 @@ def package_qa_check_unhandled_features_check(pn, d, messages):
989 if var_set: 990 if var_set:
990 package_qa_handle_error("unhandled-features-check", "%s: recipe doesn't inherit features_check" % pn, d) 991 package_qa_handle_error("unhandled-features-check", "%s: recipe doesn't inherit features_check" % pn, d)
991 992
993QARECIPETEST[missing-update-alternatives] = "package_qa_check_missing_update_alternatives"
994def package_qa_check_missing_update_alternatives(pn, d, messages):
995 # Look at all packages and find out if any of those sets ALTERNATIVE variable
996 # without inheriting update-alternatives class
997 for pkg in (d.getVar('PACKAGES') or '').split():
998 if d.getVar('ALTERNATIVE_%s' % pkg) and not bb.data.inherits_class('update-alternatives', d):
999 package_qa_handle_error("missing-update-alternatives", "%s: recipe defines ALTERNATIVE_%s but doesn't inherit update-alternatives. This might fail during do_rootfs later!" % (pn, pkg), d)
1000
992# The PACKAGE FUNC to scan each package 1001# The PACKAGE FUNC to scan each package
993python do_package_qa () { 1002python do_package_qa () {
994 import subprocess 1003 import subprocess