Skip to content

Commit

Permalink
Correct SPDX ID
Browse files Browse the repository at this point in the history
SPDX ID should not contain underscore characters.

Ref - https://spdx.github.io/spdx-spec/v2.2.2/file-information/#821-description
  • Loading branch information
kstribrnAmzn committed Dec 20, 2023
1 parent 4fe6122 commit 524409d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sbom-generator/sbom_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def package_hash(file_list: str) -> str:

def file_writer(output, filepath: str, sha1: str, license: str, copyright='NOASSERTION', comment='NOASSERTION'):
output.write('FileName: .'+ filepath + '\n')
output.write('SPDXID: SPDXRef-File'+ filepath.replace('/', '-') + '\n')
output.write('SPDXID: SPDXRef-File'+ filepath.replace('/', '-').replace('_', '') + '\n')
output.write('FileChecksum: SHA1: '+ sha1 + '\n')
output.write('LicenseConcluded: '+ license + '\n')
output.write('FileCopyrightText: '+ copyright + '\n')
Expand Down

0 comments on commit 524409d

Please sign in to comment.