File tree Expand file tree Collapse file tree 1 file changed +11
-10
lines changed
Expand file tree Collapse file tree 1 file changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -156,20 +156,21 @@ cd workspace/target || exit 1
156156for FILE in OpenJDK* ; do
157157 echo Creating metadata for ${FILE}
158158
159- # Skip checksum generation for SBOM files
160- if [[ " $FILE " == * sbom.json ]]; then
161- echo " Skipping checksum generation for SBOM: $FILE "
162- sha256=" "
163- else
164- sha256sum " $FILE " > " $FILE .sha256.txt"
165- sha256=$( cut -d' ' -f1 " $FILE .sha256.txt" )
159+ # Generate checksum for all files, but do not leave sbom.sha256.txt behind
160+ sha_file=" ${FILE} .sha256.txt"
161+ sha256sum " ${FILE} " > " ${sha_file} "
162+ sha256=$( cut -d' ' -f1 " ${sha_file} " )
163+
164+ # If SBOM, remove checksum file after capturing hash
165+ if [[ " $FILE " =~ .* sbom.* \. json ]]; then
166+ rm -f " ${sha_file} "
166167 fi
167168
168- # Metadata filename: SBOM files get <name>-metadata.json (consistent with naming)
169- if [[ " $FILE " == * sbom.json ]]; then
169+ # Metadata filename: SBOM files get <name>-metadata.json
170+ if [[ " $FILE " =~ . * sbom. * \ . json ]]; then
170171 metadata_file=" ${FILE% .* } -metadata.json"
171172 else
172- metadata_file=" $FILE .json"
173+ metadata_file=" ${ FILE} .json"
173174 fi
174175
175176 createMetadataFile " $metadata_file " " ${TARGET_ARCH} " " $SCM_REF " metadata/buildSource.txt metadata/version.txt " $sha256 "
You can’t perform that action at this time.
0 commit comments