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>
This commit is contained in:
Peter Kjellerstedt
2019-12-11 17:48:15 +01:00
committed by Richard Purdie
parent d12ecf16be
commit ba3550fb0f

View File

@@ -310,15 +310,21 @@ def incompatible_pkg_license(d, dont_want_licenses, license):
# Handles an "or" or two license sets provided by
# flattened_licenses(), pick one that works if possible.
def choose_lic_set(a, b):
return a if all(oe.license.license_ok(canonical_license(d, lic),
return a if all(oe.license.license_ok(canonical_license(d, lic),
dont_want_licenses) for lic in a) else b
try:
licenses = oe.license.flattened_licenses(license, choose_lic_set)
except oe.license.LicenseError as exc:
bb.fatal('%s: %s' % (d.getVar('P'), exc))
return any(not oe.license.license_ok(canonical_license(d, l), \
dont_want_licenses) for l in licenses)
incompatible_lic = []
for l in licenses:
license = canonical_license(d, l)
if not oe.license.license_ok(license, dont_want_licenses):
incompatible_lic.append(license)
return sorted(incompatible_lic)
def incompatible_license(d, dont_want_licenses, package=None):
"""