Skip to content

Commit 5dd78df

Browse files
fanquakeknst
authored andcommitted
Merge bitcoin#22654: guix: Don't include directory name in SHA256SUMS
132cae4 doc: Mention the flat directory structure for uploads (Andrew Chow) fb17c99 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 132cae4 fanquake: ACK 132cae4 Tree-SHA512: c9ff416b8dfb2f3ceaf4d63afb84aac9fcaefbbf9092f9e095061b472884ec92c7a809e6530c7132a82cfe3ab115a7328e47994a412072e1d4feb26fc502c8c5
1 parent ec41e16 commit 5dd78df

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

contrib/guix/guix-attest

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,18 @@ EOF
162162
echo "Attesting to build outputs for version: '${VERSION}'"
163163
echo ""
164164

165+
# Given a SHA256SUMS file as stdin that has lines like:
166+
# 0ba536819b221a91d3d42e978be016aac918f40984754d74058aa0c921cd3ea6 a/b/d/c/d/s/bitcoin-22.0rc2-riscv64-linux-gnu.tar.gz
167+
# ...
168+
#
169+
# Replace each line's file name with its basename:
170+
# 0ba536819b221a91d3d42e978be016aac918f40984754d74058aa0c921cd3ea6 bitcoin-22.0rc2-riscv64-linux-gnu.tar.gz
171+
# ...
172+
#
173+
basenameify_SHA256SUMS() {
174+
sed -E 's@(^[[:xdigit:]]{64}[[:space:]]+).+/([^/]+$)@\1\2@'
175+
}
176+
165177
outsigdir="$GUIX_SIGS_REPO/$VERSION/$signer_name"
166178
mkdir -p "$outsigdir"
167179
(
@@ -174,6 +186,7 @@ mkdir -p "$outsigdir"
174186
cat "${noncodesigned_fragments[@]}" \
175187
| sort -u \
176188
| sort -k2 \
189+
| basenameify_SHA256SUMS \
177190
> "$temp_noncodesigned"
178191
if [ -e noncodesigned.SHA256SUMS ]; then
179192
# The SHA256SUMS already exists, make sure it's exactly what we
@@ -202,6 +215,7 @@ mkdir -p "$outsigdir"
202215
| sort -u \
203216
| sort -k2 \
204217
| sed 's/$/\r/' \
218+
| basenameify_SHA256SUMS \
205219
> "$temp_codesigned"
206220
if [ -e codesigned.SHA256SUMS ]; then
207221
# The SHA256SUMS already exists, make sure it's exactly what we

doc/release-process.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,15 +163,24 @@ cat "$VERSION"/*/all.SHA256SUMS.asc > SHA256SUMS.asc
163163
```
164164

165165
- Upload to the dash.org server:
166-
1. The contents of /dash/guix-build-${VERSION}/output`, except for
166+
1. The contents of each `./dash/guix-build-${VERSION}/output/${HOST}/` directory, except for
167167
`*-debug*` files.
168168

169+
Guix will output all of the results into host subdirectories, but the SHA256SUMS
170+
file does not include these subdirectories. In order for downloads via torrent
171+
to verify without directory structure modification, all of the uploaded files
172+
need to be in the same directory as the SHA256SUMS file.
173+
169174
The `*-debug*` files generated by the guix build contain debug symbols
170175
for troubleshooting by developers. It is assumed that anyone that is
171176
interested in debugging can run guix to generate the files for
172177
themselves. To avoid end-user confusion about which file to pick, as well
173178
as save storage space *do not upload these to the dash.org server*.
174179

180+
```sh
181+
find guix-build-${VERSION}/output/ -maxdepth 2 -type f -not -name "SHA256SUMS.part" -and -not -name "*debug*" -exec scp {} user@dash.org:/var/www/bin/dash-core-${VERSION} \;
182+
```
183+
175184
2. The `SHA256SUMS` file
176185

177186
3. The `SHA256SUMS.asc` combined signature file you just created

0 commit comments

Comments
 (0)