diff options
author | Peter Kjellerstedt <peter.kjellerstedt@axis.com> | 2019-12-11 17:48:15 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-12-16 23:22:03 +0000 |
commit | 02a3189b4902e616f5b4277ee3d0fca10b73b4dc (patch) | |
tree | f6d9bbda68acd831a6e84b5768074cb1426b08ef /meta/classes/license.bbclass | |
parent | 64daaf29e2c12c8b587bafdebf9409433187ddf7 (diff) | |
download | openembedded-core-contrib-02a3189b4902e616f5b4277ee3d0fca10b73b4dc.tar.gz |
license.bbclass: Make incompatible_pkg_license return incompatible lics
This makes it possible to report the incompatible licenses.
Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/license.bbclass')
-rw-r--r-- | meta/classes/license.bbclass | 12 |
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): # 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): """ |