From 569ba0d1ba7005f1379bd1d8e52a5dac9bdf920b Mon Sep 17 00:00:00 2001 From: Stewart X Addison Date: Tue, 31 Oct 2023 17:56:53 +0000 Subject: [PATCH] Shut up linter because I don't agree with it Signed-off-by: Stewart X Addison --- tooling/release_download_test.sh | 11 ++++++++--- tooling/validateSBOMcontent.sh | 6 ++++-- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/tooling/release_download_test.sh b/tooling/release_download_test.sh index 9d1033933..3d6e084e6 100755 --- a/tooling/release_download_test.sh +++ b/tooling/release_download_test.sh @@ -32,7 +32,7 @@ else fi echo "$(date +%T) : IVT : I will be checking https://github.com/adoptium/temurin${MAJOR_VERSION}-binaries/releases/tag/$TAG" -if [ -z "${MAJOR_VERSION}" -o -z "${TAG}" ]; then +if [ -z "${MAJOR_VERSION}" ] || [ -z "${TAG}" ]; then echo "MAJOR_VERSION or TAG undefined - aborting" exit 1 fi @@ -59,6 +59,7 @@ fi # Parse the releases list for the one we want and download everything in it # shellcheck disable=SC2013 for URL in $(grep "$FILTER" "$WORKSPACE/jdk${MAJOR_VERSION}.txt" | awk -F'"' '/browser_download_url/{print$4}'); do + # shellcheck disable=SC2046 [ "$VERBOSE" = "true" ] && echo Downloading $(basename "$URL") curl -LORsS "$URL" done @@ -74,6 +75,7 @@ export GNUPGHOME="$WORKSPACE/.gpg-temp" rm -rf "$GNUPGHOME" mkdir -p "$GNUPGHOME" && chmod og-rwx "$GNUPGHOME" gpg -q --keyserver keyserver.ubuntu.com --recv-keys "${GPGID}" || exit 1 +# shellcheck disable=SC3037 /bin/echo -e "5\ny\nq\n" | gpg -q --batch --command-fd 0 --expert --edit-key "${GPGID}" trust || exit 1 RC=0 @@ -131,6 +133,7 @@ if ! strings tarballtest/bin/java | grep ^GLIBC_2.17 > /dev/null; then RC=4 fi +# shellcheck disable=SC2166 [ "${MAJOR_VERSION}" = "8" -o "${MAJOR_VERSION}" = "11" ] && EXPECTED_GCC=7.5 [ "${MAJOR_VERSION}" = "17" ] && EXPECTED_GCC=10.3 [ "${MAJOR_VERSION}" -ge 20 ] && EXPECTED_GCC=11.2 @@ -148,15 +151,17 @@ if [ "$(sha256sum cyclonedx-linux-arm64 | cut -d' ' -f1)" != "eaac307ca4d7f3ee2a exit 1 fi chmod 700 cyclonedx-linux-* -cd "$STARTDIR" +cd "$STARTDIR" || exit 1 +# shellcheck disable=SC2010 for SBOM in $(ls -1 staging/"$TAG"/OpenJDK*-sbom*json | grep -v metadata); do echo "$(date +%T) : IVT : Validating $SBOM ..." if ! staging/"$TAG"/cyclonedx-linux-arm64 validate --input-file "$SBOM"; then echo "ERROR: Failed CycloneDX validation check" RC=5 fi - if ! bash $(dirname "$0")/validateSBOMcontent.sh "$SBOM" "$MAJOR_VERSION" "$TAG"; then + # shellcheck disable=SC2086 + if ! bash "$(dirname $0)/validateSBOMcontent.sh" "$SBOM" "$MAJOR_VERSION" "$TAG"; then echo "ERROR: Failed checks on $SBOM" RC=6 fi diff --git a/tooling/validateSBOMcontent.sh b/tooling/validateSBOMcontent.sh index f8feb2126..1807ae891 100755 --- a/tooling/validateSBOMcontent.sh +++ b/tooling/validateSBOMcontent.sh @@ -68,6 +68,7 @@ elif echo "$SBOMFILE" | grep _x86-32_windows_; then elif echo "$SBOMFILE" | grep _mac_; then # NOTE: mac/x64 native builds >=11 were using "clang (clang/LLVM from Xcode 10.3)" EXPECTED_COMPILER="clang (clang/LLVM from Xcode 12.4)" + # 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" @@ -86,11 +87,11 @@ echo "BOOTJDK is ${BOOTJDK}" # Freetype versions are inconsistent at present - see build#3484 #[ "${FREETYPE}" != "$EXPECTED_FREETYPE" ] && echo "ERROR: FreeType version not ${EXPECTED_FREETYPE} (SBOM has ${FREETYPE})" && RC=1 - # shellcheck disable=SC2086 +# shellcheck disable=SC2086 [ -n "$(echo $FREETYPE | tr -d '[0-9]\.')" ] && echo "ERROR: FreeType version not a valid number (SBOM has ${FREETYPE})" && RC=1 echo "FREETYPE is ${FREETYPE}" [ "${FREEMARKER}" != "$EXPECTED_FREEMARKER" ] && echo "ERROR: Freemarker version not ${EXPECTED_FREEMARKER} (SBOM has ${FREEMARKER})" && RC=1 - +# shellcheck disable=SC3037 echo -n "Checking for JDK source SHA validity: " GITSHA=$(jq '.components[].properties[] | select(.name|test("OpenJDK Source Commit")) | .value' "$1" | tr -d \") GITREPO=$(echo "$GITSHA" | cut -d/ -f1-5) @@ -100,6 +101,7 @@ if ! git ls-remote "${GITREPO}" | grep "${GITSHA}"; then RC=1 fi +# shellcheck disable=SC3037 echo -n "Checking for temurin-build SHA validity: " GITSHA=$(jq '.components[].properties[] | select(.name|test("Temurin Build Ref")) | .value' "$1" | tr -d \") GITREPO=$(echo "$GITSHA" | cut -d/ -f1-5)