summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@arm.com>2025-06-13 14:16:16 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-06-16 17:57:30 +0100
commit0d175076fe082dd1f63e7cddde54de422e059006 (patch)
treeacd5c74963232afa05577bc1f72b5bba2123f54d
parent6496804bac3c09f99e2b7dd6a04d81e7e210f7de (diff)
downloadpoky-0d175076fe082dd1f63e7cddde54de422e059006.tar.gz
oe/license_finder: remove unused arguments in get_license_md5sums
get_license_md5sums() has two optional arguments: - static_only: if set, don't checksum the licenses in COMMON_LICENSE_DIR - linenumbers: if set, the CSV file can contain begin/end/md5 values as used in LIC_FILES_CHKSUM. Neither of these are used and complicate the logic, so remove them. (From OE-Core rev: 148e501bd4fe65e7bed68d086ba98180a9b2483c) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/lib/oe/license_finder.py23
1 files changed, 9 insertions, 14 deletions
diff --git a/meta/lib/oe/license_finder.py b/meta/lib/oe/license_finder.py
index 097b324c58..be03e5d084 100644
--- a/meta/lib/oe/license_finder.py
+++ b/meta/lib/oe/license_finder.py
@@ -14,16 +14,16 @@ import bb
14 14
15logger = logging.getLogger("BitBake.OE.LicenseFinder") 15logger = logging.getLogger("BitBake.OE.LicenseFinder")
16 16
17def get_license_md5sums(d, static_only=False, linenumbers=False): 17def get_license_md5sums(d):
18 import bb.utils 18 import bb.utils
19 import csv 19 import csv
20 md5sums = {} 20 md5sums = {}
21 if not static_only and not linenumbers: 21
22 # Gather md5sums of license files in common license dir 22 # Gather md5sums of license files in common license dir
23 commonlicdir = d.getVar('COMMON_LICENSE_DIR') 23 commonlicdir = d.getVar('COMMON_LICENSE_DIR')
24 for fn in os.listdir(commonlicdir): 24 for fn in os.listdir(commonlicdir):
25 md5value = bb.utils.md5_file(os.path.join(commonlicdir, fn)) 25 md5value = bb.utils.md5_file(os.path.join(commonlicdir, fn))
26 md5sums[md5value] = fn 26 md5sums[md5value] = fn
27 27
28 # The following were extracted from common values in various recipes 28 # The following were extracted from common values in various recipes
29 # (double checking the license against the license file itself, not just 29 # (double checking the license against the license file itself, not just
@@ -34,14 +34,9 @@ def get_license_md5sums(d, static_only=False, linenumbers=False):
34 csv_path = os.path.join(path, 'files', 'license-hashes.csv') 34 csv_path = os.path.join(path, 'files', 'license-hashes.csv')
35 if os.path.isfile(csv_path): 35 if os.path.isfile(csv_path):
36 with open(csv_path, newline='') as csv_file: 36 with open(csv_path, newline='') as csv_file:
37 fieldnames = ['md5sum', 'license', 'beginline', 'endline', 'md5'] 37 reader = csv.DictReader(csv_file, delimiter=',', fieldnames=['md5sum', 'license'])
38 reader = csv.DictReader(csv_file, delimiter=',', fieldnames=fieldnames)
39 for row in reader: 38 for row in reader:
40 if linenumbers: 39 md5sums[row['md5sum']] = row['license']
41 md5sums[row['md5sum']] = (
42 row['license'], row['beginline'], row['endline'], row['md5'])
43 else:
44 md5sums[row['md5sum']] = row['license']
45 40
46 return md5sums 41 return md5sums
47 42