Message ID | 20220216235233.575379-1-saul.wold@windriver.com |
---|---|
State | New |
Headers | show |
Series | [RFC] Rename INCOMPATIBLE related varibale | expand |
On Wed, 2022-02-16 at 15:52 -0800, Saul Wold wrote: > This is one option to handle the rename, another alternative would > be to change the new INCOMPATIBLE_LICENSE_ALLOWED_RECIPES to VarFlag > style. It is one option but I'm not sure it makes sense. This functionality is a bit of a historical relic and the syntax is absolutely horrible. If we're going to change it, I'd like to take the opportunity to step back and fix it somehow. I've not spent the time thinking what that might look like unfortunately. Cheers, Richard
> -----Original Message----- > From: openembedded-core@lists.openembedded.org <openembedded- > core@lists.openembedded.org> On Behalf Of Richard Purdie > Sent: den 17 februari 2022 11:44 > To: Saul Wold <Saul.Wold@windriver.com>; openembedded- > core@lists.openembedded.org > Subject: Re: [OE-core] [RFC PATCH] Rename INCOMPATIBLE related varibale > > On Wed, 2022-02-16 at 15:52 -0800, Saul Wold wrote: > > This is one option to handle the rename, another alternative would > > be to change the new INCOMPATIBLE_LICENSE_ALLOWED_RECIPES to VarFlag > > style. > > It is one option but I'm not sure it makes sense. This functionality > is a bit of a historical relic and the syntax is absolutely horrible. > If we're going to change it, I'd like to take the opportunity to step > back and fix it somehow. I've not spent the time thinking what that > might look like unfortunately. > > Cheers, > > Richard I definitely agree that the system for handling compatible/incompatible licenses need to be reworked. I sent a longish response to Jon's mail on the yocto list January 29 where I discussed this. //Peter
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass index 87a4cb5fc7..a376dfa134 100644 --- a/meta/classes/base.bbclass +++ b/meta/classes/base.bbclass @@ -598,9 +598,9 @@ python () { whitelist = [] for lic in bad_licenses: spdx_license = return_spdx(d, lic) - whitelist.extend((d.getVar("WHITELIST_" + lic) or "").split()) + whitelist.extend((d.getVar("INCOMPATIBLE_LICENSE_ALLOWED_RECIPE_" + lic) or "").split()) if spdx_license: - whitelist.extend((d.getVar("WHITELIST_" + spdx_license) or "").split()) + whitelist.extend((d.getVar("INCOMPATIBLE_LICENSE_ALLOWED_RECIPE_" + spdx_license) or "").split()) if pn in whitelist: ''' diff --git a/meta/classes/license_image.bbclass b/meta/classes/license_image.bbclass index bf70bee99b..701516d324 100644 --- a/meta/classes/license_image.bbclass +++ b/meta/classes/license_image.bbclass @@ -56,7 +56,7 @@ def write_license_files(d, license_manifest, pkg_dic, rootfs=True): whitelist = [] for lic in bad_licenses: - whitelist.extend((d.getVar("WHITELIST_" + lic) or "").split()) + whitelist.extend((d.getVar("INCOMPATIBLE_LICENSE_ALLOWED_RECIPE_" + lic) or "").split()) with open(license_manifest, "w") as license_file: for pkg in sorted(pkg_dic): diff --git a/meta/classes/multilib.bbclass b/meta/classes/multilib.bbclass index ec2013198c..278a88181a 100644 --- a/meta/classes/multilib.bbclass +++ b/meta/classes/multilib.bbclass @@ -75,11 +75,11 @@ 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_ALLOWED_RECIPE_GPL-3.0 with multilib prefix + pkgs = e.data.getVar("INCOMPATIBLE_LICENSE_ALLOWED_RECIPE_GPL-3.0") for pkg in pkgs.split(): pkgs += " " + variant + "-" + pkg - e.data.setVar("WHITELIST_GPL-3.0", pkgs) + e.data.setVar("INCOMPATIBLE_LICENSE_ALLOWED_RECIPE_GPL-3.0", pkgs) # DEFAULTTUNE can change TARGET_ARCH override so expand this now before update_data newtune = e.data.getVar("DEFAULTTUNE:" + "virtclass-multilib-" + variant, False) diff --git a/meta/conf/distro/include/default-distrovars.inc b/meta/conf/distro/include/default-distrovars.inc index 3bba651a77..7bfb946e67 100644 --- a/meta/conf/distro/include/default-distrovars.inc +++ b/meta/conf/distro/include/default-distrovars.inc @@ -20,7 +20,7 @@ DISTRO_FEATURES_DEFAULT ?= "acl alsa argp bluetooth debuginfod ext2 ipv4 ipv6 la DISTRO_FEATURES ?= "${DISTRO_FEATURES_DEFAULT}" IMAGE_FEATURES ?= "" -WHITELIST_GPL-3.0 ?= "" +INCOMPATIBLE_LICENSE_ALLOWED_RECIPE_GPL-3.0 ?= "" COMMERCIAL_AUDIO_PLUGINS ?= "" # COMMERCIAL_AUDIO_PLUGINS ?= "gst-plugins-ugly-mad gst-plugins-ugly-mpegaudioparse" diff --git a/meta/lib/oeqa/selftest/cases/incompatible_lic.py b/meta/lib/oeqa/selftest/cases/incompatible_lic.py index fd3b3f409e..52c381dba6 100644 --- a/meta/lib/oeqa/selftest/cases/incompatible_lic.py +++ b/meta/lib/oeqa/selftest/cases/incompatible_lic.py @@ -111,7 +111,7 @@ INCOMPATIBLE_LICENSE:pn-core-image-minimal = "GPL-3.0 LGPL-3.0" bitbake('core-image-minimal') def test_bash_whitelist(self): - self.write_config(self.default_config() + '\nWHITELIST_GPL-3.0:pn-core-image-minimal = "bash"') + self.write_config(self.default_config() + '\nINCOMPATIBLE_LICENSE_ALLOWED_RECIPE_GPL-3.0:pn-core-image-minimal = "bash"') bitbake('core-image-minimal')
This is one option to handle the rename, another alternative would be to change the new INCOMPATIBLE_LICENSE_ALLOWED_RECIPES to VarFlag style. Signed-off-by: Saul Wold <saul.wold@windriver.com> --- meta/classes/base.bbclass | 4 ++-- meta/classes/license_image.bbclass | 2 +- meta/classes/multilib.bbclass | 6 +++--- meta/conf/distro/include/default-distrovars.inc | 2 +- meta/lib/oeqa/selftest/cases/incompatible_lic.py | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-)