1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-30 00:20:08 +00:00

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>
This commit is contained in:
Quentin Schulz
2020-04-20 22:13:29 +02:00
committed by Richard Purdie
parent 6cb7107d86
commit fa7b29e22b
2 changed files with 20 additions and 14 deletions
+20 -1
View File
@@ -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 \
mime mime-xdg unlisted-pkg-lics \
"
ERROR_QA ?= "dev-so debug-deps dev-deps debug-files arch pkgconfig la \
perms dep-cmp pkgvarcheck perm-config perm-line perm-link \
@@ -898,6 +898,25 @@ def package_qa_check_expanded_d(package, d, messages):
sane = False
return sane
QAPKGTEST[unlisted-pkg-lics] = "package_qa_check_unlisted_pkg_lics"
def package_qa_check_unlisted_pkg_lics(package, d, messages):
"""
Check that all licenses for a package are among the licenses for the recipe.
"""
pkg_lics = d.getVar('LICENSE_' + package)
if not pkg_lics:
return True
recipe_lics_set = oe.license.list_licenses(d.getVar('LICENSE'))
unlisted = oe.license.list_licenses(pkg_lics) - recipe_lics_set
if not unlisted:
return True
package_qa_add_message(messages, "unlisted-pkg-lics",
"LICENSE_%s includes licenses (%s) that are not "
"listed in LICENSE" % (package, ' '.join(unlisted)))
return False
def package_qa_check_encoding(keys, encode, d):
def check_encoding(key, enc):
sane = True