From 1f691271fd470cbf47ac1943735adc0389b31ccf Mon Sep 17 00:00:00 2001 From: Scott Fryer Date: Tue, 17 Dec 2024 20:07:52 +0000 Subject: [PATCH] Linter fix. --- .../windows_repro_build_compare.sh | 32 +++++++++++-------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/tooling/reproducible/windows_repro_build_compare.sh b/tooling/reproducible/windows_repro_build_compare.sh index 1363c3369..1ac1ac1f2 100755 --- a/tooling/reproducible/windows_repro_build_compare.sh +++ b/tooling/reproducible/windows_repro_build_compare.sh @@ -467,20 +467,26 @@ Check_UCRT_Location() { Check_And_Install_Ant() { # Check For Existence Of Required Version Of Ant - echo "Checking For Installation Of Ant Version $ANT_VERSION_ALLOWED" - if [ ! -r ${ANT_BASE_PATH}/apache-ant-${ANT_VERSION}*/bin/ant ]; then - echo "Ant Doesnt Exist At The Correct Version - Installing" - # Ant Version Not Found... Check And Create Paths - echo Downloading ant for SBOM creation: - curl https://archive.apache.org/dist/ant/binaries/apache-ant-${ANT_VERSION_REQUIRED}-bin.zip > /tmp/apache-ant-${ANT_VERSION}-bin.zip - (cd /usr/local && unzip -qn /tmp/apache-ant-${ANT_VERSION_REQUIRED}-bin.zip) - rm /tmp/apache-ant-${ANT_VERSION_REQUIRED}-bin.zip - echo Downloading ant-contrib-${ANT_CONTRIB_VERSION}: - curl -L https://sourceforge.net/projects/ant-contrib/files/ant-contrib/${ANT_CONTRIB_VERSION}/ant-contrib-${ANT_CONTRIB_VERSION}-bin.zip > /tmp/ant-contrib-${ANT_CONTRIB_VERSION}-bin.zip - (unzip -qnj /tmp/ant-contrib-${ANT_CONTRIB_VERSION}-bin.zip ant-contrib/ant-contrib-${ANT_CONTRIB_VERSION}.jar -d /usr/local/apache-ant-${ANT_VERSION}/lib) - rm /tmp/ant-contrib-${ANT_CONTRIB_VERSION}-bin.zip + ant_found=false + for ant_path in "${ANT_BASE_PATH}/apache-ant-${ANT_VERSION}"*/bin/ant; do + if [ -r "$ant_path" ]; then + ant_found=true + break + fi + done + if [ "${ant_found}" != true ]; then + echo "Ant Doesn't Exist At The Correct Version - Installing" + # Ant Version Not Found... Check And Create Paths + echo "Downloading ant for SBOM creation:" + curl -o "/tmp/apache-ant-${ANT_VERSION}-bin.zip" "https://archive.apache.org/dist/ant/binaries/apache-ant-${ANT_VERSION_REQUIRED}-bin.zip" + (cd /usr/local && unzip -qn "/tmp/apache-ant-${ANT_VERSION_REQUIRED}-bin.zip") + rm "/tmp/apache-ant-${ANT_VERSION_REQUIRED}-bin.zip" + echo "Downloading ant-contrib-${ANT_CONTRIB_VERSION}:" + curl -L -o "/tmp/ant-contrib-${ANT_CONTRIB_VERSION}-bin.zip" "https://sourceforge.net/projects/ant-contrib/files/ant-contrib/${ANT_CONTRIB_VERSION}/ant-contrib-${ANT_CONTRIB_VERSION}-bin.zip" + (unzip -qnj "/tmp/ant-contrib-${ANT_CONTRIB_VERSION}-bin.zip" "ant-contrib/ant-contrib-${ANT_CONTRIB_VERSION}.jar" -d "/usr/local/apache-ant-${ANT_VERSION}/lib") + rm "/tmp/ant-contrib-${ANT_CONTRIB_VERSION}-bin.zip" else - echo "Ant Version: ${ANT_VERSION_ALLOWED}.X Already Installed" + echo "Ant Version: ${ANT_VERSION_ALLOWED}.X Already Installed" fi echo "" # Check For Existence Of Required Version Of Ant-Contrib For Existing Ant