diff options
| author | Joshua Watt <JPEWhacker@gmail.com> | 2025-11-07 14:14:39 +0100 |
|---|---|---|
| committer | Steve Sakoman <steve@sakoman.com> | 2025-11-14 06:45:29 -0800 |
| commit | 8f0eab43edc4f2a3e74cd30903c5e5718cc1186c (patch) | |
| tree | 70355c622d7e9bcd30347bc9b9e36063cf9a82ec /meta/classes-global | |
| parent | 2cab0b98338b09daf3baf35dc30bfb232a85c4c8 (diff) | |
| download | poky-8f0eab43edc4f2a3e74cd30903c5e5718cc1186c.tar.gz | |
lib/license: Move package license skip to library
Moves the code that skips packages with incompatible licenses to the
library code so that it can be called in other locations
(From OE-Core rev: 4f7a047c4a1e14bbb3bf593764aace1e25bcd4a4)
Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 86eb409e3c1b30110869ec5a0027ae2d48bbfe7f)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'meta/classes-global')
| -rw-r--r-- | meta/classes-global/base.bbclass | 35 |
1 files changed, 4 insertions, 31 deletions
diff --git a/meta/classes-global/base.bbclass b/meta/classes-global/base.bbclass index f764f3ee2f..ecf0fd711f 100644 --- a/meta/classes-global/base.bbclass +++ b/meta/classes-global/base.bbclass | |||
| @@ -565,37 +565,10 @@ python () { | |||
| 565 | 565 | ||
| 566 | bad_licenses = (d.getVar('INCOMPATIBLE_LICENSE') or "").split() | 566 | bad_licenses = (d.getVar('INCOMPATIBLE_LICENSE') or "").split() |
| 567 | 567 | ||
| 568 | check_license = False if pn.startswith("nativesdk-") else True | 568 | pkgs = d.getVar('PACKAGES').split() |
| 569 | for t in ["-native", "-cross-${TARGET_ARCH}", "-cross-initial-${TARGET_ARCH}", | 569 | if pkgs: |
| 570 | "-crosssdk-${SDK_SYS}", "-crosssdk-initial-${SDK_SYS}", | 570 | skipped_pkgs = oe.license.skip_incompatible_package_licenses(d, pkgs) |
| 571 | "-cross-canadian-${TRANSLATED_TARGET_ARCH}"]: | 571 | unskipped_pkgs = [p for p in pkgs if p not in skipped_pkgs] |
| 572 | if pn.endswith(d.expand(t)): | ||
| 573 | check_license = False | ||
| 574 | if pn.startswith("gcc-source-"): | ||
| 575 | check_license = False | ||
| 576 | |||
| 577 | if check_license and bad_licenses: | ||
| 578 | bad_licenses = oe.license.expand_wildcard_licenses(d, bad_licenses) | ||
| 579 | |||
| 580 | exceptions = (d.getVar("INCOMPATIBLE_LICENSE_EXCEPTIONS") or "").split() | ||
| 581 | |||
| 582 | for lic_exception in exceptions: | ||
| 583 | if ":" in lic_exception: | ||
| 584 | lic_exception = lic_exception.split(":")[1] | ||
| 585 | if lic_exception in oe.license.obsolete_license_list(): | ||
| 586 | bb.fatal("Obsolete license %s used in INCOMPATIBLE_LICENSE_EXCEPTIONS" % lic_exception) | ||
| 587 | |||
| 588 | pkgs = d.getVar('PACKAGES').split() | ||
| 589 | skipped_pkgs = {} | ||
| 590 | unskipped_pkgs = [] | ||
| 591 | for pkg in pkgs: | ||
| 592 | remaining_bad_licenses = oe.license.apply_pkg_license_exception(pkg, bad_licenses, exceptions) | ||
| 593 | |||
| 594 | incompatible_lic = oe.license.incompatible_license(d, remaining_bad_licenses, pkg) | ||
| 595 | if incompatible_lic: | ||
| 596 | skipped_pkgs[pkg] = incompatible_lic | ||
| 597 | else: | ||
| 598 | unskipped_pkgs.append(pkg) | ||
| 599 | 572 | ||
| 600 | if unskipped_pkgs: | 573 | if unskipped_pkgs: |
| 601 | for pkg in skipped_pkgs: | 574 | for pkg in skipped_pkgs: |
