tools: Make shellcheck happy

This change proposed by RustyRussel stops a race condition on the
former `echo` line.
This commit is contained in:
Peter Neuroth 2023-09-12 09:16:40 +02:00 committed by Rusty Russell
parent 8f02678147
commit a3d393a24d

View file

@ -330,21 +330,19 @@ if [ "$VERIFY_RELEASE" = "true" ]; then
# as we compare our checksums with the release captains checksums later, but # as we compare our checksums with the release captains checksums later, but
# it gives a direct hint which specific checksums don't match if so. # it gives a direct hint which specific checksums don't match if so.
sha256sum --check --ignore-missing "${sumfile}" sha256sum --check --ignore-missing "${sumfile}"
# Creating SHA256SUMS # Creating SHA256SUMS, except Fedora (copy that from theirs)
sha256sum clightning-"$VERSION"* > SHA256SUMS grep 'bin-Fedora-28-amd64' "$sumfile" > SHA256SUMS
# Replacing Fedora checksums from root file to release/SHA256SUMS sha256sum clightning-"$VERSION"* | grep -v 'bin-Fedora-28-amd64' >> SHA256SUMS
# because we do not have reproducible builds for Fedora # compare our and release captain's SHA256SUMS contents
echo "$(head -n1 ${sumfile})\n$(head SHA256SUMS)" > SHA256SUMS if cmp -s SHA256SUMS "$sumfile"; then
# compare our and release captain's SHA256SUMS contents
if [ -f "SHA256SUMS" ] && cmp -s "SHA256SUMS" "../SHA256SUMS-$VERSION"; then
echo "SHA256SUMS are Identical" echo "SHA256SUMS are Identical"
else else
echo "Error: SHA256SUMS do NOT Match" echo "Error: SHA256SUMS do NOT Match"
exit 1 exit 1
fi fi
# verify release captain signature # verify release captain signature
gpg --verify "../SHA256SUMS-$VERSION.asc" gpg --verify "../SHA256SUMS-$VERSION.asc"
# create ASCII-armored detached signature # create ASCII-armored detached signature
gpg -sb --armor < SHA256SUMS > SHA256SUMS.new gpg -sb --armor < SHA256SUMS > SHA256SUMS.new
echo "Verified Successfully! Signature Updated in release/SHA256SUMS.new" echo "Verified Successfully! Signature Updated in release/SHA256SUMS.new"
fi fi