coreutils icon indicating copy to clipboard operation
coreutils copied to clipboard

uu_install should overwrite files like GNU coreutils

Open danielzgtg opened this issue 8 months ago • 2 comments

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.txt This 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.

danielzgtg avatar Mar 28 '26 07:03 danielzgtg

Hi, I’d like to work on this issue. Is it okay if I take it and follow up with a PR?

dhr412 avatar Apr 01 '26 16:04 dhr412

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.

oschwald avatar Nov 03 '26 15:11 oschwald