summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Kjellerstedt <peter.kjellerstedt@axis.com>2019-12-11 17:48:16 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-12-16 23:22:03 +0000
commit01dcc8c94b882d865fc72a067a90d9721ac5fea7 (patch)
tree72ee52674caf31a5ff0fe0b56b27b309346ecfc7
parent02a3189b4902e616f5b4277ee3d0fca10b73b4dc (diff)
downloadopenembedded-core-contrib-01dcc8c94b882d865fc72a067a90d9721ac5fea7.tar.gz
openembedded-core-contrib-01dcc8c94b882d865fc72a067a90d9721ac5fea7.tar.bz2
openembedded-core-contrib-01dcc8c94b882d865fc72a067a90d9721ac5fea7.zip
base.bbclass: Simplify the check for whitelisted licenses
After a number of rewrites, the code checking if a package has been whitelisted for an incompatible license was calculating the whitelisted packages twice (as 'whitelist' and as 'incompatwl'). Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/base.bbclass13
1 files changed, 4 insertions, 9 deletions
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index 31457f9f12..a3170d219c 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -526,23 +526,21 @@ python () {
bad_licenses = expand_wildcard_licenses(d, bad_licenses)
whitelist = []
- incompatwl = []
for lic in bad_licenses:
spdx_license = return_spdx(d, lic)
whitelist.extend((d.getVar("WHITELIST_" + lic) or "").split())
if spdx_license:
whitelist.extend((d.getVar("WHITELIST_" + spdx_license) or "").split())
+
+ if pn in whitelist:
'''
We need to track what we are whitelisting and why. If pn is
incompatible we need to be able to note that the image that
is created may infact contain incompatible licenses despite
INCOMPATIBLE_LICENSE being set.
'''
- incompatwl.extend((d.getVar("WHITELIST_" + lic) or "").split())
- if spdx_license:
- incompatwl.extend((d.getVar("WHITELIST_" + spdx_license) or "").split())
-
- if not pn in whitelist:
+ bb.note("Including %s as buildable despite it having an incompatible license because it has been whitelisted" % pn)
+ else:
pkgs = d.getVar('PACKAGES').split()
skipped_pkgs = []
unskipped_pkgs = []
@@ -562,9 +560,6 @@ python () {
elif all_skipped or incompatible_license(d, bad_licenses):
bb.debug(1, "SKIPPING recipe %s because it's %s" % (pn, license))
raise bb.parse.SkipRecipe("it has an incompatible license: %s" % license)
- elif pn in whitelist:
- if pn in incompatwl:
- bb.note("INCLUDING " + pn + " as buildable despite INCOMPATIBLE_LICENSE because it has been whitelisted")
# Try to verify per-package (LICENSE_<pkg>) values. LICENSE should be a
# superset of all per-package licenses. We do not do advanced (pattern)