summaryrefslogtreecommitdiffstats
path: root/meta/lib/oe/license.py
diff options
context:
space:
mode:
authorSaul Wold <Saul.Wold@windriver.com>2022-02-23 17:26:59 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-03-02 18:41:52 +0000
commit0d19c45ba6cf43518f380ca5afe9753a2eda0691 (patch)
tree2cca34691730b708ee46dfc85fd1eb74814823f4 /meta/lib/oe/license.py
parent6f2d85a7b7d94101f2ce67115166fa86c185650f (diff)
downloadopenembedded-core-0d19c45ba6cf43518f380ca5afe9753a2eda0691.tar.gz
base/license: Rework INCOMPATIBLE_LICENSE variable handling
This re-writes the INCOMPATIBLE_LICENSE checking code to replace the WHITELIST_<lic> with INCOMPATIBLE_LICENSE_EXCEPTIONS = '<pkg>:<lic> <pkg>:<lic> ...' This initial change leaves most of the code structure in place, but the code in base.bbclass needs to be re-written to make the check more consistent around packages (PKGS) and not recipe names (PN). This also is taking into account the changes for SPDX licenses. The aim is to provide a mode consistent variable where the variable name is known and can easily be queried. Signed-off-by: Saul Wold <saul.wold@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oe/license.py')
-rw-r--r--meta/lib/oe/license.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/meta/lib/oe/license.py b/meta/lib/oe/license.py
index 8955cbdeb2..29412dfe46 100644
--- a/meta/lib/oe/license.py
+++ b/meta/lib/oe/license.py
@@ -242,3 +242,8 @@ def list_licenses(licensestr):
except SyntaxError as exc:
raise LicenseSyntaxError(licensestr, exc)
return visitor.licenses
+
+def apply_pkg_license_exception(pkg, bad_licenses, exceptions):
+ """Return remaining bad licenses after removing any package exceptions"""
+
+ return [lic for lic in bad_licenses if pkg + ':' + lic not in exceptions]