Skip to content

cksum: Add --raw argument#5803

Merged
sylvestre merged 8 commits intouutils:mainfrom
D9nni:cksum
Jan 10, 2024
Merged

cksum: Add --raw argument#5803
sylvestre merged 8 commits intouutils:mainfrom
D9nni:cksum

Conversation

@D9nni
Copy link
Copy Markdown
Contributor

@D9nni D9nni commented Jan 7, 2024

Should close #5708

This adds the --raw argument. I also added the CkSumError enum to handle error of RawMultipleFiles.

--raw emit a raw binary digest, not hexadecimal

@sylvestre
Copy link
Copy Markdown
Contributor

Could you please add tests in https://github.com/uutils/coreutils/blob/main/tests/by-util/test_cksum.rs ? thanks

@D9nni
Copy link
Copy Markdown
Contributor Author

D9nni commented Jan 8, 2024

I added the tests, but I have a problem with test_raw_single_file, it tells me that opening of the expected stdout failed.

@uutils uutils deleted a comment from github-actions bot Jan 8, 2024
@tertsdiepraam
Copy link
Copy Markdown
Collaborator

I think you forgot to commit the raw_single_file.expected file in the tests/fixtures/cksum folder. It can't find a file it doesn't know about :)

@github-actions
Copy link
Copy Markdown

github-actions bot commented Jan 8, 2024

GNU testsuite comparison:

Skipping an intermittent issue tests/tail/inotify-dir-recreate (passes in this run but fails in the 'main' branch)

@D9nni
Copy link
Copy Markdown
Contributor Author

D9nni commented Jan 9, 2024

Now I made it to work for the other algorithms but it has problems for crc, bsd, and sysv. I think this is because the output for those algorithms isn't generated using encode(). I tried to use parse:: on these cases, but it doesn't seem to work. I will try again, but I would appreciate any suggestions.

@github-actions
Copy link
Copy Markdown

GNU testsuite comparison:

Skip an intermittent issue tests/tail/inotify-dir-recreate (fails in this run but passes in the 'main' branch)

@github-actions
Copy link
Copy Markdown

GNU testsuite comparison:

Congrats! The gnu test tests/cksum/cksum-raw is no longer failing!
Skipping an intermittent issue tests/tail/inotify-dir-recreate (passes in this run but fails in the 'main' branch)

@github-actions
Copy link
Copy Markdown

GNU testsuite comparison:

Congrats! The gnu test tests/cksum/cksum-raw is no longer failing!

@tertsdiepraam
Copy link
Copy Markdown
Collaborator

Now I made it to work for the other algorithms but it has problems for crc, bsd, and sysv. I think this is because the output for those algorithms isn't generated using encode(). I tried to use parse:: on these cases, but it doesn't seem to work. I will try again, but I would appreciate any suggestions.

Is this fixed now? The code looks good to me.

@D9nni
Copy link
Copy Markdown
Contributor Author

D9nni commented Jan 10, 2024

Now I made it to work for the other algorithms but it has problems for crc, bsd, and sysv. I think this is because the output for those algorithms isn't generated using encode(). I tried to use parse:: on these cases, but it doesn't seem to work. I will try again, but I would appreciate any suggestions.

Is this fixed now? The code looks good to me.

Yes, I fixed it and I think it works fine now.

@sylvestre sylvestre merged commit 19a9380 into uutils:main Jan 10, 2024
@sylvestre
Copy link
Copy Markdown
Contributor

kudos for Congrats! The gnu test tests/cksum/cksum-raw is no longer failing!

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.

Implement cksum --raw

4 participants