Skip to content

uu_install should overwrite files like GNU coreutils #11532

@danielzgtg

Description

@danielzgtg

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions