Skip to content

Commit

Permalink
fixing SC2002
Browse files Browse the repository at this point in the history
  • Loading branch information
judovana committed Nov 1, 2024
1 parent 90f02f2 commit 2c6b212
Showing 1 changed file with 7 additions and 14 deletions.
21 changes: 7 additions & 14 deletions tooling/compare-builds.sh
Original file line number Diff line number Diff line change
Expand Up @@ -393,14 +393,11 @@ function tapsAndJunits() {
fi
local totalDiffs
# warning, this do not work without pipefail
# shellcheck disable=SC2002
totalDiffs=$(cat "${differencesFile}" | grep "Number of" | sed "s/[^0-9]\+//" || echo "999999999") # if there is no record we need to fail
totalDiffs=$(grep "Number of" "${differencesFile}" | sed "s/[^0-9]\+//" || echo "999999999") # if there is no record we need to fail
local totalFiles
# shellcheck disable=SC2002
totalFiles=$(cat "${totalFile}" | grep "Number of" | sed "s/[^0-9]\+//" || echo "0") # if there is no record we need to fail
totalFiles=$(grep "Number of" "${totalFile}" | sed "s/[^0-9]\+//" || echo "0") # if there is no record we need to fail
local totalOnlyIn
# shellcheck disable=SC2002
totalOnlyIn=$(cat "${differencesFile}" | grep "Only in:" | sed "s/[^0-9]\+//" || echo "0") #if there is non, we eant to pass
totalOnlyIn=$(grep "Only in:" "${differencesFile}"| sed "s/[^0-9]\+//" || echo "0") #if there is non, we eant to pass
if [ "${totalDiffs}" -eq 0 ] ; then
passed=$(("${passed}"+1))
else
Expand Down Expand Up @@ -562,17 +559,13 @@ pushd "${COMPARE_WAPPER_SCRIPT_DIR}/reproducible/"
bash ./repro_compare.sh openjdk "${WORKDIR}/${JDK_INFO["first_name"]}" openjdk "${WORKDIR}/${JDK_INFO["second_name"]}" 2>&1 | tee -a "${LOG}" || GLOABL_RESULT=$?
diflog="${WORKDIR}/differences.log"
totlog="${WORKDIR}/totalfiles.log"
# shellcheck disable=SC2002
cat "${LOG}" | grep "Number of differences" -A 1 > "${diflog}"
grep "Number of differences" -A 1 "${LOG}" > "${diflog}"
echo "Warning, the files which are only in one of the JDKs may be missing in this summary:" >> "${diflog}"
set +e
# shellcheck disable=SC2002
cat "${LOG}" | grep "Only in" | sed "s|${WORKDIR}||g">> "${diflog}"
grep "Only in" "${LOG}" | sed "s|${WORKDIR}||g">> "${diflog}"
echo -n "Only in: " >> "${diflog}"
# shellcheck disable=SC2002
cat "${LOG}" | grep "Only in " | wc -l >> "${diflog}"
# shellcheck disable=SC2002
cat "${LOG}" | grep "Number of files" > "${totlog}"
grep "Only in " "${LOG}" | wc -l >> "${diflog}"
grep "Number of files" "${LOG}" > "${totlog}"
set -e
popd

Expand Down

0 comments on commit 2c6b212

Please sign in to comment.