Skip to content

This PR fixes a misleading sha256sum warning#1

Merged
kavehtehrani merged 1 commit intokavehtehrani:mainfrom
drego85:patch-1
Dec 28, 2025
Merged

This PR fixes a misleading sha256sum warning#1
kavehtehrani merged 1 commit intokavehtehrani:mainfrom
drego85:patch-1

Conversation

@drego85
Copy link
Contributor

@drego85 drego85 commented Dec 28, 2025

Summary

This PR fixes a misleading sha256sum warning encountered during installation when verifying release artifacts.

Problem

During installation, the checksum verification step prints the following warning:

sha256sum: WARNING: 1 line is improperly formatted

even though the checksum itself is valid and the verification succeeds (OK).

This happens because the .sha256 file published in the GitHub release contains an extra empty line at the end. While harmless, sha256sum -c treats empty or malformed lines as warnings, which can confuse users and make automated installation logs appear unreliable.

Solution

The checksum verification step has been updated to normalize and sanitize the .sha256 file before passing it to sha256sum:

  • Remove potential CRLF line endings
  • Ignore empty or whitespace-only lines
  • Preserve strict checksum verification for valid entries

Summary

This PR fixes a misleading sha256sum warning encountered during installation when verifying release artifacts.

Problem

During installation, the checksum verification step prints the following warning:

sha256sum: WARNING: 1 line is improperly formatted

even though the checksum itself is valid and the verification succeeds (OK).

This happens because the .sha256 file published in the GitHub release contains an extra empty line at the end. While harmless, sha256sum -c treats empty or malformed lines as warnings, which can confuse users and make automated installation logs appear unreliable.

Motivation
	•	Avoid confusing warnings during a successful installation
	•	Make the installation script more robust against minor formatting issues in upstream .sha256 files
	•	Improve user confidence and script cleanliness without weakening security

Solution

The checksum verification step has been updated to normalize and sanitize the .sha256 file before passing it to sha256sum:
	•	Remove potential CRLF line endings
	•	Ignore empty or whitespace-only lines
	•	Preserve strict checksum verification for valid entries

The updated logic is:

echo "Verifying checksum..." >&2
# Normalize checksum file (remove CRLF) and ignore empty/whitespace-only lines
sed 's/\r$//' "${FILE}.sha256" | grep -E -v '^[[:space:]]*$' | sha256sum -c - \
  || { echo "Error: Checksum verification failed" >&2; exit 1; }

Result
	•	Checksum verification remains strict and secure
	•	No more misleading warnings during installation
	•	Script is more tolerant of minor formatting issues in release assets
@kavehtehrani kavehtehrani merged commit f3e4dd6 into kavehtehrani:main Dec 28, 2025
5 checks passed
@kavehtehrani
Copy link
Owner

Thanks Andrea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants