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.

(From OE-Core rev: 0d19c45ba6cf43518f380ca5afe9753a2eda0691)

Signed-off-by: Saul Wold <saul.wold@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Saul Wold
2022-02-23 17:26:59 -08:00
committed by Richard Purdie
parent 9ead8e762e
commit d6449581c9
6 changed files with 61 additions and 61 deletions

View File

@@ -75,12 +75,12 @@ python multilib_virtclass_handler () {
e.data.setVar("PN", variant + "-" + e.data.getVar("PN", False))
e.data.setVar("OVERRIDES", e.data.getVar("OVERRIDES", False) + override)
# Expand WHITELIST_GPL-3.0 with multilib prefix
pkgs = e.data.getVar("WHITELIST_GPL-3.0")
# Expand INCOMPATIBLE_LICENSE_EXCEPTIONS with multilib prefix
pkgs = e.data.getVar("INCOMPATIBLE_LICENSE_EXCEPTIONS")
if pkgs:
for pkg in pkgs.split():
pkgs += " " + variant + "-" + pkg
e.data.setVar("WHITELIST_GPL-3.0", pkgs)
e.data.setVar("INCOMPATIBLE_LICENSE_EXCEPTIONS", pkgs)
# DEFAULTTUNE can change TARGET_ARCH override so expand this now before update_data
newtune = e.data.getVar("DEFAULTTUNE:" + "virtclass-multilib-" + variant, False)