diff options
Diffstat (limited to 'meta/classes')
| -rw-r--r-- | meta/classes/license_image.bbclass | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/meta/classes/license_image.bbclass b/meta/classes/license_image.bbclass index 3f102d0fbc..b5399b6d96 100644 --- a/meta/classes/license_image.bbclass +++ b/meta/classes/license_image.bbclass | |||
| @@ -43,10 +43,16 @@ def write_license_files(d, license_manifest, pkg_dic, rootfs=True): | |||
| 43 | bad_licenses = [canonical_license(d, l) for l in bad_licenses] | 43 | bad_licenses = [canonical_license(d, l) for l in bad_licenses] |
| 44 | bad_licenses = expand_wildcard_licenses(d, bad_licenses) | 44 | bad_licenses = expand_wildcard_licenses(d, bad_licenses) |
| 45 | 45 | ||
| 46 | whitelist = [] | ||
| 47 | for lic in bad_licenses: | ||
| 48 | whitelist.extend((d.getVar("WHITELIST_" + lic) or "").split()) | ||
| 49 | |||
| 46 | with open(license_manifest, "w") as license_file: | 50 | with open(license_manifest, "w") as license_file: |
| 47 | for pkg in sorted(pkg_dic): | 51 | for pkg in sorted(pkg_dic): |
| 48 | if bad_licenses: | 52 | if bad_licenses and pkg not in whitelist: |
| 49 | try: | 53 | try: |
| 54 | if incompatible_pkg_license(d, bad_licenses, pkg_dic[pkg]["LICENSE"]): | ||
| 55 | bb.fatal("Package %s has an incompatible license %s and cannot be installed into the image." %(pkg, pkg_dic[pkg]["LICENSE"])) | ||
| 50 | (pkg_dic[pkg]["LICENSE"], pkg_dic[pkg]["LICENSES"]) = \ | 56 | (pkg_dic[pkg]["LICENSE"], pkg_dic[pkg]["LICENSES"]) = \ |
| 51 | oe.license.manifest_licenses(pkg_dic[pkg]["LICENSE"], | 57 | oe.license.manifest_licenses(pkg_dic[pkg]["LICENSE"], |
| 52 | bad_licenses, canonical_license, d) | 58 | bad_licenses, canonical_license, d) |
| @@ -56,6 +62,8 @@ def write_license_files(d, license_manifest, pkg_dic, rootfs=True): | |||
| 56 | pkg_dic[pkg]["LICENSES"] = re.sub(r'[|&()*]', ' ', pkg_dic[pkg]["LICENSE"]) | 62 | pkg_dic[pkg]["LICENSES"] = re.sub(r'[|&()*]', ' ', pkg_dic[pkg]["LICENSE"]) |
| 57 | pkg_dic[pkg]["LICENSES"] = re.sub(r' *', ' ', pkg_dic[pkg]["LICENSES"]) | 63 | pkg_dic[pkg]["LICENSES"] = re.sub(r' *', ' ', pkg_dic[pkg]["LICENSES"]) |
| 58 | pkg_dic[pkg]["LICENSES"] = pkg_dic[pkg]["LICENSES"].split() | 64 | pkg_dic[pkg]["LICENSES"] = pkg_dic[pkg]["LICENSES"].split() |
| 65 | if pkg in whitelist: | ||
| 66 | bb.warn("Including %s with an incompatible license %s into the image, because it has been whitelisted." %(pkg, pkg_dic[pkg]["LICENSE"])) | ||
| 59 | 67 | ||
| 60 | if not "IMAGE_MANIFEST" in pkg_dic[pkg]: | 68 | if not "IMAGE_MANIFEST" in pkg_dic[pkg]: |
| 61 | # Rootfs manifest | 69 | # Rootfs manifest |
