mirror of
https://git.yoctoproject.org/poky
synced 2026-05-02 00:32:12 +02:00
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:
committed by
Richard Purdie
parent
d12ecf16be
commit
ba3550fb0f
@@ -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):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user