From f14605cf3562d883475cdc6daf0b669f2139654f Mon Sep 17 00:00:00 2001 From: Armin Samii Date: Tue, 3 Sep 2024 16:28:16 -0400 Subject: [PATCH] debugging info in golden hash file (#873) * debugging info in golden hash file * reverse release build on this branch --- .github/actions/sha-of-zip.bat | 7 ++++--- .github/actions/sha-of-zip.sh | 8 ++++++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/actions/sha-of-zip.bat b/.github/actions/sha-of-zip.bat index 5ccc7262d..281911594 100644 --- a/.github/actions/sha-of-zip.bat +++ b/.github/actions/sha-of-zip.bat @@ -58,8 +58,9 @@ powershell -Command "& {[IO.File]::WriteAllText(\"%HASHFILE_SORTED%\", $([IO.Fil :: echo the final hash C:\Windows\System32\certutil.exe -hashfile %HASHFILE_SORTED% SHA%SHA_A% | findstr /v ":" -:: For debugging, enable printing the file-by-file hash -:: echo File-by-file hash -:: type "%HASHFILE_SORTED%" +:: For easier debugging, print the file-by-file hash +echo ########## +echo This checksum was created by a SHA-%SHA_A% of the following file, after removing the filenames and sorting by their SHAs: +sort "%HASHFILE_SORTED%" endlocal diff --git a/.github/actions/sha-of-zip.sh b/.github/actions/sha-of-zip.sh index cd59b680d..a757a974c 100755 --- a/.github/actions/sha-of-zip.sh +++ b/.github/actions/sha-of-zip.sh @@ -15,7 +15,9 @@ parentPath=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P ) # Make a temporary directory to extract zip, and a temporary file to hold SHAs tempDirectory=$(mktemp -d) tempAllChecksumsFile=$(mktemp) +tempChecksumDebugInfoFile=$(mktemp) touch $tempAllChecksumsFile +touch $tempChecksumDebugInfoFile # Extract the zip unzip -q $zipFilepath -d $tempDirectory 2>/dev/null @@ -25,7 +27,13 @@ cd $tempDirectory for filename in $(find * -type f | sort); do checksum=$($parentPath/../workflows/sha.sh $filename $os $sha_a) echo $checksum >> $tempAllChecksumsFile + echo $filename = $checksum >> $tempChecksumDebugInfoFile done # Echo the checksum of the checksums echo $($parentPath/../workflows/sha.sh $tempAllChecksumsFile $os $sha_a) + +# For easier debugging, print the file-by-file hash +echo "##########" +echo "This checksum was created by a SHA-$sha_a of the following file, after removing the filenames and sorting by their SHAs:" +cat $tempChecksumDebugInfoFile | sort