summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/license.bbclass25
1 files changed, 14 insertions, 11 deletions
diff --git a/meta/classes/license.bbclass b/meta/classes/license.bbclass
index adca881c85..648a4d7892 100644
--- a/meta/classes/license.bbclass
+++ b/meta/classes/license.bbclass
@@ -287,17 +287,7 @@ def incompatible_license_contains(license, truevalue, falsevalue, d):
287 bad_licenses = expand_wildcard_licenses(d, bad_licenses) 287 bad_licenses = expand_wildcard_licenses(d, bad_licenses)
288 return truevalue if license in bad_licenses else falsevalue 288 return truevalue if license in bad_licenses else falsevalue
289 289
290def incompatible_license(d, dont_want_licenses, package=None): 290def incompatible_pkg_license(d, dont_want_licenses, license):
291 """
292 This function checks if a recipe has only incompatible licenses. It also
293 take into consideration 'or' operand. dont_want_licenses should be passed
294 as canonical (SPDX) names.
295 """
296 import oe.license
297 license = d.getVar("LICENSE_%s" % package) if package else None
298 if not license:
299 license = d.getVar('LICENSE')
300
301 # Handles an "or" or two license sets provided by 291 # Handles an "or" or two license sets provided by
302 # flattened_licenses(), pick one that works if possible. 292 # flattened_licenses(), pick one that works if possible.
303 def choose_lic_set(a, b): 293 def choose_lic_set(a, b):
@@ -311,6 +301,19 @@ def incompatible_license(d, dont_want_licenses, package=None):
311 return any(not oe.license.license_ok(canonical_license(d, l), \ 301 return any(not oe.license.license_ok(canonical_license(d, l), \
312 dont_want_licenses) for l in licenses) 302 dont_want_licenses) for l in licenses)
313 303
304def incompatible_license(d, dont_want_licenses, package=None):
305 """
306 This function checks if a recipe has only incompatible licenses. It also
307 take into consideration 'or' operand. dont_want_licenses should be passed
308 as canonical (SPDX) names.
309 """
310 import oe.license
311 license = d.getVar("LICENSE_%s" % package) if package else None
312 if not license:
313 license = d.getVar('LICENSE')
314
315 return incompatible_pkg_license(d, dont_want_licenses, license)
316
314def check_license_flags(d): 317def check_license_flags(d):
315 """ 318 """
316 This function checks if a recipe has any LICENSE_FLAGS that 319 This function checks if a recipe has any LICENSE_FLAGS that