summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorPeter Kjellerstedt <peter.kjellerstedt@axis.com>2019-12-11 17:48:17 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-12-16 23:22:03 +0000
commitfb3405fac7b933a3f9d23e5faf6a3cf2d1990982 (patch)
tree8b2080c446c536f547bc43afce146603892cb3da /meta/classes
parent01dcc8c94b882d865fc72a067a90d9721ac5fea7 (diff)
downloadopenembedded-core-fb3405fac7b933a3f9d23e5faf6a3cf2d1990982.tar.gz
base.bbclass: Report only the licenses that are incompatible for a package
Instead of reporting ${LICENSE} when a package is identified as using an incompatible license, report the license(s) that are actually incompatible. Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/base.bbclass26
1 files changed, 16 insertions, 10 deletions
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index a3170d219c..145daea3ec 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -542,24 +542,30 @@ python () {
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 = []
+ skipped_pkgs = {}
unskipped_pkgs = []
for pkg in pkgs:
- if incompatible_license(d, bad_licenses, pkg):
- skipped_pkgs.append(pkg)
+ incompatible_lic = incompatible_license(d, bad_licenses, pkg)
+ if incompatible_lic:
+ skipped_pkgs[pkg] = incompatible_lic
else:
unskipped_pkgs.append(pkg)
- all_skipped = skipped_pkgs and not unskipped_pkgs
if unskipped_pkgs:
for pkg in skipped_pkgs:
- bb.debug(1, "SKIPPING the package " + pkg + " at do_rootfs because it's " + license)
+ bb.debug(1, "Skipping the package %s at do_rootfs because of incompatible license(s): %s" % (pkg, ' '.join(skipped_pkgs[pkg])))
mlprefix = d.getVar('MLPREFIX')
- d.setVar('LICENSE_EXCLUSION-' + mlprefix + pkg, 1)
+ d.setVar('LICENSE_EXCLUSION-' + mlprefix + pkg, ' '.join(skipped_pkgs[pkg]))
for pkg in unskipped_pkgs:
- bb.debug(1, "INCLUDING the package " + pkg)
- 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)
+ bb.debug(1, "Including the package %s" % pkg)
+ else:
+ incompatible_lic = incompatible_license(d, bad_licenses)
+ for pkg in skipped_pkgs:
+ incompatible_lic += skipped_pkgs[pkg]
+ incompatible_lic = sorted(list(set(incompatible_lic)))
+
+ if incompatible_lic:
+ bb.debug(1, "Skipping recipe %s because of incompatible license(s): %s" % (pn, ' '.join(incompatible_lic)))
+ raise bb.parse.SkipRecipe("it has incompatible license(s): %s" % ' '.join(incompatible_lic))
# Try to verify per-package (LICENSE_<pkg>) values. LICENSE should be a
# superset of all per-package licenses. We do not do advanced (pattern)