-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
install: don't error when multiple arguments of the same type are given, instead override with last one (#8033) #8053
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
Conversation
…rs multiple times
…re given, instead override with last one
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:
|
scene | ||
.ucmd() | ||
.args(&[file, &format!("{dir}/{file}"), "--mode=999", "--mode=200"]) | ||
.succeeds() | ||
.no_stderr(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
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