aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorfanquake <fanquake@gmail.com>2021-08-20 15:10:15 +0800
committerfanquake <fanquake@gmail.com>2021-08-20 15:10:26 +0800
commitd3169349a9ecb385dd6af4a2d3bac78cf29e5d64 (patch)
tree21c0ac78601250d6dd52294ec07967e7f10e4382 /contrib
parent602c8eb8f0fb1a09ba44b8a744c4aaf3f8a6a78a (diff)
parent132cae44f2d031bdaa1e459b92ec89ad585dfc9f (diff)
downloadbitcoin-d3169349a9ecb385dd6af4a2d3bac78cf29e5d64.tar.xz
Merge bitcoin/bitcoin#22654: guix: Don't include directory name in SHA256SUMS
132cae44f2d031bdaa1e459b92ec89ad585dfc9f doc: Mention the flat directory structure for uploads (Andrew Chow) fb17c99e35e72f3b21ec3b5473e84c21dc964776 guix: Don't include directory name in SHA256SUMS (Andrew Chow) Pull request description: The SHA256SUMS file can be used in a sha256sum -c command to verify downloaded binaries. However users are likely to download just a single file and not place this file in the correct directory relative to the SHA256SUMS file for the simple verification command to work. By not including the directory name in the SHA256SUMS file, it will be easier for users to verify downloaded binaries. ACKs for top commit: Zero-1729: re-ACK 132cae44f2d031bdaa1e459b92ec89ad585dfc9f fanquake: ACK 132cae44f2d031bdaa1e459b92ec89ad585dfc9f Tree-SHA512: c9ff416b8dfb2f3ceaf4d63afb84aac9fcaefbbf9092f9e095061b472884ec92c7a809e6530c7132a82cfe3ab115a7328e47994a412072e1d4feb26fc502c8c5
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/guix/guix-attest14
1 files changed, 14 insertions, 0 deletions
diff --git a/contrib/guix/guix-attest b/contrib/guix/guix-attest
index 1503c330b2..6e12cbead7 100755
--- a/contrib/guix/guix-attest
+++ b/contrib/guix/guix-attest
@@ -162,6 +162,18 @@ EOF
echo "Attesting to build outputs for version: '${VERSION}'"
echo ""
+# Given a SHA256SUMS file as stdin that has lines like:
+# 0ba536819b221a91d3d42e978be016aac918f40984754d74058aa0c921cd3ea6 a/b/d/c/d/s/bitcoin-22.0rc2-riscv64-linux-gnu.tar.gz
+# ...
+#
+# Replace each line's file name with its basename:
+# 0ba536819b221a91d3d42e978be016aac918f40984754d74058aa0c921cd3ea6 bitcoin-22.0rc2-riscv64-linux-gnu.tar.gz
+# ...
+#
+basenameify_SHA256SUMS() {
+ sed -E 's@(^[[:xdigit:]]{64}[[:space:]]+).+/([^/]+$)@\1\2@'
+}
+
outsigdir="$GUIX_SIGS_REPO/$VERSION/$signer_name"
mkdir -p "$outsigdir"
(
@@ -174,6 +186,7 @@ mkdir -p "$outsigdir"
cat "${noncodesigned_fragments[@]}" \
| sort -u \
| sort -k2 \
+ | basenameify_SHA256SUMS \
> "$temp_noncodesigned"
if [ -e noncodesigned.SHA256SUMS ]; then
# The SHA256SUMS already exists, make sure it's exactly what we
@@ -201,6 +214,7 @@ mkdir -p "$outsigdir"
cat "${sha256sum_fragments[@]}" \
| sort -u \
| sort -k2 \
+ | basenameify_SHA256SUMS \
> "$temp_all"
if [ -e all.SHA256SUMS ]; then
# The SHA256SUMS already exists, make sure it's exactly what we