Skip to content

Commit

Permalink
guix: Use DOS newlines for SHA256SUMS files
Browse files Browse the repository at this point in the history
OpenPGP specifies that plain text should use CR LF for newlines.
By doing so, it becomes possible to include the hashes directly in the .asc file.
  • Loading branch information
luke-jr committed Dec 28, 2023
1 parent 30308cc commit 767a086
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions contrib/guix/guix-attest
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,10 @@ basenameify_SHA256SUMS() {
sed -E 's@(^[[:xdigit:]]{64}[[:space:]]+).+/([^/]+$)@\1\2@'
}

unix2dos() {
sed 's/$/\r/'
}

outsigdir="$GUIX_SIGS_REPO/$VERSION/$signer_name"
mkdir -p "$outsigdir"
(
Expand All @@ -187,6 +191,7 @@ mkdir -p "$outsigdir"
| sort -u \
| sort -k2 \
| basenameify_SHA256SUMS \
| unix2dos \
> "$temp_noncodesigned"
if [ -e noncodesigned.SHA256SUMS ]; then
# The SHA256SUMS already exists, make sure it's exactly what we
Expand Down Expand Up @@ -215,6 +220,7 @@ mkdir -p "$outsigdir"
| sort -u \
| sort -k2 \
| basenameify_SHA256SUMS \
| unix2dos \
> "$temp_all"
if [ -e all.SHA256SUMS ]; then
# The SHA256SUMS already exists, make sure it's exactly what we
Expand Down

0 comments on commit 767a086

Please sign in to comment.