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: Add --raw argument #5803

Merged
merged 8 commits into from
Jan 10, 2024
Merged

cksum: Add --raw argument #5803

merged 8 commits into from
Jan 10, 2024

Conversation

D9nni
Copy link
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
Contributor

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

@D9nni
Copy link
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
Member

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 :)

Copy link

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)

src/uu/cksum/src/cksum.rs Outdated Show resolved Hide resolved
src/uu/cksum/src/cksum.rs Outdated Show resolved Hide resolved
@D9nni
Copy link
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.

Copy link

GNU testsuite comparison:

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

Copy link

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)

Copy link

GNU testsuite comparison:

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

@tertsdiepraam
Copy link
Member

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
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
61 checks passed
@sylvestre
Copy link
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