Bug 230620 - "install -d" issue
Summary: "install -d" issue
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 11.1-STABLE
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-bugs mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-08-14 16:49 UTC by Eugene Grosbein
Modified: 2019-02-13 01:58 UTC (History)
1 user (show)

See Also:
eugen: mfc-stable11?


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eugene Grosbein freebsd_committer 2018-08-14 16:49:32 UTC
install(1) manual page tells that the install utility can create missing parent directories as required if -d options is specified. This mode seems to work half-way only, as it really creates needed directories but fails to copy specified files there:

$ cd /tmp
$ touch file1 file2
$ install -d dir file1 file2
install: file1 exists but is not a directory
$ ls -lR dir
total 0
Comment 1 Ian Lepore freebsd_committer 2018-08-14 17:14:10 UTC
Install -d ONLY creates directories.  You are not allowed to specify both directories and filenames on the command line when using -d.  This is documented by having a different synopsis line in the manpage for install -d.
Comment 2 Eugene Grosbein freebsd_committer 2018-08-15 00:59:03 UTC
(In reply to Ian Lepore from comment #1)

Thank you for explanation. This is not obvious from the synopsis. Perhaps, it should be made more clear by replacing "directory ..." with "directory1 ... directoryN" just like previous lines already have "file1 ... file N directory".

Also, one can consider this as PR feature request then: teach install(1) to create missing directories while copying files. It could use new "-F" flag for that to force such creation.
Comment 3 Rodney W. Grimes freebsd_committer 2019-02-13 01:58:46 UTC
Please do not put bugs on stable@, current@, hackers@, etc
Placing this bug back on bugs@ to be triaged properly to a technical list