summaryrefslogtreecommitdiffstats
path: root/meta/classes-global/base.bbclass
diff options
context:
space:
mode:
authorJoshua Watt <JPEWhacker@gmail.com>2024-10-24 13:03:08 -0600
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-10-25 15:37:10 +0100
commitf8f7e53641955f6fc70dcb1d30777fc82060eb24 (patch)
tree6abc86b4419402e8fe8729489816925a5c16f8c5 /meta/classes-global/base.bbclass
parent71760081f782cdf1e53c3ff03a6376fac3605196 (diff)
downloadpoky-f8f7e53641955f6fc70dcb1d30777fc82060eb24.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: 86eb409e3c1b30110869ec5a0027ae2d48bbfe7f) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes-global/base.bbclass')
-rw-r--r--meta/classes-global/base.bbclass35
1 files changed, 4 insertions, 31 deletions
diff --git a/meta/classes-global/base.bbclass b/meta/classes-global/base.bbclass
index 88b932fc3f..5b8663f454 100644
--- a/meta/classes-global/base.bbclass
+++ b/meta/classes-global/base.bbclass
@@ -573,37 +573,10 @@ python () {
573 573
574 bad_licenses = (d.getVar('INCOMPATIBLE_LICENSE') or "").split() 574 bad_licenses = (d.getVar('INCOMPATIBLE_LICENSE') or "").split()
575 575
576 check_license = False if pn.startswith("nativesdk-") else True 576 pkgs = d.getVar('PACKAGES').split()
577 for t in ["-native", "-cross-${TARGET_ARCH}", "-cross-initial-${TARGET_ARCH}", 577 if pkgs:
578 "-crosssdk-${SDK_SYS}", "-crosssdk-initial-${SDK_SYS}", 578 skipped_pkgs = oe.license.skip_incompatible_package_licenses(d, pkgs)
579 "-cross-canadian-${TRANSLATED_TARGET_ARCH}"]: 579 unskipped_pkgs = [p for p in pkgs if p not in skipped_pkgs]
580 if pn.endswith(d.expand(t)):
581 check_license = False
582 if pn.startswith("gcc-source-"):
583 check_license = False
584
585 if check_license and bad_licenses:
586 bad_licenses = oe.license.expand_wildcard_licenses(d, bad_licenses)
587
588 exceptions = (d.getVar("INCOMPATIBLE_LICENSE_EXCEPTIONS") or "").split()
589
590 for lic_exception in exceptions:
591 if ":" in lic_exception:
592 lic_exception = lic_exception.split(":")[1]
593 if lic_exception in oe.license.obsolete_license_list():
594 bb.fatal("Obsolete license %s used in INCOMPATIBLE_LICENSE_EXCEPTIONS" % lic_exception)
595
596 pkgs = d.getVar('PACKAGES').split()
597 skipped_pkgs = {}
598 unskipped_pkgs = []
599 for pkg in pkgs:
600 remaining_bad_licenses = oe.license.apply_pkg_license_exception(pkg, bad_licenses, exceptions)
601
602 incompatible_lic = oe.license.incompatible_license(d, remaining_bad_licenses, pkg)
603 if incompatible_lic:
604 skipped_pkgs[pkg] = incompatible_lic
605 else:
606 unskipped_pkgs.append(pkg)
607 580
608 if unskipped_pkgs: 581 if unskipped_pkgs:
609 for pkg in skipped_pkgs: 582 for pkg in skipped_pkgs: