Annotation of src/usr.bin/xinstall/install.1, Revision 1.25
1.25 ! jmc 1: .\" $OpenBSD: install.1,v 1.24 2009/03/16 22:48:18 sobrado 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.25 ! jmc 33: .Dd $Mdocdate: March 16 2009 $
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.21 jmc 41: .Op Fl bCcdpSs
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.
97: .It Fl d
1.9 aaron 98: Create directories.
1.3 millert 99: Missing parent directories are created as required.
1.21 jmc 100: This option cannot be used with the
101: .Fl B , b , C , c ,
102: .Fl f , p , S ,
103: or
104: .Fl s
105: options.
1.20 jmc 106: .It Fl f Ar flags
107: Specify the target's file
108: .Ar flags .
1.1 deraadt 109: (See
110: .Xr chflags 1
111: for a list of possible flags and their meanings.)
1.20 jmc 112: .It Fl g Ar group
113: Specify a
114: .Ar group .
1.11 aaron 115: A numeric GID is allowed.
1.20 jmc 116: .It Fl m Ar mode
117: Specify an alternate
118: .Ar mode .
1.1 deraadt 119: The default mode is set to rwxr-xr-x (0755).
120: The specified mode may be either an octal or symbolic value; see
1.11 aaron 121: .Xr chmod 1
1.1 deraadt 122: for a description of possible mode values.
1.20 jmc 123: .It Fl o Ar owner
124: Specify an
125: .Ar owner .
1.11 aaron 126: A numeric UID is allowed.
1.3 millert 127: .It Fl p
128: Preserve the modification time.
129: Copy the file, as if the
130: .Fl C
1.6 aaron 131: (compare and copy) option is specified,
1.3 millert 132: except if the target file doesn't already exist or is different,
133: then preserve the modification time of the file.
134: .It Fl S
1.11 aaron 135: Safe copy.
136: Normally,
137: .Nm
138: unlinks an existing target before installing the new file.
139: With the
1.3 millert 140: .Fl S
141: flag a temporary file is used and then renamed to be
1.11 aaron 142: the target.
143: The reason this is safer is that if the copy or
1.3 millert 144: rename fails, the existing target is left untouched.
1.1 deraadt 145: .It Fl s
1.11 aaron 146: .Nm
1.1 deraadt 147: exec's the command
1.5 millert 148: .Pa /usr/bin/strip
1.1 deraadt 149: to strip binaries so that install can be portable over a large
1.11 aaron 150: number of systems and binary types.
151: If the environment variable
1.5 millert 152: .Ev STRIP
153: is set, it is used instead.
1.1 deraadt 154: .El
155: .Pp
156: By default,
1.11 aaron 157: .Nm
158: preserves all file flags, with the exception of the
159: .Dq nodump
160: flag.
1.1 deraadt 161: .Pp
162: The
1.11 aaron 163: .Nm
1.1 deraadt 164: utility attempts to prevent moving a file onto itself.
165: .Pp
166: Installing
167: .Pa /dev/null
168: creates an empty file.
1.19 jmc 169: .Sh ENVIRONMENT
170: .Bl -tag -width "STRIP"
171: .It Ev STRIP
172: For an alternate
173: .Xr strip 1
174: program to run.
175: Default is
176: .Pa /usr/bin/strip .
177: .El
1.3 millert 178: .Sh FILES
1.20 jmc 179: .Bl -tag -width INS@XXXXXXXXXX -compact
180: .It Pa INS@XXXXXXXXXX
1.3 millert 181: If either
182: .Fl S
183: option is specified, or the
184: .Fl C
185: or
186: .Fl p
1.16 avsm 187: option is used in conjunction with the
1.3 millert 188: .Fl s
1.20 jmc 189: option, temporary files named INS@XXXXXXXXXX,
190: where XXXXXXXXXX is decided by
1.3 millert 191: .Xr mkstemp 3 ,
192: are created in the target directory.
1.15 mpech 193: .El
1.25 ! jmc 194: .Sh EXIT STATUS
! 195: .Ex -std install
1.1 deraadt 196: .Sh SEE ALSO
197: .Xr chflags 1 ,
198: .Xr chgrp 1 ,
199: .Xr chmod 1 ,
200: .Xr cp 1 ,
201: .Xr mv 1 ,
202: .Xr strip 1 ,
203: .Xr chown 8
204: .Sh HISTORY
205: The
1.11 aaron 206: .Nm
1.1 deraadt 207: utility appeared in
208: .Bx 4.2 .
1.3 millert 209: .Sh CAVEATS
210: The
211: .Fl C ,
212: .Fl p ,
213: and
214: .Fl S
215: flags are non-standard and should not relied upon for portability.
1.6 aaron 216: .Pp
1.3 millert 217: Temporary files may be left in the target directory if
1.11 aaron 218: .Nm
1.3 millert 219: exits abnormally.