summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@arm.com>2025-06-13 14:16:19 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-06-16 17:57:30 +0100
commit32232d2ec1f32bb0de6e9bde7c7f19a470bf6d8c (patch)
tree8cb861ed144196d0e7e1d3da9072fb233dd690c1
parent06f91813cc14e6f321feb8eee80786eadcf468b1 (diff)
downloadpoky-32232d2ec1f32bb0de6e9bde7c7f19a470bf6d8c.tar.gz
oe/license_finder: support extra hashes being passed to find_licenses
When using the license finder the caller might know some more license hashes, for example if it is updating existing metadata. Allow the caller to pass more hashes that can be used when identifying licenses. (From OE-Core rev: 9011bc307fcdccb144b75d77b36bbc5c8d4bd96d) 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.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/meta/lib/oe/license_finder.py b/meta/lib/oe/license_finder.py
index 1bdc39e1c5..16f5d7c94c 100644
--- a/meta/lib/oe/license_finder.py
+++ b/meta/lib/oe/license_finder.py
@@ -145,10 +145,11 @@ def find_license_files(srctree, first_only=False):
145 return licfiles 145 return licfiles
146 146
147 147
148def match_licenses(licfiles, srctree, d): 148def match_licenses(licfiles, srctree, d, extra_hashes={}):
149 md5sums = {} 149 md5sums = {}
150 md5sums.update(_load_hash_csv(d)) 150 md5sums.update(_load_hash_csv(d))
151 md5sums.update(_crunch_known_licenses(d)) 151 md5sums.update(_crunch_known_licenses(d))
152 md5sums.update(extra_hashes)
152 153
153 licenses = [] 154 licenses = []
154 for licfile in sorted(licfiles): 155 for licfile in sorted(licfiles):
@@ -169,9 +170,9 @@ def match_licenses(licfiles, srctree, d):
169 return licenses 170 return licenses
170 171
171 172
172def find_licenses(srctree, d, first_only=False): 173def find_licenses(srctree, d, first_only=False, extra_hashes={}):
173 licfiles = find_license_files(srctree, first_only) 174 licfiles = find_license_files(srctree, first_only)
174 licenses = match_licenses(licfiles, srctree, d) 175 licenses = match_licenses(licfiles, srctree, d, extra_hashes)
175 176
176 # FIXME should we grab at least one source file with a license header and add that too? 177 # FIXME should we grab at least one source file with a license header and add that too?
177 178