Annotation of src/usr.bin/xinstall/install.1, Revision 1.11
1.11 ! aaron 1: .\" $OpenBSD: install.1,v 1.10 1999/10/17 20:35:48 aaron 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.10 aaron 89: The options are as follows:
1.1 deraadt 90: .Bl -tag -width Ds
1.8 millert 91: .It Fl b
92: Backup any existing files before overwriting them by renaming
1.9 aaron 93: them to
1.8 millert 94: .Ar file.old . See
95: .Fl B
96: for specifying a different backup suffix.
97: .It Fl B Ar suffix
1.9 aaron 98: Use
1.8 millert 99: .Ar suffix
1.9 aaron 100: as the backup suffix if
1.8 millert 101: .Fl b
102: is given.
1.3 millert 103: .It Fl C
104: Copy the file.
105: If the target file already exists and the files are the same,
106: then don't change the modification time of the target.
1.1 deraadt 107: .It Fl c
1.11 ! aaron 108: Copy the file.
! 109: This is actually the default.
! 110: The
1.3 millert 111: .Fl c
112: option is only included for backwards compatibility.
113: .It Fl d
1.9 aaron 114: Create directories.
1.3 millert 115: Missing parent directories are created as required.
1.1 deraadt 116: .It Fl f
117: Specify the target's file flags.
118: (See
119: .Xr chflags 1
120: for a list of possible flags and their meanings.)
121: .It Fl g
1.11 ! aaron 122: Specify a group.
! 123: A numeric GID is allowed.
1.1 deraadt 124: .It Fl m
125: Specify an alternate mode.
126: The default mode is set to rwxr-xr-x (0755).
127: The specified mode may be either an octal or symbolic value; see
1.11 ! aaron 128: .Xr chmod 1
1.1 deraadt 129: for a description of possible mode values.
130: .It Fl o
1.11 ! aaron 131: Specify an owner.
! 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.
177: Otherwise, a value of 1 is returned.
1.3 millert 178: .Sh FILES
179: .Bl -tag -width INS@XXXXXX -compact
180: .It Pa INS@XXXXXX
181: If either
182: .Fl S
183: option is specified, or the
184: .Fl C
185: or
186: .Fl p
187: option is used in conjuction with the
188: .Fl s
189: option, temporary files named INS@XXXXXX,
190: where XXXXXX is decided by
191: .Xr mkstemp 3 ,
192: are created in the target directory.
1.5 millert 193: .Sh ENVIRONMENT
1.11 ! aaron 194: The following environment variables affect the execution of
! 195: .Nm install :
1.5 millert 196: .Bl -tag -width "STRIP"
197: .It Ev STRIP
198: For an alternate
199: .Xr strip 1
1.11 ! aaron 200: program to run.
! 201: Default is
1.5 millert 202: .Pa /usr/bin/strip .
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.