From d6449581c998a24145e527c571b3baf90a9f2518 Mon Sep 17 00:00:00 2001 From: Saul Wold Date: Wed, 23 Feb 2022 17:26:59 -0800 Subject: base/license: Rework INCOMPATIBLE_LICENSE variable handling This re-writes the INCOMPATIBLE_LICENSE checking code to replace the WHITELIST_ with INCOMPATIBLE_LICENSE_EXCEPTIONS = ': : ...' 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. (From OE-Core rev: 0d19c45ba6cf43518f380ca5afe9753a2eda0691) Signed-off-by: Saul Wold Signed-off-by: Richard Purdie --- meta/lib/oe/license.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'meta/lib/oe/license.py') 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] -- cgit v1.2.3-54-g00ecf