summaryrefslogtreecommitdiffstats
path: root/meta/classes/base.bbclass
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:25:50 +0000
commit4028227713e5453860f0918c64388357f71d0456 (patch)
tree621446e319064b4b6baace281a203cf33a5f8e14 /meta/classes/base.bbclass
parentba3550fb0f852c5ab2ac537822567ab6ad1f3a00 (diff)
downloadpoky-4028227713e5453860f0918c64388357f71d0456.tar.gz
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'). (From OE-Core rev: 01dcc8c94b882d865fc72a067a90d9721ac5fea7) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/base.bbclass')
-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 () {
526 bad_licenses = expand_wildcard_licenses(d, bad_licenses) 526 bad_licenses = expand_wildcard_licenses(d, bad_licenses)
527 527
528 whitelist = [] 528 whitelist = []
529 incompatwl = []
530 for lic in bad_licenses: 529 for lic in bad_licenses:
531 spdx_license = return_spdx(d, lic) 530 spdx_license = return_spdx(d, lic)
532 whitelist.extend((d.getVar("WHITELIST_" + lic) or "").split()) 531 whitelist.extend((d.getVar("WHITELIST_" + lic) or "").split())
533 if spdx_license: 532 if spdx_license:
534 whitelist.extend((d.getVar("WHITELIST_" + spdx_license) or "").split()) 533 whitelist.extend((d.getVar("WHITELIST_" + spdx_license) or "").split())
534
535 if pn in whitelist:
535 ''' 536 '''
536 We need to track what we are whitelisting and why. If pn is 537 We need to track what we are whitelisting and why. If pn is
537 incompatible we need to be able to note that the image that 538 incompatible we need to be able to note that the image that
538 is created may infact contain incompatible licenses despite 539 is created may infact contain incompatible licenses despite
539 INCOMPATIBLE_LICENSE being set. 540 INCOMPATIBLE_LICENSE being set.
540 ''' 541 '''
541 incompatwl.extend((d.getVar("WHITELIST_" + lic) or "").split()) 542 bb.note("Including %s as buildable despite it having an incompatible license because it has been whitelisted" % pn)
542 if spdx_license: 543 else:
543 incompatwl.extend((d.getVar("WHITELIST_" + spdx_license) or "").split())
544
545 if not pn in whitelist:
546 pkgs = d.getVar('PACKAGES').split() 544 pkgs = d.getVar('PACKAGES').split()
547 skipped_pkgs = [] 545 skipped_pkgs = []
548 unskipped_pkgs = [] 546 unskipped_pkgs = []
@@ -562,9 +560,6 @@ python () {
562 elif all_skipped or incompatible_license(d, bad_licenses): 560 elif all_skipped or incompatible_license(d, bad_licenses):
563 bb.debug(1, "SKIPPING recipe %s because it's %s" % (pn, license)) 561 bb.debug(1, "SKIPPING recipe %s because it's %s" % (pn, license))
564 raise bb.parse.SkipRecipe("it has an incompatible license: %s" % license) 562 raise bb.parse.SkipRecipe("it has an incompatible license: %s" % license)
565 elif pn in whitelist:
566 if pn in incompatwl:
567 bb.note("INCLUDING " + pn + " as buildable despite INCOMPATIBLE_LICENSE because it has been whitelisted")
568 563
569 # Try to verify per-package (LICENSE_<pkg>) values. LICENSE should be a 564 # Try to verify per-package (LICENSE_<pkg>) values. LICENSE should be a
570 # superset of all per-package licenses. We do not do advanced (pattern) 565 # superset of all per-package licenses. We do not do advanced (pattern)