diff options
Diffstat (limited to 'meta/lib')
| -rw-r--r-- | meta/lib/oe/license.py | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/meta/lib/oe/license.py b/meta/lib/oe/license.py index 7739697c40..32c77fa204 100644 --- a/meta/lib/oe/license.py +++ b/meta/lib/oe/license.py | |||
| @@ -422,3 +422,42 @@ def check_license_format(d): | |||
| 422 | '%s: LICENSE value "%s" has an invalid separator "%s" that is not ' \ | 422 | '%s: LICENSE value "%s" has an invalid separator "%s" that is not ' \ |
| 423 | 'in the valid list of separators (%s)' % | 423 | 'in the valid list of separators (%s)' % |
| 424 | (pn, licenses, element, license_operator_chars), d) | 424 | (pn, licenses, element, license_operator_chars), d) |
| 425 | |||
| 426 | def skip_incompatible_package_licenses(d, pkgs): | ||
| 427 | if not pkgs: | ||
| 428 | return {} | ||
| 429 | |||
| 430 | pn = d.getVar("PN") | ||
| 431 | |||
| 432 | check_license = False if pn.startswith("nativesdk-") else True | ||
| 433 | for t in ["-native", "-cross-${TARGET_ARCH}", "-cross-initial-${TARGET_ARCH}", | ||
| 434 | "-crosssdk-${SDK_SYS}", "-crosssdk-initial-${SDK_SYS}", | ||
| 435 | "-cross-canadian-${TRANSLATED_TARGET_ARCH}"]: | ||
| 436 | if pn.endswith(d.expand(t)): | ||
| 437 | check_license = False | ||
| 438 | if pn.startswith("gcc-source-"): | ||
| 439 | check_license = False | ||
| 440 | |||
| 441 | bad_licenses = (d.getVar('INCOMPATIBLE_LICENSE') or "").split() | ||
| 442 | if not check_license or not bad_licenses: | ||
| 443 | return {} | ||
| 444 | |||
| 445 | bad_licenses = expand_wildcard_licenses(d, bad_licenses) | ||
| 446 | |||
| 447 | exceptions = (d.getVar("INCOMPATIBLE_LICENSE_EXCEPTIONS") or "").split() | ||
| 448 | |||
| 449 | for lic_exception in exceptions: | ||
| 450 | if ":" in lic_exception: | ||
| 451 | lic_exception = lic_exception.split(":")[1] | ||
| 452 | if lic_exception in obsolete_license_list(): | ||
| 453 | bb.fatal("Obsolete license %s used in INCOMPATIBLE_LICENSE_EXCEPTIONS" % lic_exception) | ||
| 454 | |||
| 455 | skipped_pkgs = {} | ||
| 456 | for pkg in pkgs: | ||
| 457 | remaining_bad_licenses = apply_pkg_license_exception(pkg, bad_licenses, exceptions) | ||
| 458 | |||
| 459 | incompatible_lic = incompatible_license(d, remaining_bad_licenses, pkg) | ||
| 460 | if incompatible_lic: | ||
| 461 | skipped_pkgs[pkg] = incompatible_lic | ||
| 462 | |||
| 463 | return skipped_pkgs | ||
