Skip to content

Commit ac33e9d

Browse files
committed
do not write empty diff lines
1 parent f902e90 commit ac33e9d

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

etc/bin/verify-reproducible.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,13 @@ cd "${DOWNLOAD_LOCATION}/${PROJECT_NAME}/etc/bin/results"
9090
echo "Checking for differences in checksums"
9191
# diff -u CHECKSUMS second.txt
9292
DIFF_RESULTS=$(comm -3 <(sort ../../../CHECKSUMS) <(sort second.txt) | cut -d' ' -f1 | sed 's/^[[:space:]]*//;s/[[:space:]]*$//' | grep -v '^$' | uniq | sort)
93-
echo "$DIFF_RESULTS" > diff.txt
93+
echo "${DIFF_RESULTS}" > diff.txt
94+
95+
if [ -n "${DIFF_RESULTS}" ]; then
96+
echo "${DIFF_RESULTS}" > diff.txt
97+
else
98+
> diff.txt # Empty the file explicitly
99+
fi
94100

95101
if [ -s diff.txt ]; then
96102
echo "Differences were found, diffing jar files ..."
@@ -104,7 +110,7 @@ if [ -s diff.txt ]; then
104110
fi
105111

106112
while IFS= read -r jar_file; do
107-
echo "Checking jar ${jar_file}..."
113+
echo "Checking jar '${jar_file}'..."
108114

109115
echo "Extracting ${jar_file}"
110116
"${SCRIPT_DIR}/extract-build-artifact.sh" "${jar_file}" "${DOWNLOAD_LOCATION}/${PROJECT_NAME}/etc/bin/results"

0 commit comments

Comments
 (0)