summaryrefslogtreecommitdiffstats
path: root/meta/classes/insane.bbclass
diff options
context:
space:
mode:
authorQuentin Schulz <quentin.schulz@streamunlimited.com>2020-04-20 22:13:29 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-05-21 10:52:07 +0100
commitfa7b29e22bf9b92c4bb0cf5e884b25e4ae223c0d (patch)
treedd5036d27a98bd13c753fd44c4ba4d79046e7fa8 /meta/classes/insane.bbclass
parent6cb7107d862a086eb209b2ac41249ea73e3d9c56 (diff)
downloadpoky-fa7b29e22bf9b92c4bb0cf5e884b25e4ae223c0d.tar.gz
base/insane: Check pkgs lics are subset of recipe lics only once
Move logic checking that all packages licenses are only a subset of recipe licenses from base.bbclass to the insane.bbclass so that it's evaluated only once, during do_package_qa. As explained in the linked bugzilla entry, if a package license is not part of the recipe license, the warning message gets shown an unreasonable amount of time because it's evaluated every time a recipe is parsed. [YOCTO #10130] This also makes it possible to silence this error with INSANE_SKIP. (From OE-Core rev: 852408ed4be1f64c57e196688728b7ed223d3493) Signed-off-by: Quentin Schulz <quentin.schulz@streamunlimited.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/insane.bbclass')
-rw-r--r--meta/classes/insane.bbclass21
1 files changed, 20 insertions, 1 deletions
diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
index 8b19f445f9..b7c613880b 100644
--- a/meta/classes/insane.bbclass
+++ b/meta/classes/insane.bbclass
@@ -26,7 +26,7 @@ WARN_QA ?= " libdir xorg-driver-abi \
26 textrel incompatible-license files-invalid \ 26 textrel incompatible-license files-invalid \
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 \ 29 mime mime-xdg unlisted-pkg-lics \
30 " 30 "
31ERROR_QA ?= "dev-so debug-deps dev-deps debug-files arch pkgconfig la \ 31ERROR_QA ?= "dev-so debug-deps dev-deps debug-files arch pkgconfig la \
32 perms dep-cmp pkgvarcheck perm-config perm-line perm-link \ 32 perms dep-cmp pkgvarcheck perm-config perm-line perm-link \
@@ -898,6 +898,25 @@ def package_qa_check_expanded_d(package, d, messages):
898 sane = False 898 sane = False
899 return sane 899 return sane
900 900
901QAPKGTEST[unlisted-pkg-lics] = "package_qa_check_unlisted_pkg_lics"
902def package_qa_check_unlisted_pkg_lics(package, d, messages):
903 """
904 Check that all licenses for a package are among the licenses for the recipe.
905 """
906 pkg_lics = d.getVar('LICENSE_' + package)
907 if not pkg_lics:
908 return True
909
910 recipe_lics_set = oe.license.list_licenses(d.getVar('LICENSE'))
911 unlisted = oe.license.list_licenses(pkg_lics) - recipe_lics_set
912 if not unlisted:
913 return True
914
915 package_qa_add_message(messages, "unlisted-pkg-lics",
916 "LICENSE_%s includes licenses (%s) that are not "
917 "listed in LICENSE" % (package, ' '.join(unlisted)))
918 return False
919
901def package_qa_check_encoding(keys, encode, d): 920def package_qa_check_encoding(keys, encode, d):
902 def check_encoding(key, enc): 921 def check_encoding(key, enc):
903 sane = True 922 sane = True