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