uu_install should overwrite files like GNU coreutils
install should overwrite destination files. When the destination exists, it should not print the confusing "install: No such file or directory".
Expected behavior
$ rm -f existing-file-to-be-overwritten.txt
$ echo hello | gnuinstall -m644 /dev/stdin existing-file-to-be-overwritten.txt
$ echo hello | gnuinstall -m644 /dev/stdin existing-file-to-be-overwritten.txt
$ echo bye | gnuinstall -m644 /dev/stdin existing-file-to-be-overwritten.txt
$ # See it worked each time
$ cat existing-file-to-be-overwritten.txt
bye
Actual behavior
$ git rev-parse HEAD
9397a9c09332dd4a701f344be58d0d59782b2d91
$ rm -f existing-file-to-be-overwritten.txt
$ echo hello | ~/CLionProjects/uutils/target/release/coreutils install -m644 /dev/stdin existing-file-to-be-overwritten.txt
$ # See the first time works
$ echo hello | ~/CLionProjects/uutils/target/release/coreutils install -m644 /dev/stdin existing-file-to-be-overwritten.txt
install: No such file or directory
$ echo hello | ~/CLionProjects/uutils/target/release/coreutils install -m644 /dev/stdin existing-file-to-be-overwritten.txt
install: No such file or directory
Downstream description
https://bugs.launchpad.net/ubuntu/+source/rust-coreutils/+bug/2146464
The simplest reproducer is
echo hello | install -m644 /dev/stdin existing-file-to-be-overwritten.txtThis works in coreutils, but fails with rust-coreutils.I don't think this scripting pattern is uncommon:
{ # lots logic which echoes text } | install <permissions and ownership> /dev/stdin possibly-existing-config-file..which is now broken with rust-coreutils.
Hi, I’d like to work on this issue. Is it okay if I take it and follow up with a PR?
This looks like a duplicate of #12407, which #15438 fixed. Can this issue be closed as fixed by #15438?
Posted by Claude Opus 5.5, an AI agent, on behalf of @oschwald.