Annotation of src/usr.bin/xinstall/install.1, Revision 1.20
1.20 ! jmc 1: .\" $OpenBSD: install.1,v 1.19 2003/06/10 09:12:13 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: .\"
33: .Dd June 6, 1993
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.8 millert 41: .Op Fl bCcpSs
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
47: .Ar file1 file2
48: .Nm install
1.8 millert 49: .Op Fl bCcpSs
50: .Op Fl B Ar suffix
1.1 deraadt 51: .Op Fl f Ar flags
52: .Op Fl g Ar group
53: .Op Fl m Ar mode
54: .Op Fl o Ar owner
1.20 ! jmc 55: .Ar file1 ...
1.1 deraadt 56: .Ar fileN directory
57: .Nm install
58: .Fl d
1.4 millert 59: .Op Fl g Ar group
1.1 deraadt 60: .Op Fl m Ar mode
61: .Op Fl o Ar owner
1.20 ! jmc 62: .Ar directory ...
1.1 deraadt 63: .Sh DESCRIPTION
64: The file(s) are moved (or copied if the
65: .Fl c
66: option is specified) to the target file or directory.
67: If the destination is a directory, then the
68: .Ar file
69: is moved into
70: .Ar directory
71: with its original filename.
1.9 aaron 72: If the target file already exists, it is
1.8 millert 73: either renamed to
74: .Ar file.old
1.9 aaron 75: if the
1.8 millert 76: .Fl b
77: option is given
78: or overwritten
1.20 ! jmc 79: if permissions allow.
! 80: An alternate backup suffix may be specified via the
1.8 millert 81: .Fl B
82: option's argument.
83: .Pp
1.10 aaron 84: The options are as follows:
1.20 ! jmc 85: .Bl -tag -width "-B suffix"
! 86: .It Fl B Ar suffix
! 87: Use
! 88: .Ar suffix
! 89: as the backup suffix if
! 90: .Fl b
! 91: is given.
1.8 millert 92: .It Fl b
93: Backup any existing files before overwriting them by renaming
1.9 aaron 94: them to
1.12 aaron 95: .Ar file.old .
96: See
1.8 millert 97: .Fl B
98: for specifying a different backup suffix.
1.3 millert 99: .It Fl C
100: Copy the file.
101: If the target file already exists and the files are the same,
102: then don't change the modification time of the target.
1.1 deraadt 103: .It Fl c
1.11 aaron 104: Copy the file.
105: This is actually the default.
106: The
1.3 millert 107: .Fl c
108: option is only included for backwards compatibility.
109: .It Fl d
1.9 aaron 110: Create directories.
1.3 millert 111: Missing parent directories are created as required.
1.20 ! jmc 112: .It Fl f Ar flags
! 113: Specify the target's file
! 114: .Ar flags .
1.1 deraadt 115: (See
116: .Xr chflags 1
117: for a list of possible flags and their meanings.)
1.20 ! jmc 118: .It Fl g Ar group
! 119: Specify a
! 120: .Ar group .
1.11 aaron 121: A numeric GID is allowed.
1.20 ! jmc 122: .It Fl m Ar mode
! 123: Specify an alternate
! 124: .Ar mode .
1.1 deraadt 125: The default mode is set to rwxr-xr-x (0755).
126: The specified mode may be either an octal or symbolic value; see
1.11 aaron 127: .Xr chmod 1
1.1 deraadt 128: for a description of possible mode values.
1.20 ! jmc 129: .It Fl o Ar owner
! 130: Specify an
! 131: .Ar owner .
1.11 aaron 132: A numeric UID is allowed.
1.3 millert 133: .It Fl p
134: Preserve the modification time.
135: Copy the file, as if the
136: .Fl C
1.6 aaron 137: (compare and copy) option is specified,
1.3 millert 138: except if the target file doesn't already exist or is different,
139: then preserve the modification time of the file.
140: .It Fl S
1.11 aaron 141: Safe copy.
142: Normally,
143: .Nm
144: unlinks an existing target before installing the new file.
145: With the
1.3 millert 146: .Fl S
147: flag a temporary file is used and then renamed to be
1.11 aaron 148: the target.
149: The reason this is safer is that if the copy or
1.3 millert 150: rename fails, the existing target is left untouched.
1.1 deraadt 151: .It Fl s
1.11 aaron 152: .Nm
1.1 deraadt 153: exec's the command
1.5 millert 154: .Pa /usr/bin/strip
1.1 deraadt 155: to strip binaries so that install can be portable over a large
1.11 aaron 156: number of systems and binary types.
157: If the environment variable
1.5 millert 158: .Ev STRIP
159: is set, it is used instead.
1.1 deraadt 160: .El
161: .Pp
162: By default,
1.11 aaron 163: .Nm
164: preserves all file flags, with the exception of the
165: .Dq nodump
166: flag.
1.1 deraadt 167: .Pp
168: The
1.11 aaron 169: .Nm
1.1 deraadt 170: utility attempts to prevent moving a file onto itself.
171: .Pp
172: Installing
173: .Pa /dev/null
174: creates an empty file.
175: .Pp
176: Upon successful completion a value of 0 is returned.
1.20 ! jmc 177: Otherwise, a value \*(Gt0 is returned.
1.19 jmc 178: .Sh ENVIRONMENT
179: .Bl -tag -width "STRIP"
180: .It Ev STRIP
181: For an alternate
182: .Xr strip 1
183: program to run.
184: Default is
185: .Pa /usr/bin/strip .
186: .El
1.3 millert 187: .Sh FILES
1.20 ! jmc 188: .Bl -tag -width INS@XXXXXXXXXX -compact
! 189: .It Pa INS@XXXXXXXXXX
1.3 millert 190: If either
191: .Fl S
192: option is specified, or the
193: .Fl C
194: or
195: .Fl p
1.16 avsm 196: option is used in conjunction with the
1.3 millert 197: .Fl s
1.20 ! jmc 198: option, temporary files named INS@XXXXXXXXXX,
! 199: where XXXXXXXXXX is decided by
1.3 millert 200: .Xr mkstemp 3 ,
201: are created in the target directory.
1.15 mpech 202: .El
1.1 deraadt 203: .Sh SEE ALSO
204: .Xr chflags 1 ,
205: .Xr chgrp 1 ,
206: .Xr chmod 1 ,
207: .Xr cp 1 ,
208: .Xr mv 1 ,
209: .Xr strip 1 ,
210: .Xr chown 8
211: .Sh HISTORY
212: The
1.11 aaron 213: .Nm
1.1 deraadt 214: utility appeared in
215: .Bx 4.2 .
1.3 millert 216: .Sh CAVEATS
217: The
218: .Fl C ,
219: .Fl p ,
220: and
221: .Fl S
222: flags are non-standard and should not relied upon for portability.
1.6 aaron 223: .Pp
1.3 millert 224: Temporary files may be left in the target directory if
1.11 aaron 225: .Nm
1.3 millert 226: exits abnormally.