mirror of
https://gitlab.com/buildroot.org/buildroot.git
synced 2026-08-01 21:23:51 -09:00
utils/generate-cyclonedx: fix hash_file location
The 'show-info' output always the location relative to the Buildroot
root directory.
When running 'generate-cyclonedx' outside of the Buildroot root
directory the hash file locations are not correct. Only using the
'hash_file' variable coming from 'show-info' doesn't guarantee the
script to succeed.
Use the 'brpath' variable to correctly reference the absolute path.
Fixes: 1791b79422 utils/generate-cyclonedx: add hashes from .hash files to externalReferences
Signed-off-by: Thomas Perale <thomas.perale@mind.be>
Signed-off-by: Arnout Vandecappelle <arnout@rnout.be>
This commit is contained in:
committed by
Arnout Vandecappelle
parent
92cdec5a54
commit
2df4f1d573
@@ -302,7 +302,7 @@ def cyclonedx_source_hashes(comp, source):
|
||||
|
||||
hashes = []
|
||||
for hash_file in comp.get("hashes", []):
|
||||
with Path(hash_file).open() as f:
|
||||
with (brpath / hash_file).open() as f:
|
||||
for line in f:
|
||||
line = line.strip()
|
||||
if not line.startswith("#") and line.endswith(f" {source}"):
|
||||
|
||||
Reference in New Issue
Block a user