summaryrefslogtreecommitdiffstats
path: root/meta/classes/base.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes/base.bbclass')
-rw-r--r--meta/classes/base.bbclass67
1 files changed, 28 insertions, 39 deletions
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index 55f654d37d..1d5db96afb 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -595,46 +595,35 @@ python () {
595 if check_license and bad_licenses: 595 if check_license and bad_licenses:
596 bad_licenses = expand_wildcard_licenses(d, bad_licenses) 596 bad_licenses = expand_wildcard_licenses(d, bad_licenses)
597 597
598 whitelist = [] 598 exceptions = (d.getVar("INCOMPATIBLE_LICENSE_EXCEPTIONS") or "").split()
599 for lic in bad_licenses: 599
600 spdx_license = return_spdx(d, lic) 600 pkgs = d.getVar('PACKAGES').split()
601 whitelist.extend((d.getVar("WHITELIST_" + lic) or "").split()) 601 skipped_pkgs = {}
602 if spdx_license: 602 unskipped_pkgs = []
603 whitelist.extend((d.getVar("WHITELIST_" + spdx_license) or "").split()) 603 for pkg in pkgs:
604 604 remaining_bad_licenses = oe.license.apply_pkg_license_exception(pkg, bad_licenses, exceptions)
605 if pn in whitelist: 605
606 ''' 606 incompatible_lic = incompatible_license(d, remaining_bad_licenses, pkg)
607 We need to track what we are whitelisting and why. If pn is 607 if incompatible_lic:
608 incompatible we need to be able to note that the image that 608 skipped_pkgs[pkg] = incompatible_lic
609 is created may infact contain incompatible licenses despite
610 INCOMPATIBLE_LICENSE being set.
611 '''
612 bb.note("Including %s as buildable despite it having an incompatible license because it has been whitelisted" % pn)
613 else:
614 pkgs = d.getVar('PACKAGES').split()
615 skipped_pkgs = {}
616 unskipped_pkgs = []
617 for pkg in pkgs:
618 incompatible_lic = incompatible_license(d, bad_licenses, pkg)
619 if incompatible_lic:
620 skipped_pkgs[pkg] = incompatible_lic
621 else:
622 unskipped_pkgs.append(pkg)
623 if unskipped_pkgs:
624 for pkg in skipped_pkgs:
625 bb.debug(1, "Skipping the package %s at do_rootfs because of incompatible license(s): %s" % (pkg, ' '.join(skipped_pkgs[pkg])))
626 d.setVar('_exclude_incompatible-' + pkg, ' '.join(skipped_pkgs[pkg]))
627 for pkg in unskipped_pkgs:
628 bb.debug(1, "Including the package %s" % pkg)
629 else: 609 else:
630 incompatible_lic = incompatible_license(d, bad_licenses) 610 unskipped_pkgs.append(pkg)
631 for pkg in skipped_pkgs: 611
632 incompatible_lic += skipped_pkgs[pkg] 612 if unskipped_pkgs:
633 incompatible_lic = sorted(list(set(incompatible_lic))) 613 for pkg in skipped_pkgs:
634 614 bb.debug(1, "Skipping the package %s at do_rootfs because of incompatible license(s): %s" % (pkg, ' '.join(skipped_pkgs[pkg])))
635 if incompatible_lic: 615 d.setVar('_exclude_incompatible-' + pkg, ' '.join(skipped_pkgs[pkg]))
636 bb.debug(1, "Skipping recipe %s because of incompatible license(s): %s" % (pn, ' '.join(incompatible_lic))) 616 for pkg in unskipped_pkgs:
637 raise bb.parse.SkipRecipe("it has incompatible license(s): %s" % ' '.join(incompatible_lic)) 617 bb.debug(1, "Including the package %s" % pkg)
618 else:
619 incompatible_lic = incompatible_license(d, bad_licenses)
620 for pkg in skipped_pkgs:
621 incompatible_lic += skipped_pkgs[pkg]
622 incompatible_lic = sorted(list(set(incompatible_lic)))
623
624 if incompatible_lic:
625 bb.debug(1, "Skipping recipe %s because of incompatible license(s): %s" % (pn, ' '.join(incompatible_lic)))
626 raise bb.parse.SkipRecipe("it has incompatible license(s): %s" % ' '.join(incompatible_lic))
638 627
639 needsrcrev = False 628 needsrcrev = False
640 srcuri = d.getVar('SRC_URI') 629 srcuri = d.getVar('SRC_URI')