From 67095c7ad6e7bafe43c18234d52cf4b05ca77ad8 Mon Sep 17 00:00:00 2001 From: Stewart X Addison Date: Mon, 19 Feb 2024 20:03:54 +0000 Subject: [PATCH] Set freetype versions Signed-off-by: Stewart X Addison --- tooling/validateSBOMcontent.sh | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/tooling/validateSBOMcontent.sh b/tooling/validateSBOMcontent.sh index 151d09cec..060a595f4 100755 --- a/tooling/validateSBOMcontent.sh +++ b/tooling/validateSBOMcontent.sh @@ -1,5 +1,4 @@ #!/bin/sh -echo SXAEC: VERBOSE=${VERBOSE} [ "$VERBOSE" = "true" ] && set -x if [ $# -lt 3 ]; then echo "Usage: $0 file.json majorversion fullversion" @@ -24,46 +23,48 @@ EXPECTED_GCC="" EXPECTED_ALSA=N.A #EXPECTED_FREETYPE=N.A # https://github.com/adoptium/temurin-build/issues/3493 #EXPECTED_FREETYPE=https://github.com/freetype/freetype/commit/86bc8a95056c97a810986434a3f268cbe67f2902 -if -EXPECTED_FREETYPE=2.8.0 if echo "$SBOMFILE" | grep _solaris_; then - #EXPECTED_FREETYPE=N.A + EXPECTED_FREETYPE=2.4.9 EXPECTED_COMPILER="solstudio (Oracle Solaris Studio)" elif echo "$SBOMFILE" | grep _aix_; then EXPECTED_COMPILER="xlc (IBM XL C/C++)" + EXPECTED_FREETYPE=2.8.0 elif echo "$SBOMFILE" | grep _alpine-linux_ > /dev/null; then - #EXPECTED_FREETYPE=N.A + EXPECTED_FREETYPE=2.11.1 EXPECTED_ALSA=1.1.6 EXPECTED_GCC=10.3.1 elif echo "$SBOMFILE" | grep _linux_; then - if [ "$MAJORVERSION" -lt 20 ] && echo "$SBOMFILE" | grep x64 > /dev/null; then + + if [ "$MAJORVERSION" -lt 20 ] && echo "$SBOMFILE" | grep x64 > /dev/null; then # CentOS6 EXPECTED_GLIBC=2.12 - elif echo "$SBOMFILE" | grep _arm_ > /dev/null; then + EXPECTED_FREETYPE=2.3.11 + elif echo "$SBOMFILE" | grep _arm_ > /dev/null; then # Ubuntu 16.04 EXPECTED_GLIBC=2.23 - else + EXPECTED_FREETYPE=2.6.1 + else # CentOS7 EXPECTED_GLIBC=2.17 + EXPECTED_FREETYPE=2.8.0 fi [ "${MAJORVERSION}" = "8" ] && EXPECTED_GCC=7.5.0 [ "${MAJORVERSION}" = "11" ] && EXPECTED_GCC=7.5.0 [ "${MAJORVERSION}" = "17" ] && EXPECTED_GCC=10.3.0 - [ "${MAJORVERSION}" -ge 20 ] && EXPECTED_GCC=11.2.0 && EXPECTED_FREETYPE=UNknown + [ "${MAJORVERSION}" -ge 20 ] && EXPECTED_GCC=11.2.0 && EXPECTED_FREETYPE=Unknown EXPECTED_ALSA=1.1.6 - #EXPECTED_FREETYPE=N.A #elif echo $SBOMFILE | grep _mac_; then # EXPECTED_COMPILER="clang (clang/LLVM from Xcode 10.3)" elif echo "$SBOMFILE" | grep _x64_windows_; then + EXPECTED_FREETYPE=2.8.1 if [ "${MAJORVERSION}" = "8" ]; then EXPECTED_COMPILER="microsoft (Microsoft Visual Studio 2017 - CURRENTLY NOT WORKING)" - #EXPECTED_FREETYPE="https://github.com/freetype/freetype/commit/ec8853cd18e1a0c275372769bdad37a79550ed66" elif [ "${MAJORVERSION}" -ge 20 ]; then EXPECTED_COMPILER="microsoft (Microsoft Visual Studio 2022)" else EXPECTED_COMPILER="microsoft (Microsoft Visual Studio 2019)" fi elif echo "$SBOMFILE" | grep _x86-32_windows_; then + EXPECTED_FREETYPE=2.5.3 if [ "${MAJORVERSION}" = "8" ]; then EXPECTED_COMPILER="microsoft (Microsoft Visual Studio 2013)" - #EXPECTED_FREETYPE="https://github.com/freetype/freetype/commit/ec8853cd18e1a0c275372769bdad37a79550ed66" elif [ "${MAJORVERSION}" = "11" ]; then EXPECTED_COMPILER="microsoft (Microsoft Visual Studio 2017)" else @@ -75,10 +76,13 @@ elif echo "$SBOMFILE" | grep _mac_; then # shellcheck disable=SC2166 if [ "${MAJORVERSION}" = "8" -o "${MAJORVERSION}" = "11" ] && echo "$SBOMFILE" | grep _x64_; then EXPECTED_COMPILER="clang (clang/LLVM)" -# EXPECTED_FREETYPE="https://github.com/freetype/freetype/commit/ec8853cd18e1a0c275372769bdad37a79550ed66" + EXPECTED_FREETYPE=2.9.1 fi fi +[ "${MAJORVERSION}" -ge 20 ] && EXPECTED_FREETYPE=Unknown + + RC=0 if echo "$SBOMFILE" | grep 'linux_'; then [ "${GLIBC}" != "$EXPECTED_GLIBC" ] && echo "ERROR: GLIBC version not ${EXPECTED_GLIBC} (SBOM has ${GLIBC})" && RC=1 @@ -99,7 +103,7 @@ echo -n "Checking for JDK source SHA validity: " GITSHA=$(jq '.components[].properties[] | select(.name|test("OpenJDK Source Commit")) | .value' "$1" | tr -d \" | uniq) GITREPO=$(echo "$GITSHA" | cut -d/ -f1-5) GITSHA=$( echo "$GITSHA" | cut -d/ -f7) -if -z $(git ls-remote "${GITREPO}" | grep "${GITSHA}"); then +if [ -z "$(git ls-remote ${GITREPO} | grep ${GITSHA})" ]; then echo "ERROR: git sha of source repo not found" RC=1 fi