diff options
-rw-r--r-- | meta/classes/license.bbclass | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/meta/classes/license.bbclass b/meta/classes/license.bbclass index caf7628d09..f97e39f3c5 100644 --- a/meta/classes/license.bbclass +++ b/meta/classes/license.bbclass | |||
@@ -131,6 +131,10 @@ def write_license_files(d, license_manifest, pkg_dic): | |||
131 | bb.utils.mkdirhier(pkg_rootfs_license_dir) | 131 | bb.utils.mkdirhier(pkg_rootfs_license_dir) |
132 | pkg_license_dir = os.path.join(d.getVar('LICENSE_DIRECTORY'), | 132 | pkg_license_dir = os.path.join(d.getVar('LICENSE_DIRECTORY'), |
133 | pkg_dic[pkg]["PN"]) | 133 | pkg_dic[pkg]["PN"]) |
134 | |||
135 | pkg_manifest_licenses = [canonical_license(d, lic) \ | ||
136 | for lic in pkg_dic[pkg]["LICENSES"]] | ||
137 | |||
134 | licenses = os.listdir(pkg_license_dir) | 138 | licenses = os.listdir(pkg_license_dir) |
135 | for lic in licenses: | 139 | for lic in licenses: |
136 | rootfs_license = os.path.join(rootfs_license_dir, lic) | 140 | rootfs_license = os.path.join(rootfs_license_dir, lic) |
@@ -138,9 +142,18 @@ def write_license_files(d, license_manifest, pkg_dic): | |||
138 | pkg_rootfs_license = os.path.join(pkg_rootfs_license_dir, lic) | 142 | pkg_rootfs_license = os.path.join(pkg_rootfs_license_dir, lic) |
139 | 143 | ||
140 | if re.match("^generic_.*$", lic): | 144 | if re.match("^generic_.*$", lic): |
141 | generic_lic = re.search("^generic_(.*)$", lic).group(1) | 145 | generic_lic = canonical_license(d, |
142 | if oe.license.license_ok(canonical_license(d, | 146 | re.search("^generic_(.*)$", lic).group(1)) |
143 | generic_lic), bad_licenses) == False: | 147 | |
148 | # Do not copy generic license into package if isn't | ||
149 | # declared into LICENSES of the package. | ||
150 | if not re.sub('\+$', '', generic_lic) in \ | ||
151 | [re.sub('\+', '', lic) for lic in \ | ||
152 | pkg_manifest_licenses]: | ||
153 | continue | ||
154 | |||
155 | if oe.license.license_ok(generic_lic, | ||
156 | bad_licenses) == False: | ||
144 | continue | 157 | continue |
145 | 158 | ||
146 | if not os.path.exists(rootfs_license): | 159 | if not os.path.exists(rootfs_license): |
@@ -499,7 +512,6 @@ def find_license_files(d): | |||
499 | bb.fatal('%s: %s' % (d.getVar('PF'), exc)) | 512 | bb.fatal('%s: %s' % (d.getVar('PF'), exc)) |
500 | except SyntaxError: | 513 | except SyntaxError: |
501 | bb.warn("%s: Failed to parse it's LICENSE field." % (d.getVar('PF'))) | 514 | bb.warn("%s: Failed to parse it's LICENSE field." % (d.getVar('PF'))) |
502 | |||
503 | # Add files from LIC_FILES_CHKSUM to list of license files | 515 | # Add files from LIC_FILES_CHKSUM to list of license files |
504 | lic_chksum_paths = defaultdict(OrderedDict) | 516 | lic_chksum_paths = defaultdict(OrderedDict) |
505 | for path, data in lic_chksums.items(): | 517 | for path, data in lic_chksums.items(): |