Skip to content

Commit 9fea01c

Browse files
committed
chromium/generate_license_list.py: Fix finding license files
Use the paths returned by find_chromium_licenses() as is as they are already relative to chromium_root. Do not use os.path.relpath() as it generates ../../../.. (...) paths. Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
1 parent 407e3ac commit 9fea01c

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

meta-chromium/recipes-browser/chromium/generate_license_list.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,13 @@ def print_license_list(chromium_root, output_file):
9393
suitable for use in a Yocto recipe."""
9494
licenses = {}
9595
for license_file in find_chromium_licenses(chromium_root):
96-
with open(license_file, 'rb') as file_handle:
96+
# Only consider relative files
97+
if license_file.startswith('/'):
98+
continue
99+
license_path = os.path.join(chromium_root, license_file)
100+
with open(license_path, 'rb') as file_handle:
97101
license_hash = hashlib.md5(file_handle.read()).hexdigest()
98-
license_relpath = os.path.relpath(license_file, chromium_root)
99-
licenses[license_relpath] = license_hash
102+
licenses[license_file] = license_hash
100103
with open(output_file, 'w') as out:
101104
out.write('LIC_FILES_CHKSUM = "\\\n')
102105
for f in sorted(licenses):

0 commit comments

Comments
 (0)