On 12/05/2024 00:03, Robert Hill wrote:
> After upgrading coreutils from 9.0 to 9.5, the following change occurred:
>
> In coreutils 9.0, the command "cp -Tipruvx /src-dir /dst-dir" requested
> interactive confirmation before replacing an old destination file with a
> newer source file, as expected.
>
> In coreutils 9.5, the command "cp -Tipruvx /src-dir /dst-dir" no longer
> requests interactive confirmation, but just goes ahead and replaces old
> destination files with newer source files, which is not expected.
>
> Thank you in advance for looking at this, Bob.
Right.
The thinking was for 9.3 that the new long form --update={older,all} options
would override a previous -i, especially as -i was commonly set in root
users' cp and mv aliases on Red Hat flavored distros.
Then in 9.5 we expanded this so -u behaved the same as --update=older.
In retrospect, users can avoid these aliases in various ways,
and the protective -i option should really combine with -u
rather than being overridden by it.
For completeness, -i following -u would always reinstate the protection.
The attached changes the behavior back to that -i is never overridden.
thanks,
Pádraig