summaryrefslogtreecommitdiffstats
path: root/meta/lib/oe
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@arm.com>2025-06-13 14:16:17 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-06-16 17:57:30 +0100
commitdd8f32018451aa76077b8fcdf77ac2a36d442ba3 (patch)
treeb08ee5c18b3da4dfcf953c25501477ea3acdb635 /meta/lib/oe
parent0d175076fe082dd1f63e7cddde54de422e059006 (diff)
downloadpoky-dd8f32018451aa76077b8fcdf77ac2a36d442ba3.tar.gz
oe/license_finder: don't return the "crunched" license text in crunch_license
crunch_license() will perform some basic text manipulation to try and canonicalise the license texts. It also returns the new license text but none of the callers use this, and as a slightly mangled version of the original it has no real purpose. Remove this return value and clean up the callers. (From OE-Core rev: 34603ed3b4919dcfba19ef57db11a6d3bb2704f1) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oe')
-rw-r--r--meta/lib/oe/license_finder.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/meta/lib/oe/license_finder.py b/meta/lib/oe/license_finder.py
index be03e5d084..cacb4cb19d 100644
--- a/meta/lib/oe/license_finder.py
+++ b/meta/lib/oe/license_finder.py
@@ -51,7 +51,7 @@ def crunch_known_licenses(d):
51 51
52 commonlicdir = d.getVar('COMMON_LICENSE_DIR') 52 commonlicdir = d.getVar('COMMON_LICENSE_DIR')
53 for fn in sorted(os.listdir(commonlicdir)): 53 for fn in sorted(os.listdir(commonlicdir)):
54 md5value, lictext = crunch_license(os.path.join(commonlicdir, fn)) 54 md5value = crunch_license(os.path.join(commonlicdir, fn))
55 if md5value not in crunched_md5sums: 55 if md5value not in crunched_md5sums:
56 crunched_md5sums[md5value] = fn 56 crunched_md5sums[md5value] = fn
57 elif fn != crunched_md5sums[md5value]: 57 elif fn != crunched_md5sums[md5value]:
@@ -123,8 +123,7 @@ def crunch_license(licfile):
123 md5val = m.hexdigest() 123 md5val = m.hexdigest()
124 except UnicodeEncodeError: 124 except UnicodeEncodeError:
125 md5val = None 125 md5val = None
126 lictext = '' 126 return md5val
127 return md5val, lictext
128 127
129 128
130def find_license_files(srctree, first_only=False): 129def find_license_files(srctree, first_only=False):
@@ -164,15 +163,15 @@ def match_licenses(licfiles, srctree, d):
164 md5value = bb.utils.md5_file(resolved_licfile) 163 md5value = bb.utils.md5_file(resolved_licfile)
165 license = md5sums.get(md5value, None) 164 license = md5sums.get(md5value, None)
166 if not license: 165 if not license:
167 crunched_md5, lictext = crunch_license(resolved_licfile) 166 crunched_md5 = crunch_license(resolved_licfile)
168 license = crunched_md5sums.get(crunched_md5, None) 167 license = crunched_md5sums.get(crunched_md5, None)
169 if lictext and not license: 168 if not license:
170 license = 'Unknown' 169 license = 'Unknown'
171 logger.info("Please add the following line for '%s' to a 'license-hashes.csv' " \ 170 logger.info("Please add the following line for '%s' to a 'license-hashes.csv' " \
172 "and replace `Unknown` with the license:\n" \ 171 "and replace `Unknown` with the license:\n" \
173 "%s,Unknown" % (os.path.relpath(licfile, srctree + "/.."), md5value)) 172 "%s,Unknown" % (os.path.relpath(licfile, srctree + "/.."), md5value))
174 if license: 173
175 licenses.append((license, os.path.relpath(licfile, srctree), md5value)) 174 licenses.append((license, os.path.relpath(licfile, srctree), md5value))
176 175
177 return licenses 176 return licenses
178 177