diff options
Diffstat (limited to 'meta/classes-recipe/license_image.bbclass')
| -rw-r--r-- | meta/classes-recipe/license_image.bbclass | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/meta/classes-recipe/license_image.bbclass b/meta/classes-recipe/license_image.bbclass index 0e953856a6..d2c5ab902c 100644 --- a/meta/classes-recipe/license_image.bbclass +++ b/meta/classes-recipe/license_image.bbclass | |||
| @@ -58,7 +58,7 @@ def write_license_files(d, license_manifest, pkg_dic, rootfs=True): | |||
| 58 | import stat | 58 | import stat |
| 59 | 59 | ||
| 60 | bad_licenses = (d.getVar("INCOMPATIBLE_LICENSE") or "").split() | 60 | bad_licenses = (d.getVar("INCOMPATIBLE_LICENSE") or "").split() |
| 61 | bad_licenses = expand_wildcard_licenses(d, bad_licenses) | 61 | bad_licenses = oe.license.expand_wildcard_licenses(d, bad_licenses) |
| 62 | pkgarchs = d.getVar("SSTATE_ARCHS").split() | 62 | pkgarchs = d.getVar("SSTATE_ARCHS").split() |
| 63 | pkgarchs.reverse() | 63 | pkgarchs.reverse() |
| 64 | 64 | ||
| @@ -66,17 +66,17 @@ def write_license_files(d, license_manifest, pkg_dic, rootfs=True): | |||
| 66 | with open(license_manifest, "w") as license_file: | 66 | with open(license_manifest, "w") as license_file: |
| 67 | for pkg in sorted(pkg_dic): | 67 | for pkg in sorted(pkg_dic): |
| 68 | remaining_bad_licenses = oe.license.apply_pkg_license_exception(pkg, bad_licenses, exceptions) | 68 | remaining_bad_licenses = oe.license.apply_pkg_license_exception(pkg, bad_licenses, exceptions) |
| 69 | incompatible_licenses = incompatible_pkg_license(d, remaining_bad_licenses, pkg_dic[pkg]["LICENSE"]) | 69 | incompatible_licenses = oe.license.incompatible_pkg_license(d, remaining_bad_licenses, pkg_dic[pkg]["LICENSE"]) |
| 70 | if incompatible_licenses: | 70 | if incompatible_licenses: |
| 71 | bb.fatal("Package %s cannot be installed into the image because it has incompatible license(s): %s" %(pkg, ' '.join(incompatible_licenses))) | 71 | bb.fatal("Package %s cannot be installed into the image because it has incompatible license(s): %s" %(pkg, ' '.join(incompatible_licenses))) |
| 72 | else: | 72 | else: |
| 73 | incompatible_licenses = incompatible_pkg_license(d, bad_licenses, pkg_dic[pkg]["LICENSE"]) | 73 | incompatible_licenses = oe.license.incompatible_pkg_license(d, bad_licenses, pkg_dic[pkg]["LICENSE"]) |
| 74 | if incompatible_licenses: | 74 | if incompatible_licenses: |
| 75 | oe.qa.handle_error('license-exception', "Including %s with incompatible license(s) %s into the image, because it has been allowed by exception list." %(pkg, ' '.join(incompatible_licenses)), d) | 75 | oe.qa.handle_error('license-exception', "Including %s with incompatible license(s) %s into the image, because it has been allowed by exception list." %(pkg, ' '.join(incompatible_licenses)), d) |
| 76 | try: | 76 | try: |
| 77 | (pkg_dic[pkg]["LICENSE"], pkg_dic[pkg]["LICENSES"]) = \ | 77 | (pkg_dic[pkg]["LICENSE"], pkg_dic[pkg]["LICENSES"]) = \ |
| 78 | oe.license.manifest_licenses(pkg_dic[pkg]["LICENSE"], | 78 | oe.license.manifest_licenses(pkg_dic[pkg]["LICENSE"], |
| 79 | remaining_bad_licenses, canonical_license, d) | 79 | remaining_bad_licenses, oe.license.canonical_license, d) |
| 80 | except oe.license.LicenseError as exc: | 80 | except oe.license.LicenseError as exc: |
| 81 | bb.fatal('%s: %s' % (d.getVar('P'), exc)) | 81 | bb.fatal('%s: %s' % (d.getVar('P'), exc)) |
| 82 | 82 | ||
| @@ -144,7 +144,7 @@ def write_license_files(d, license_manifest, pkg_dic, rootfs=True): | |||
| 144 | if not os.path.exists(pkg_license_dir ): | 144 | if not os.path.exists(pkg_license_dir ): |
| 145 | bb.fatal("Couldn't find license information for dependency %s" % pkg) | 145 | bb.fatal("Couldn't find license information for dependency %s" % pkg) |
| 146 | 146 | ||
| 147 | pkg_manifest_licenses = [canonical_license(d, lic) \ | 147 | pkg_manifest_licenses = [oe.license.canonical_license(d, lic) \ |
| 148 | for lic in pkg_dic[pkg]["LICENSES"]] | 148 | for lic in pkg_dic[pkg]["LICENSES"]] |
| 149 | 149 | ||
| 150 | licenses = os.listdir(pkg_license_dir) | 150 | licenses = os.listdir(pkg_license_dir) |
| @@ -153,7 +153,7 @@ def write_license_files(d, license_manifest, pkg_dic, rootfs=True): | |||
| 153 | pkg_rootfs_license = os.path.join(pkg_rootfs_license_dir, lic) | 153 | pkg_rootfs_license = os.path.join(pkg_rootfs_license_dir, lic) |
| 154 | 154 | ||
| 155 | if re.match(r"^generic_.*$", lic): | 155 | if re.match(r"^generic_.*$", lic): |
| 156 | generic_lic = canonical_license(d, | 156 | generic_lic = oe.license.canonical_license(d, |
| 157 | re.search(r"^generic_(.*)$", lic).group(1)) | 157 | re.search(r"^generic_(.*)$", lic).group(1)) |
| 158 | 158 | ||
| 159 | # Do not copy generic license into package if isn't | 159 | # Do not copy generic license into package if isn't |
| @@ -176,7 +176,7 @@ def write_license_files(d, license_manifest, pkg_dic, rootfs=True): | |||
| 176 | if not os.path.exists(pkg_rootfs_license): | 176 | if not os.path.exists(pkg_rootfs_license): |
| 177 | os.symlink(os.path.join('..', generic_lic_file), pkg_rootfs_license) | 177 | os.symlink(os.path.join('..', generic_lic_file), pkg_rootfs_license) |
| 178 | else: | 178 | else: |
| 179 | if (oe.license.license_ok(canonical_license(d, | 179 | if (oe.license.license_ok(oe.license.canonical_license(d, |
| 180 | lic), bad_licenses) == False or | 180 | lic), bad_licenses) == False or |
| 181 | os.path.exists(pkg_rootfs_license)): | 181 | os.path.exists(pkg_rootfs_license)): |
| 182 | continue | 182 | continue |
