[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.29

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