uutils / uutils/coreutils

uu_install should overwrite files like GNU coreutils

Open
#11,532 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

U - install
Dominant language
Rust
Stars
24.1k
Forks
2k
Avg merge
1d 5h
Merged PRs (30d)
365

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the install command entry point and reproduce the documented pipeline with an existing destination file. Compare its behavior with GNU coreutils, then verify that repeated writes overwrite the destination without the "No such file or directory" error and preserve the requested mode.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
64/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.