[BACK]Return to install.1 CVS log [TXT][DIR] Up to [local] / src / usr.bin / xinstall

Annotation of src/usr.bin/xinstall/install.1, Revision 1.23

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