From 854ebdf7d57e30f5aef154a7ad9cbefa031514bd Mon Sep 17 00:00:00 2001 From: Andrew Hughes Date: Tue, 14 Jul 2026 23:18:20 +0100 Subject: [PATCH] Cleanup tagging and gating scripts to appease shellcheck: * scripts/builds/build_vanilla.sh: Use an array to handle the varying arguments to rhpkg. * scripts/builds/check_signatures.sh: Quote variable usage. * scripts/builds/waive_issue.sh: Remove redundant 'test "x"' usage. * scripts/builds/waive_leapp_issue.sh: Likewise. * scripts/builds/waive_rpminspect.sh: Likewise. * scripts/builds/waive_usual_rpminspect.sh: Likewise and add missing WORKING_DIR variable. * scripts/builds/waive_usual_tier0.sh: Remove redundant 'test "x"' usage. Related: RHEL-212332 Related: RHEL-212336 --- java-21-openjdk.spec | 8 ++++++++ scripts/builds/build_vanilla.sh | 22 +++++++++++++--------- scripts/builds/check_signatures.sh | 12 ++++++------ scripts/builds/waive_issue.sh | 8 ++++---- scripts/builds/waive_leapp_issue.sh | 4 ++-- scripts/builds/waive_rpminspect.sh | 4 ++-- scripts/builds/waive_usual_rpminspect.sh | 6 ++++-- scripts/builds/waive_usual_tier0.sh | 4 ++-- 8 files changed, 41 insertions(+), 27 deletions(-) diff --git a/java-21-openjdk.spec b/java-21-openjdk.spec index 9a192bc..523a84f 100644 --- a/java-21-openjdk.spec +++ b/java-21-openjdk.spec @@ -2575,6 +2575,14 @@ cjc.mainProgram(args) - Update tagging scripts to include signature checks and correctly handle gating - Update tagged versions to include 9.8.0-z, 9.9.0, 10.2-z & 10.3. - Add gating scripts to simplify obtaining results and waiving issues +- Cleanup tagging and gating scripts to appease shellcheck: +- * scripts/builds/build_vanilla.sh: Use an array to handle the varying arguments to rhpkg. +- * scripts/builds/check_signatures.sh: Quote variable usage. +- * scripts/builds/waive_issue.sh: Remove redundant 'test "x"' usage. +- * scripts/builds/waive_leapp_issue.sh: Likewise. +- * scripts/builds/waive_rpminspect.sh: Likewise. +- * scripts/builds/waive_usual_rpminspect.sh: Likewise and add missing WORKING_DIR variable. +- * scripts/builds/waive_usual_tier0.sh: Remove redundant 'test "x"' usage. - Resolves: RHEL-212332 - Resolves: RHEL-212334 - Resolves: RHEL-212336 diff --git a/scripts/builds/build_vanilla.sh b/scripts/builds/build_vanilla.sh index c4f67f7..933f8c8 100755 --- a/scripts/builds/build_vanilla.sh +++ b/scripts/builds/build_vanilla.sh @@ -1,6 +1,6 @@ -#!/bin/sh +#!/bin/bash -# Copyright (C) 2024 Red Hat, Inc. +# Copyright (C) 2026 Red Hat, Inc. # Written by: # Andrew John Hughes # @@ -20,20 +20,24 @@ # Builds a scratch build of vanilla OpenJDK with no local patches SEPARATE_ARCHES=${1} -CMD="--target java-openjdk-rhel-8-build --skip-nvr-check --nowait"; +CMD=(rhpkg -v build --target java-openjdk-rhel-8-build --skip-nvr-check --nowait); SUPPORTED_ARCHES="aarch64 ppc64le s390x x86_64"; -if [ "x${SEPARATE_ARCHES}" = "x" ] ; then +if [ "${SEPARATE_ARCHES}" = "" ] ; then SEPARATE_ARCHES=0; fi -if [ ${SEPARATE_ARCHES} -eq 1 ] ; then - for arch in ${SUPPORTED_ARCHES}; do \ - rhpkg -v build --arches ${arch} --scratch ${CMD} ; \ - done && brew watch-task --mine +if [ "${SEPARATE_ARCHES}" -eq 1 ] ; then + for arch in ${SUPPORTED_ARCHES}; do \ + ARCH_CMD=("${CMD[@]}" --arches "${arch}" --scratch) ; + echo "Executing ${ARCH_CMD[*]}"; + command "${ARCH_CMD[@]}"; + done else - rhpkg -v build ${CMD} && brew watch-task --mine + echo "Executing ${CMD[*]}"; + command "${CMD[@]}"; fi +brew watch-task --mine # Local Variables: # compile-command: "shellcheck build_vanilla.sh" diff --git a/scripts/builds/check_signatures.sh b/scripts/builds/check_signatures.sh index 815a97c..c6d30a3 100755 --- a/scripts/builds/check_signatures.sh +++ b/scripts/builds/check_signatures.sh @@ -43,16 +43,16 @@ if ! test -e "${BUILDINFO}" ; then exit 2; fi -if cat ${BUILDINFO} | grep -q Signatures ; then - signature=$(cat ${BUILDINFO} | grep Signatures|cut -d ' ' -f 2-|uniq -c); - uniq_count=$(echo ${signature} | wc -l); - if test ${uniq_count} -gt 1; then +if grep -q "Signatures" < "${BUILDINFO}" ; then + signature=$(grep "Signatures" < "${BUILDINFO}" | cut -d ' ' -f 2- | uniq -c | sed 's#^\W*##'); + uniq_count=$(echo "${signature}" | wc -l); + if test "${uniq_count}" -gt 1; then echo "Multiple signature types found:"; echo "${signature}"; exit 4; fi - sig_count=$(echo ${signature} | cut -d ' ' -f 1); - sig_type=$(echo ${signature} | cut -d ' ' -f 2); + sig_count=$(echo "${signature}" | cut -d ' ' -f 1); + sig_type=$(echo "${signature}" | cut -d ' ' -f 2); echo "${sig_count} signatures of type ${sig_type} found"; if echo "${sig_type}" | grep -q "${NEW_SIGNATURE}" ; then echo "PQC signature found."; diff --git a/scripts/builds/waive_issue.sh b/scripts/builds/waive_issue.sh index 71fd299..88b0f51 100755 --- a/scripts/builds/waive_issue.sh +++ b/scripts/builds/waive_issue.sh @@ -42,25 +42,25 @@ else SKIP_JSON=0; fi -if test "x${RHEL_VER}" = "x"; then +if test "${RHEL_VER}" = ""; then echo "No RHEL version specified."; echo "${0} "; exit 1; fi -if test "x${NVR}" = "x"; then +if test "${NVR}" = ""; then echo "No NVR specified."; echo "${0} "; exit 2; fi -if test "x${TESTCASE}" = "x"; then +if test "${TESTCASE}" = ""; then echo "No testcase specified."; echo "${0} "; exit 3; fi -if test "x${COMMENT}" = "x"; then +if test "${COMMENT}" = ""; then COMMENT="Gating broken"; echo "Setting COMMENT to default of '${COMMENT}'" fi diff --git a/scripts/builds/waive_leapp_issue.sh b/scripts/builds/waive_leapp_issue.sh index 2dc3e71..a556070 100755 --- a/scripts/builds/waive_leapp_issue.sh +++ b/scripts/builds/waive_leapp_issue.sh @@ -24,13 +24,13 @@ NVR=${2} WORKING_DIR=$(dirname "${0}") -if test "x${RHEL_VER}" = "x"; then +if test "${RHEL_VER}" = ""; then echo "No RHEL version specified."; echo "${0} "; exit 1; fi -if test "x${NVR}" = "x"; then +if test "${NVR}" = ""; then echo "No NVR specified."; echo "${0} "; exit 2; diff --git a/scripts/builds/waive_rpminspect.sh b/scripts/builds/waive_rpminspect.sh index 453b892..7912b94 100755 --- a/scripts/builds/waive_rpminspect.sh +++ b/scripts/builds/waive_rpminspect.sh @@ -25,13 +25,13 @@ COMMENT=${3} WORKING_DIR=$(dirname "${0}") -if test "x${RHEL_VER}" = "x"; then +if test "${RHEL_VER}" = ""; then echo "No RHEL version specified."; echo "${0} "; exit 1; fi -if test "x${NVR}" = "x"; then +if test "${NVR}" = ""; then echo "No NVR specified."; echo "${0} "; exit 2; diff --git a/scripts/builds/waive_usual_rpminspect.sh b/scripts/builds/waive_usual_rpminspect.sh index 5b4f26d..49ec4f8 100755 --- a/scripts/builds/waive_usual_rpminspect.sh +++ b/scripts/builds/waive_usual_rpminspect.sh @@ -20,16 +20,18 @@ # Waive the recurring rpminspect gating issues # Should be resolved by RHELPLAN-102267 +WORKING_DIR=$(dirname "${0}") + RHEL_VER=${1} NVR=${2} -if test "x${RHEL_VER}" = "x"; then +if test "${RHEL_VER}" = ""; then echo "No RHEL version specified."; echo "${0} "; exit 1; fi -if test "x${NVR}" = "x"; then +if test "${NVR}" = ""; then echo "No NVR specified."; echo "${0} "; exit 2; diff --git a/scripts/builds/waive_usual_tier0.sh b/scripts/builds/waive_usual_tier0.sh index 6e06564..94227a6 100755 --- a/scripts/builds/waive_usual_tier0.sh +++ b/scripts/builds/waive_usual_tier0.sh @@ -25,13 +25,13 @@ NVR=${2} WORKING_DIR=$(dirname "${0}") -if test "x${RHEL_VER}" = "x"; then +if test "${RHEL_VER}" = ""; then echo "No RHEL version specified."; echo "${0} "; exit 1; fi -if test "x${NVR}" = "x"; then +if test "${NVR}" = ""; then echo "No NVR specified."; echo "${0} "; exit 2;