[OE-core] [PATCH 3/7] license.bbclass: Make incompatible_pkg_license return incompatible lics
Peter Kjellerstedt
peter.kjellerstedt at axis.com
Sat Dec 7 05:38:11 UTC 2019
This makes it possible to report the incompatible licenses.
Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt at axis.com>
---
meta/classes/license.bbclass | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/meta/classes/license.bbclass b/meta/classes/license.bbclass
index 20af6d34b6..8094883a87 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):
"""
--
2.21.0
More information about the Openembedded-core
mailing list