cksum family: Backport new errors for --binary, --text and --tag#10618
cksum family: Backport new errors for --binary, --text and --tag#10618oech3 wants to merge 1 commit intouutils:mainfrom
Conversation
|
GNU testsuite comparison: |
Merging this PR will not alter performance
Comparing Footnotes
|
|
GNU testsuite comparison: |
c190aaa to
557af54
Compare
This comment was marked as resolved.
This comment was marked as resolved.
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
|
See #10623 . Regression was caused by backport. |
f215b6a to
fb74f2a
Compare
|
|
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
|
Now that the GNU 9.10 is merged this should be passing right? |
|
No. still needed to strip errno from |
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
|
Surprisingly it seems that the reason cksum-c is failing is because of cat's error parsing not from cksum. |
|
Adding To line 85 in cat will make that gnu test pass |
|
I think it should be a different PR since it fixes different error. |
| if tag { | ||
| return Err(ChecksumError::TagCheck.into()); | ||
| } | ||
| if binary_flag || text_flag { |
There was a problem hiding this comment.
I think this check is invalid to have in the checksum_common library since it only applies to cksum and not the other ones like md5sum and sha256sum.
When running on the 9.10 version I'm finding that this is valid:
sha256sum --text --check file
| //todo: deduplicate matches.get_flag | ||
| let text = !matches.get_flag(options::BINARY); | ||
| let tag = matches.get_flag(options::TAG); | ||
| let format = OutputFormat::from_standalone(text, tag); |
There was a problem hiding this comment.
I'm trying to brainstorm to clean this code up and I'm wondering if its better to just pass the matches in the OutputFormat?
Then you can also move the error handling validation into there and it will make the code reduce by a bunch
|
SInce CI job's queue is filled, I want to avoid rebasing just for cleanup. We can do that later. |
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
| BinaryTextConflict, | ||
| #[error("--text mode is only supported with --untagged")] | ||
| TextWithoutUntagged, | ||
| #[error("the --tag option is meaningless when verifying checksums")] |
There was a problem hiding this comment.
can be done a different pr but it will need translate!() at some point
|
Is flakey? |
|
yes, unrelated |
Closes #10130
Closes #10623 ?