install: don't error when multiple arguments of the same type are given, instead override with last one (#8033)#8053
Merged
sylvestre merged 5 commits intouutils:mainfrom Jun 28, 2025
Merged
Conversation
…rs multiple times
…re given, instead override with last one
Contributor
Author
|
I'd appreciate a double-check on the test as I'm not sure if its comprehensive enough |
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
hz2
reviewed
Jun 14, 2025
Comment on lines
+487
to
+491
| scene | ||
| .ucmd() | ||
| .args(&[file, &format!("{dir}/{file}"), "--mode=999", "--mode=200"]) | ||
| .succeeds() | ||
| .no_stderr(); |
Contributor
There was a problem hiding this comment.
currently testing that the command continues to succeed when overridden with duplicate argument flags, might be good to test that the override is also the last one passed through?
e.g. when you test the mode (-m) maybe you can assert that the mode is what it should be?
Contributor
Author
There was a problem hiding this comment.
I'm so sorry; github decided not to notify me of your comment and I've only now found it.
I'll submit a PR to do that later today.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously in uu-install, this would occur:
However, GNU install would create a file with permission
640.Fixes #8033
Now, uu-install will override previous arguments with the last one, in line with GNU behaviour (I checked and this behaviour does occur for all arguments not just --mode)
Note: I haven't checked the other coreutils but I suspect they may also need to be changed