Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cksum/hashsum: Support for commented lines in checksum files #6782

Merged
merged 3 commits into from
Oct 18, 2024

Conversation

RenjiSann
Copy link
Contributor

As #6603 implicitly implemented commented line support, I moved it into its own PR, with proper testing.

TL;DR:
This change make the checksum verification system ignore lines starting with #, treating them as empty lines.

Example:

$ echo 'foo-content' > foo
$ cksum --algo=sha1 foo | tee CHECKSUM
SHA1 (foo) = 058ab38dd3603703b3a7063cf95dc51a4286b6fe 

$ echo '# Comment' >> CHECKSUM 
$ cat CHECKSUM
SHA1 (foo) = 058ab38dd3603703b3a7063cf95dc51a4286b6fe
# Comment

$ cksum --check CHECKSUM
foo: OK

The changes similarly apply to hashsum and its derivatives.

Copy link

GNU testsuite comparison:

Congrats! The gnu test tests/timeout/timeout is no longer failing!

@RenjiSann
Copy link
Contributor Author

@BenWiederhake

Copy link
Contributor

@cakebaker cakebaker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, great to see more tests :)

@cakebaker cakebaker merged commit 92e67a5 into uutils:main Oct 18, 2024
68 checks passed
@cakebaker
Copy link
Contributor

Thanks :)

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