summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorPeter Kjellerstedt <peter.kjellerstedt@axis.com>2019-12-11 17:48:15 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-12-16 23:25:50 +0000
commitba3550fb0f852c5ab2ac537822567ab6ad1f3a00 (patch)
treead08c4701239d7332efac613956fe85a62f702b8 /meta
parentd12ecf16be342301c0d39d605022b22f14d422f3 (diff)
downloadpoky-ba3550fb0f852c5ab2ac537822567ab6ad1f3a00.tar.gz
license.bbclass: Make incompatible_pkg_license return incompatible lics
This makes it possible to report the incompatible licenses. (From OE-Core rev: 02a3189b4902e616f5b4277ee3d0fca10b73b4dc) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/license.bbclass12
1 files changed, 9 insertions, 3 deletions
diff --git a/meta/classes/license.bbclass b/meta/classes/license.bbclass
index c388740003..f90176d6c0 100644
--- a/meta/classes/license.bbclass
+++ b/meta/classes/license.bbclass
@@ -310,15 +310,21 @@ def incompatible_pkg_license(d, dont_want_licenses, license):
310 # Handles an "or" or two license sets provided by 310 # Handles an "or" or two license sets provided by
311 # flattened_licenses(), pick one that works if possible. 311 # flattened_licenses(), pick one that works if possible.
312 def choose_lic_set(a, b): 312 def choose_lic_set(a, b):
313 return a if all(oe.license.license_ok(canonical_license(d, lic), 313 return a if all(oe.license.license_ok(canonical_license(d, lic),
314 dont_want_licenses) for lic in a) else b 314 dont_want_licenses) for lic in a) else b
315 315
316 try: 316 try:
317 licenses = oe.license.flattened_licenses(license, choose_lic_set) 317 licenses = oe.license.flattened_licenses(license, choose_lic_set)
318 except oe.license.LicenseError as exc: 318 except oe.license.LicenseError as exc:
319 bb.fatal('%s: %s' % (d.getVar('P'), exc)) 319 bb.fatal('%s: %s' % (d.getVar('P'), exc))
320 return any(not oe.license.license_ok(canonical_license(d, l), \ 320
321 dont_want_licenses) for l in licenses) 321 incompatible_lic = []
322 for l in licenses:
323 license = canonical_license(d, l)
324 if not oe.license.license_ok(license, dont_want_licenses):
325 incompatible_lic.append(license)
326
327 return sorted(incompatible_lic)
322 328
323def incompatible_license(d, dont_want_licenses, package=None): 329def incompatible_license(d, dont_want_licenses, package=None):
324 """ 330 """