Page MenuHomeFreeBSD

install: Allow installing stdin
ClosedPublic

Authored by des on Jul 19 2026, 7:34 PM.
Tags
None
Referenced Files
F170813464: D58348.id182377.diff
Sun, Sep 6, 7:22 PM
F170792159: D58348.id182278.diff
Sun, Sep 6, 4:01 PM
F170778937: D58348.id182377.diff
Sun, Sep 6, 2:17 PM
F170759823: D58348.id182278.diff
Sun, Sep 6, 11:24 AM
F170722421: D58348.id182253.diff
Sun, Sep 6, 5:33 AM
Unknown Object (File)
Sun, Sep 6, 2:17 AM
Unknown Object (File)
Sat, Sep 5, 6:25 AM
Unknown Object (File)
Fri, Sep 4, 8:09 PM
Subscribers

Details

Summary

If from_name is "/dev/stdin" or "-" and the target is not a directory,
skip the comparison and copy data from standard input to the target.

MFC after: 1 week

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 74938
Build 71821: arc lint + arc unit

Event Timeline

des requested review of this revision.Jul 19 2026, 7:34 PM

separate devnull and ispipe cases

Apart from the comment I don't understand, this is good, I think.

usr.bin/xinstall/xinstall.c
832

comment says no name, but this is can't create a directory, no?

This revision is now accepted and ready to land.Jul 20 2026, 10:20 PM
usr.bin/xinstall/xinstall.c
832

install() has two modes depending on whether the target is an existing file or non-existent path on the one hand, or an existing directory on the other. In the first case, we use the target name as-is, but in the second we create a file in the target directory with the same name as the source. In the devnull and ispipe cases, however, we don't have a valid name to use for the target.

usr.bin/xinstall/xinstall.c
832

To be clear, install() does not create directories, install_dir() does. What flags & DIRECTORY means is that to_name exists and is a directory.

des marked an inline comment as done.Jul 21 2026, 8:04 AM
This revision was automatically updated to reflect the committed changes.