Annotation of src/usr.bin/xinstall/install.1, Revision 1.26
1.26 ! jasper 1: .\" $OpenBSD: install.1,v 1.25 2010/09/29 07:44:57 jmc Exp $
1.1 deraadt 2: .\" $NetBSD: install.1,v 1.4 1994/11/14 04:57:17 jtc Exp $
3: .\"
4: .\" Copyright (c) 1987, 1990, 1993
5: .\" The Regents of the University of California. All rights reserved.
6: .\"
7: .\" Redistribution and use in source and binary forms, with or without
8: .\" modification, are permitted provided that the following conditions
9: .\" are met:
10: .\" 1. Redistributions of source code must retain the above copyright
11: .\" notice, this list of conditions and the following disclaimer.
12: .\" 2. Redistributions in binary form must reproduce the above copyright
13: .\" notice, this list of conditions and the following disclaimer in the
14: .\" documentation and/or other materials provided with the distribution.
1.18 millert 15: .\" 3. Neither the name of the University nor the names of its contributors
1.1 deraadt 16: .\" may be used to endorse or promote products derived from this software
17: .\" without specific prior written permission.
18: .\"
19: .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20: .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21: .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22: .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23: .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24: .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25: .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26: .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27: .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28: .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29: .\" SUCH DAMAGE.
30: .\"
31: .\" @(#)install.1 8.1 (Berkeley) 6/6/93
32: .\"
1.26 ! jasper 33: .Dd $Mdocdate: September 29 2010 $
1.1 deraadt 34: .Dt INSTALL 1
1.9 aaron 35: .Os
1.1 deraadt 36: .Sh NAME
37: .Nm install
38: .Nd install binaries
39: .Sh SYNOPSIS
40: .Nm install
1.26 ! jasper 41: .Op Fl bCcDdpSs
1.8 millert 42: .Op Fl B Ar suffix
1.1 deraadt 43: .Op Fl f Ar flags
44: .Op Fl g Ar group
45: .Op Fl m Ar mode
46: .Op Fl o Ar owner
1.24 sobrado 47: .Ar source ... target ...
1.1 deraadt 48: .Sh DESCRIPTION
1.21 jmc 49: The
50: .Ar source
51: file(s) are copied to the
52: .Ar target
53: file or directory.
54: If the
55: .Ar target
56: file already exists, it is either renamed to
1.8 millert 57: .Ar file.old
1.9 aaron 58: if the
1.8 millert 59: .Fl b
60: option is given
61: or overwritten
1.20 jmc 62: if permissions allow.
63: An alternate backup suffix may be specified via the
1.8 millert 64: .Fl B
65: option's argument.
1.21 jmc 66: If the
67: .Fl d
68: option is given,
69: .Ar target
70: directories are created, and no files are copied.
1.8 millert 71: .Pp
1.10 aaron 72: The options are as follows:
1.20 jmc 73: .Bl -tag -width "-B suffix"
74: .It Fl B Ar suffix
75: Use
76: .Ar suffix
77: as the backup suffix if
78: .Fl b
79: is given.
1.8 millert 80: .It Fl b
81: Backup any existing files before overwriting them by renaming
1.9 aaron 82: them to
1.12 aaron 83: .Ar file.old .
84: See
1.8 millert 85: .Fl B
86: for specifying a different backup suffix.
1.3 millert 87: .It Fl C
88: Copy the file.
89: If the target file already exists and the files are the same,
90: then don't change the modification time of the target.
1.1 deraadt 91: .It Fl c
1.11 aaron 92: Copy the file.
93: This is actually the default.
94: The
1.3 millert 95: .Fl c
96: option is only included for backwards compatibility.
1.26 ! jasper 97: .It Fl D
! 98: Create all leading components of the target before installing into it.
1.3 millert 99: .It Fl d
1.9 aaron 100: Create directories.
1.3 millert 101: Missing parent directories are created as required.
1.21 jmc 102: This option cannot be used with the
103: .Fl B , b , C , c ,
104: .Fl f , p , S ,
105: or
106: .Fl s
107: options.
1.20 jmc 108: .It Fl f Ar flags
109: Specify the target's file
110: .Ar flags .
1.1 deraadt 111: (See
112: .Xr chflags 1
113: for a list of possible flags and their meanings.)
1.20 jmc 114: .It Fl g Ar group
115: Specify a
116: .Ar group .
1.11 aaron 117: A numeric GID is allowed.
1.20 jmc 118: .It Fl m Ar mode
119: Specify an alternate
120: .Ar mode .
1.1 deraadt 121: The default mode is set to rwxr-xr-x (0755).
122: The specified mode may be either an octal or symbolic value; see
1.11 aaron 123: .Xr chmod 1
1.1 deraadt 124: for a description of possible mode values.
1.20 jmc 125: .It Fl o Ar owner
126: Specify an
127: .Ar owner .
1.11 aaron 128: A numeric UID is allowed.
1.3 millert 129: .It Fl p
130: Preserve the modification time.
131: Copy the file, as if the
132: .Fl C
1.6 aaron 133: (compare and copy) option is specified,
1.3 millert 134: except if the target file doesn't already exist or is different,
135: then preserve the modification time of the file.
136: .It Fl S
1.11 aaron 137: Safe copy.
138: Normally,
139: .Nm
140: unlinks an existing target before installing the new file.
141: With the
1.3 millert 142: .Fl S
143: flag a temporary file is used and then renamed to be
1.11 aaron 144: the target.
145: The reason this is safer is that if the copy or
1.3 millert 146: rename fails, the existing target is left untouched.
1.1 deraadt 147: .It Fl s
1.11 aaron 148: .Nm
1.1 deraadt 149: exec's the command
1.5 millert 150: .Pa /usr/bin/strip
1.1 deraadt 151: to strip binaries so that install can be portable over a large
1.11 aaron 152: number of systems and binary types.
153: If the environment variable
1.5 millert 154: .Ev STRIP
155: is set, it is used instead.
1.1 deraadt 156: .El
157: .Pp
158: By default,
1.11 aaron 159: .Nm
160: preserves all file flags, with the exception of the
161: .Dq nodump
162: flag.
1.1 deraadt 163: .Pp
164: The
1.11 aaron 165: .Nm
1.1 deraadt 166: utility attempts to prevent moving a file onto itself.
167: .Pp
168: Installing
169: .Pa /dev/null
170: creates an empty file.
1.19 jmc 171: .Sh ENVIRONMENT
172: .Bl -tag -width "STRIP"
173: .It Ev STRIP
174: For an alternate
175: .Xr strip 1
176: program to run.
177: Default is
178: .Pa /usr/bin/strip .
179: .El
1.3 millert 180: .Sh FILES
1.20 jmc 181: .Bl -tag -width INS@XXXXXXXXXX -compact
182: .It Pa INS@XXXXXXXXXX
1.3 millert 183: If either
184: .Fl S
185: option is specified, or the
186: .Fl C
187: or
188: .Fl p
1.16 avsm 189: option is used in conjunction with the
1.3 millert 190: .Fl s
1.20 jmc 191: option, temporary files named INS@XXXXXXXXXX,
192: where XXXXXXXXXX is decided by
1.3 millert 193: .Xr mkstemp 3 ,
194: are created in the target directory.
1.15 mpech 195: .El
1.25 jmc 196: .Sh EXIT STATUS
197: .Ex -std install
1.1 deraadt 198: .Sh SEE ALSO
199: .Xr chflags 1 ,
200: .Xr chgrp 1 ,
201: .Xr chmod 1 ,
202: .Xr cp 1 ,
203: .Xr mv 1 ,
204: .Xr strip 1 ,
205: .Xr chown 8
206: .Sh HISTORY
207: The
1.11 aaron 208: .Nm
1.1 deraadt 209: utility appeared in
210: .Bx 4.2 .
1.3 millert 211: .Sh CAVEATS
212: The
213: .Fl C ,
1.26 ! jasper 214: .Fl D ,
1.3 millert 215: .Fl p ,
216: and
217: .Fl S
218: flags are non-standard and should not relied upon for portability.
1.6 aaron 219: .Pp
1.3 millert 220: Temporary files may be left in the target directory if
1.11 aaron 221: .Nm
1.3 millert 222: exits abnormally.