Skip to content

Commit 35cb196

Browse files
authored
Merge pull request #1216 from c-po/sbom-fix
sbom: T8542: bugfix shadowing cmd() function with cmd variable name
2 parents c5e5c86 + 3c26a48 commit 35cb196

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

scripts/image-build/build-vyos-image

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -730,16 +730,16 @@ Pin-Priority: 600
730730
syft_target_dir = 'chroot'
731731
syft_base_path = os.getcwd() + f'/{syft_target_dir}'
732732
base_filename = iso_file.rstrip('.iso')
733-
cmd = [['syft', syft_target_dir,
734-
'--source-name', 'VyOS', '--source-version', version,
735-
'-o', f'cyclonedx-json={base_filename}.cdx.json',
736-
'-o', f'spdx-json={base_filename}.spdx.json']]
733+
syft_cmd = [['syft', syft_target_dir,
734+
'--source-name', 'VyOS', '--source-version', version,
735+
'-o', f'cyclonedx-json={base_filename}.cdx.json',
736+
'-o', f'spdx-json={base_filename}.spdx.json']]
737737

738738
# syft bug for CycloneDX https://github.com/anchore/syft/issues/4592#issuecomment-4567247328
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'])
739+
syft_cmd.append(['sed', '-i', '-e', f's@{syft_base_path}@@g', f'{base_filename}.cdx.json'])
740+
syft_cmd.append(['sed', '-i', '-e', f's@{syft_base_path}@//@g', f'{base_filename}.spdx.json'])
741741

742-
for c in cmd:
742+
for c in syft_cmd:
743743
with subprocess.Popen(c, stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
744744
text=True, bufsize=1) as p:
745745
for line in p.stdout:

0 commit comments

Comments
 (0)