Skip to content

Commit

Permalink
Ensure SBOM BOOTJDK is full version including build
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Leonard <anleonar@redhat.com>
  • Loading branch information
andrew-m-leonard committed Aug 1, 2023
1 parent d198af5 commit 2681d93
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions sbin/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -934,9 +934,16 @@ addGCC() {
}

addBootJDK() {
echo "Checking and getting BootJDK Version:"
inputConfigFile="${BUILD_CONFIG[WORKSPACE_DIR]}/${BUILD_CONFIG[TARGET_DIR]}/metadata/configure.txt"
addSBOMMetadataTools "${javaHome}" "${classpath}" "${sbomJson}" "BOOTJDK" "$(sed -n '/^Tools summary:$/,$p' "${inputConfigFile}" | grep "Boot JDK:" | tr -s " " | cut -d " " -f 6)"

local bootjdk
if [ "${BUILD_CONFIG[OS_KERNEL_NAME]}" == "darwin" ]; then
bootjdk=$(sed -n '/^Tools summary:$/,$p' "${inputConfigFile}" | grep "Boot JDK:" | sed -E "s/^.*build ([^),]+).*/\1/" | sed "s/\-beta//g" | sed "s/\-.*//g")
else
bootjdk=$(sed -n '/^Tools summary:$/,$p' "${inputConfigFile}" | grep "Boot JDK:" | sed "s/^.*build \([^),]\+\).*/\1/" | sed "s/\-beta//g" | sed "s/\-.*//g")
fi
echo "Adding BOOTJDK to SBOM: ${bootjdk}"
addSBOMMetadataTools "${javaHome}" "${classpath}" "${sbomJson}" "BOOTJDK" "${bootjdk}"
}

getGradleJavaHome() {
Expand Down

0 comments on commit 2681d93

Please sign in to comment.