Skip to content

Commit 8375be2

Browse files
committed
sbom: T8542: chnage result filenames to match ISO image filename
1 parent 8669f15 commit 8375be2

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

scripts/image-build/build-vyos-image

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -729,23 +729,25 @@ Pin-Priority: 600
729729
# Now create SBOM
730730
syft_target_dir = 'chroot'
731731
syft_base_path = os.getcwd() + f'/{syft_target_dir}'
732+
base_filename = iso_file.rstrip('.iso')
732733
cmd = [['syft', syft_target_dir,
733734
'--source-name', 'VyOS', '--source-version', version,
734-
'-o', f'cyclonedx-json=vyos-{version}.cdx.json',
735-
'-o', f'spdx-json=vyos-{version}.spdx.json']]
735+
'-o', f'cyclonedx-json={base_filename}.cdx.json',
736+
'-o', f'spdx-json={base_filename}.spdx.json']]
736737

737738
# syft bug for CycloneDX https://github.com/anchore/syft/issues/4592#issuecomment-4567247328
738-
cmd.append(['sed', '-i', '-e', f's@{syft_base_path}@@g', f'vyos-{version}.cdx.json'])
739-
cmd.append(['sed', '-i', '-e', f's@{syft_base_path}@//@g', f'vyos-{version}.spdx.json'])
739+
cmd.append(['sed', '-i', '-e', f's@{syft_base_path}@@g', f'{base_filename}.cdx.json'])
740+
cmd.append(['sed', '-i', '-e', f's@{syft_base_path}@//@g', f'{base_filename}.spdx.json'])
740741

741742
for c in cmd:
742-
print(c)
743743
with subprocess.Popen(c, stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
744744
text=True, bufsize=1) as p:
745745
for line in p.stdout:
746746
sys.stdout.write(line)
747747
sys.stdout.flush()
748748
p.wait()
749+
print("I: Finished SBOM generation")
750+
749751

750752
# If the flavor has `image_format = "iso"`, then the work is done.
751753
# If not, build additional flavors from the ISO.

0 commit comments

Comments
 (0)