You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@grails.apache.org by jd...@apache.org on 2025/05/31 07:02:39 UTC
(grails-core) 03/04: [skip ci] add output & handle running script from a different location
This is an automated email from the ASF dual-hosted git repository.
jdaugherty pushed a commit to branch 7.0.x
in repository https://gitbox.apache.org/repos/asf/grails-core.git
commit 138e908f51bad5a01635adbd2414053370d05e5d
Author: James Daugherty <jd...@jdresources.net>
AuthorDate: Sat May 31 03:02:00 2025 -0400
[skip ci] add output & handle running script from a different location
---
etc/bin/verify-reproducible.sh | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/etc/bin/verify-reproducible.sh b/etc/bin/verify-reproducible.sh
index cc3072cf69..4c914bb6d4 100755
--- a/etc/bin/verify-reproducible.sh
+++ b/etc/bin/verify-reproducible.sh
@@ -31,6 +31,7 @@ cleanup() {
trap cleanup ERR
cd "${DOWNLOAD_LOCATION}/grails"
+echo "Searching under ${DOWNLOAD_LOCATION}"
mkdir -p "${DOWNLOAD_LOCATION}/grails/etc/bin/results"
if [[ -f "${DOWNLOAD_LOCATION}/grails/CHECKSUMS" ]]; then
@@ -60,14 +61,21 @@ cd grails-gradle
./gradlew publishToMavenLocal --rerun-tasks -PskipTests --no-build-cache
cd ..
./gradlew publishToMavenLocal --rerun-tasks -PskipTests --no-build-cache
-"${SCRIPT_DIR}/generate-build-artifact-hashes.groovy" > "${DOWNLOAD_LOCATION}/grails/etc/bin/results/second.txt"
+echo "Generating Checksums for Built Jars"
+"${SCRIPT_DIR}/generate-build-artifact-hashes.groovy" "${DOWNLOAD_LOCATION}/grails" > "${DOWNLOAD_LOCATION}/grails/etc/bin/results/second.txt"
+if [ -e "${DOWNLOAD_LOCATION}/grails/etc/bin/results/second.txt" ] && [ ! -s "${DOWNLOAD_LOCATION}/grails/etc/bin/results/second.txt" ]; then
+ echo "❌ Error: Could not find any checksums for built jar files!"
+ exit 1
+fi
+echo "Flattening Checksum file"
## Flatten the jar files since our published artifacts are flat
tmpfile=$(mktemp)
while read -r filepath checksum; do
printf '%s %s\n' "$(basename "$filepath")" "$checksum"
done < "${DOWNLOAD_LOCATION}/grails/etc/bin/results/second.txt" > "$tmpfile" && mv "$tmpfile" "${DOWNLOAD_LOCATION}/grails/etc/bin/results/second.txt"
+echo "Filtering non-published jars"
# filter to only published jars to compare against
cut -d' ' -f1 "${DOWNLOAD_LOCATION}/grails/CHECKSUMS" | grep -Ff - "${DOWNLOAD_LOCATION}/grails/etc/bin/results/second.txt" > "${DOWNLOAD_LOCATION}/grails/etc/bin/results/filtered.txt"
rm -f "${DOWNLOAD_LOCATION}/grails/etc/bin/results/second.txt"
@@ -78,6 +86,7 @@ find . -path ./etc -prune -o -type f -path '*/build/libs/*.jar' ! -name "buildSr
cd "${DOWNLOAD_LOCATION}/grails/etc/bin/results"
+echo "Checking for differences in checksums"
# diff -u CHECKSUMS second.txt
DIFF_RESULTS=$(comm -3 <(sort ../../../CHECKSUMS) <(sort second.txt) | cut -d' ' -f1 | sed 's/^[[:space:]]*//;s/[[:space:]]*$//' | uniq | sort)
echo "$DIFF_RESULTS" > diff.txt