diff options
| -rw-r--r-- | meta/classes/base.bbclass | 13 | ||||
| -rw-r--r-- | meta/classes/insane.bbclass | 21 |
2 files changed, 20 insertions, 14 deletions
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass index 45f9435fd8..7aa2e144eb 100644 --- a/meta/classes/base.bbclass +++ b/meta/classes/base.bbclass | |||
| @@ -584,19 +584,6 @@ python () { | |||
| 584 | bb.debug(1, "Skipping recipe %s because of incompatible license(s): %s" % (pn, ' '.join(incompatible_lic))) | 584 | bb.debug(1, "Skipping recipe %s because of incompatible license(s): %s" % (pn, ' '.join(incompatible_lic))) |
| 585 | raise bb.parse.SkipRecipe("it has incompatible license(s): %s" % ' '.join(incompatible_lic)) | 585 | raise bb.parse.SkipRecipe("it has incompatible license(s): %s" % ' '.join(incompatible_lic)) |
| 586 | 586 | ||
| 587 | # Try to verify per-package (LICENSE_<pkg>) values. LICENSE should be a | ||
| 588 | # superset of all per-package licenses. We do not do advanced (pattern) | ||
| 589 | # matching of license expressions - just check that all license strings | ||
| 590 | # in LICENSE_<pkg> are found in LICENSE. | ||
| 591 | license_set = oe.license.list_licenses(license) | ||
| 592 | for pkg in d.getVar('PACKAGES').split(): | ||
| 593 | pkg_license = d.getVar('LICENSE_' + pkg) | ||
| 594 | if pkg_license: | ||
| 595 | unlisted = oe.license.list_licenses(pkg_license) - license_set | ||
| 596 | if unlisted: | ||
| 597 | bb.warn("LICENSE_%s includes licenses (%s) that are not " | ||
| 598 | "listed in LICENSE" % (pkg, ' '.join(unlisted))) | ||
| 599 | |||
| 600 | needsrcrev = False | 587 | needsrcrev = False |
| 601 | srcuri = d.getVar('SRC_URI') | 588 | srcuri = d.getVar('SRC_URI') |
| 602 | for uri in srcuri.split(): | 589 | for uri in srcuri.split(): |
diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass index 8b19f445f9..b7c613880b 100644 --- a/meta/classes/insane.bbclass +++ b/meta/classes/insane.bbclass | |||
| @@ -26,7 +26,7 @@ WARN_QA ?= " libdir xorg-driver-abi \ | |||
| 26 | textrel incompatible-license files-invalid \ | 26 | textrel incompatible-license files-invalid \ |
| 27 | infodir build-deps src-uri-bad symlink-to-sysroot multilib \ | 27 | infodir build-deps src-uri-bad symlink-to-sysroot multilib \ |
| 28 | invalid-packageconfig host-user-contaminated uppercase-pn patch-fuzz \ | 28 | invalid-packageconfig host-user-contaminated uppercase-pn patch-fuzz \ |
| 29 | mime mime-xdg \ | 29 | mime mime-xdg unlisted-pkg-lics \ |
| 30 | " | 30 | " |
| 31 | ERROR_QA ?= "dev-so debug-deps dev-deps debug-files arch pkgconfig la \ | 31 | ERROR_QA ?= "dev-so debug-deps dev-deps debug-files arch pkgconfig la \ |
| 32 | perms dep-cmp pkgvarcheck perm-config perm-line perm-link \ | 32 | perms dep-cmp pkgvarcheck perm-config perm-line perm-link \ |
| @@ -898,6 +898,25 @@ def package_qa_check_expanded_d(package, d, messages): | |||
| 898 | sane = False | 898 | sane = False |
| 899 | return sane | 899 | return sane |
| 900 | 900 | ||
| 901 | QAPKGTEST[unlisted-pkg-lics] = "package_qa_check_unlisted_pkg_lics" | ||
| 902 | def package_qa_check_unlisted_pkg_lics(package, d, messages): | ||
| 903 | """ | ||
| 904 | Check that all licenses for a package are among the licenses for the recipe. | ||
| 905 | """ | ||
| 906 | pkg_lics = d.getVar('LICENSE_' + package) | ||
| 907 | if not pkg_lics: | ||
| 908 | return True | ||
| 909 | |||
| 910 | recipe_lics_set = oe.license.list_licenses(d.getVar('LICENSE')) | ||
| 911 | unlisted = oe.license.list_licenses(pkg_lics) - recipe_lics_set | ||
| 912 | if not unlisted: | ||
| 913 | return True | ||
| 914 | |||
| 915 | package_qa_add_message(messages, "unlisted-pkg-lics", | ||
| 916 | "LICENSE_%s includes licenses (%s) that are not " | ||
| 917 | "listed in LICENSE" % (package, ' '.join(unlisted))) | ||
| 918 | return False | ||
| 919 | |||
| 901 | def package_qa_check_encoding(keys, encode, d): | 920 | def package_qa_check_encoding(keys, encode, d): |
| 902 | def check_encoding(key, enc): | 921 | def check_encoding(key, enc): |
| 903 | sane = True | 922 | sane = True |
