1994-05-27 12:33:43 +00:00
|
|
|
.\" Copyright (c) 1987, 1990, 1993
|
|
|
|
.\" The Regents of the University of California. All rights reserved.
|
|
|
|
.\"
|
|
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
|
|
.\" modification, are permitted provided that the following conditions
|
|
|
|
.\" are met:
|
|
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
|
|
.\" 4. Neither the name of the University nor the names of its contributors
|
|
|
|
.\" may be used to endorse or promote products derived from this software
|
|
|
|
.\" without specific prior written permission.
|
|
|
|
.\"
|
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
|
|
|
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
.\" SUCH DAMAGE.
|
|
|
|
.\"
|
1995-10-09 07:21:00 +00:00
|
|
|
.\" From: @(#)install.1 8.1 (Berkeley) 6/6/93
|
1999-08-28 01:08:13 +00:00
|
|
|
.\" $FreeBSD$
|
1994-05-27 12:33:43 +00:00
|
|
|
.\"
|
2006-09-29 15:20:48 +00:00
|
|
|
.Dd March 6, 2006
|
1994-05-27 12:33:43 +00:00
|
|
|
.Dt INSTALL 1
|
2001-05-28 16:41:53 +00:00
|
|
|
.Os
|
1994-05-27 12:33:43 +00:00
|
|
|
.Sh NAME
|
|
|
|
.Nm install
|
|
|
|
.Nd install binaries
|
|
|
|
.Sh SYNOPSIS
|
2000-11-20 19:21:22 +00:00
|
|
|
.Nm
|
2001-05-28 16:41:53 +00:00
|
|
|
.Op Fl bCcMpSsv
|
|
|
|
.Op Fl B Ar suffix
|
1994-05-27 12:33:43 +00:00
|
|
|
.Op Fl f Ar flags
|
|
|
|
.Op Fl g Ar group
|
|
|
|
.Op Fl m Ar mode
|
|
|
|
.Op Fl o Ar owner
|
|
|
|
.Ar file1 file2
|
2000-11-20 19:21:22 +00:00
|
|
|
.Nm
|
2001-05-28 16:41:53 +00:00
|
|
|
.Op Fl bCcMpSsv
|
|
|
|
.Op Fl B Ar suffix
|
1994-05-27 12:33:43 +00:00
|
|
|
.Op Fl f Ar flags
|
|
|
|
.Op Fl g Ar group
|
|
|
|
.Op Fl m Ar mode
|
|
|
|
.Op Fl o Ar owner
|
2001-05-30 09:45:47 +00:00
|
|
|
.Ar file1 ... fileN directory
|
2000-11-20 19:21:22 +00:00
|
|
|
.Nm
|
1996-09-29 06:29:54 +00:00
|
|
|
.Fl d
|
1999-12-06 05:01:14 +00:00
|
|
|
.Op Fl v
|
1996-09-29 06:29:54 +00:00
|
|
|
.Op Fl g Ar group
|
|
|
|
.Op Fl m Ar mode
|
|
|
|
.Op Fl o Ar owner
|
2001-05-30 09:45:47 +00:00
|
|
|
.Ar directory ...
|
1994-05-27 12:33:43 +00:00
|
|
|
.Sh DESCRIPTION
|
2001-05-30 09:45:47 +00:00
|
|
|
The file(s) are copied
|
|
|
|
to the target file or directory.
|
1994-05-27 12:33:43 +00:00
|
|
|
If the destination is a directory, then the
|
|
|
|
.Ar file
|
2001-05-30 09:45:47 +00:00
|
|
|
is copied into
|
1994-05-27 12:33:43 +00:00
|
|
|
.Ar directory
|
|
|
|
with its original filename.
|
2001-05-28 16:41:53 +00:00
|
|
|
If the target file already exists, it is
|
|
|
|
either renamed to
|
|
|
|
.Ar file Ns Pa .old
|
|
|
|
if the
|
|
|
|
.Fl b
|
|
|
|
option is given
|
|
|
|
or overwritten
|
|
|
|
if permissions allow.
|
|
|
|
An alternate backup suffix may be specified via the
|
|
|
|
.Fl B
|
|
|
|
option's argument.
|
1994-05-27 12:33:43 +00:00
|
|
|
.Pp
|
2001-05-28 16:41:53 +00:00
|
|
|
The options are as follows:
|
|
|
|
.Bl -tag -width indent
|
|
|
|
.It Fl b
|
|
|
|
Back up any existing files before overwriting them by renaming
|
|
|
|
them to
|
|
|
|
.Ar file Ns Pa .old .
|
|
|
|
See
|
|
|
|
.Fl B
|
|
|
|
for specifying a different backup suffix.
|
|
|
|
.It Fl B Ar suffix
|
|
|
|
Use
|
|
|
|
.Ar suffix
|
|
|
|
as the backup suffix if
|
|
|
|
.Fl b
|
|
|
|
is given.
|
1996-03-11 03:31:51 +00:00
|
|
|
.It Fl C
|
2001-05-28 16:41:53 +00:00
|
|
|
Copy the file.
|
|
|
|
If the target file already exists and the files are the same,
|
2005-02-13 22:25:33 +00:00
|
|
|
then do not change the modification time of the target.
|
2002-10-31 10:43:32 +00:00
|
|
|
If the target's file flags and mode need not to be changed,
|
|
|
|
the target's inode change time is also unchanged.
|
1994-05-27 12:33:43 +00:00
|
|
|
.It Fl c
|
|
|
|
Copy the file.
|
2001-05-28 16:41:53 +00:00
|
|
|
This is actually the default.
|
|
|
|
The
|
|
|
|
.Fl c
|
|
|
|
option is only included for backwards compatibility.
|
1996-09-29 06:29:54 +00:00
|
|
|
.It Fl d
|
2001-05-28 16:41:53 +00:00
|
|
|
Create directories.
|
1996-09-29 06:29:54 +00:00
|
|
|
Missing parent directories are created as required.
|
1994-05-27 12:33:43 +00:00
|
|
|
.It Fl f
|
1997-08-27 06:29:23 +00:00
|
|
|
Specify the target's file flags; see
|
1994-05-27 12:33:43 +00:00
|
|
|
.Xr chflags 1
|
1997-08-27 06:29:23 +00:00
|
|
|
for a list of possible flags and their meanings.
|
1994-05-27 12:33:43 +00:00
|
|
|
.It Fl g
|
2000-03-01 12:20:22 +00:00
|
|
|
Specify a group.
|
|
|
|
A numeric GID is allowed.
|
1998-01-11 11:43:36 +00:00
|
|
|
.It Fl M
|
|
|
|
Disable all use of
|
|
|
|
.Xr mmap 2 .
|
1994-05-27 12:33:43 +00:00
|
|
|
.It Fl m
|
|
|
|
Specify an alternate mode.
|
|
|
|
The default mode is set to rwxr-xr-x (0755).
|
|
|
|
The specified mode may be either an octal or symbolic value; see
|
2001-05-28 16:41:53 +00:00
|
|
|
.Xr chmod 1
|
1994-05-27 12:33:43 +00:00
|
|
|
for a description of possible mode values.
|
|
|
|
.It Fl o
|
2000-03-01 12:20:22 +00:00
|
|
|
Specify an owner.
|
|
|
|
A numeric UID is allowed.
|
1995-10-09 07:21:00 +00:00
|
|
|
.It Fl p
|
2002-10-31 10:43:32 +00:00
|
|
|
Preserve the access and modification times.
|
1995-10-09 07:21:00 +00:00
|
|
|
Copy the file, as if the
|
|
|
|
.Fl C
|
2001-05-28 16:41:53 +00:00
|
|
|
(compare and copy) option is specified,
|
2005-02-13 22:25:33 +00:00
|
|
|
except if the target file does not already exist or is different,
|
2002-10-31 10:43:32 +00:00
|
|
|
then preserve the access and modification times of the source file.
|
2001-05-28 16:41:53 +00:00
|
|
|
.It Fl S
|
|
|
|
Safe copy.
|
|
|
|
Normally,
|
|
|
|
.Nm
|
|
|
|
unlinks an existing target before installing the new file.
|
|
|
|
With the
|
|
|
|
.Fl S
|
|
|
|
flag a temporary file is used and then renamed to be
|
|
|
|
the target.
|
|
|
|
The reason this is safer is that if the copy or
|
|
|
|
rename fails, the existing target is left untouched.
|
1994-05-27 12:33:43 +00:00
|
|
|
.It Fl s
|
2001-05-28 16:41:53 +00:00
|
|
|
.Nm
|
1994-05-27 12:33:43 +00:00
|
|
|
exec's the command
|
2001-05-28 16:41:53 +00:00
|
|
|
.Xr strip 1
|
|
|
|
to strip binaries so that
|
|
|
|
.Nm
|
|
|
|
can be portable over a large
|
1994-05-27 12:33:43 +00:00
|
|
|
number of systems and binary types.
|
2004-06-11 17:25:37 +00:00
|
|
|
See below for how
|
|
|
|
.Nm
|
|
|
|
can be instructed to use another program to strip binaries.
|
1999-12-06 05:01:14 +00:00
|
|
|
.It Fl v
|
2001-08-21 15:59:55 +00:00
|
|
|
Cause
|
1999-12-06 05:01:14 +00:00
|
|
|
.Nm
|
2001-08-21 15:59:55 +00:00
|
|
|
to be verbose,
|
|
|
|
showing files as they are installed or backed up.
|
1994-05-27 12:33:43 +00:00
|
|
|
.El
|
|
|
|
.Pp
|
|
|
|
By default,
|
1997-08-27 06:29:23 +00:00
|
|
|
.Nm
|
2001-05-28 16:41:53 +00:00
|
|
|
preserves all file flags, with the exception of the
|
|
|
|
.Dq nodump
|
|
|
|
flag.
|
1994-05-27 12:33:43 +00:00
|
|
|
.Pp
|
|
|
|
The
|
1997-08-27 06:29:23 +00:00
|
|
|
.Nm
|
1994-05-27 12:33:43 +00:00
|
|
|
utility attempts to prevent moving a file onto itself.
|
|
|
|
.Pp
|
|
|
|
Installing
|
|
|
|
.Pa /dev/null
|
|
|
|
creates an empty file.
|
2004-06-11 17:25:37 +00:00
|
|
|
.Sh ENVIRONMENT
|
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
utility checks for the presence of the
|
|
|
|
.Ev STRIPBIN
|
|
|
|
environment variable and if present,
|
|
|
|
uses the assigned value as the program to run if and when the
|
|
|
|
.Fl s
|
|
|
|
option has been specified.
|
2006-03-06 21:52:59 +00:00
|
|
|
.Pp
|
|
|
|
If the
|
|
|
|
.Ev DONTSTRIP
|
2006-09-29 15:20:48 +00:00
|
|
|
environment variable is present,
|
2006-03-06 21:52:59 +00:00
|
|
|
.Nm
|
|
|
|
will ignore any specification of the
|
|
|
|
.Fl s
|
|
|
|
option.
|
2006-09-29 15:20:48 +00:00
|
|
|
This is mainly for use in debugging the
|
|
|
|
.Fx
|
|
|
|
Ports Collection.
|
1995-10-09 07:21:00 +00:00
|
|
|
.Sh FILES
|
2006-09-29 15:20:48 +00:00
|
|
|
.Bl -tag -width ".Pa INS@XXXX" -compact
|
1995-10-09 07:21:00 +00:00
|
|
|
.It Pa INS@XXXX
|
2001-05-28 16:41:53 +00:00
|
|
|
If either
|
|
|
|
.Fl S
|
|
|
|
option is specified, or the
|
1995-10-09 07:21:00 +00:00
|
|
|
.Fl C
|
|
|
|
or
|
|
|
|
.Fl p
|
2005-07-31 03:30:48 +00:00
|
|
|
option is used in conjunction with the
|
2001-05-28 16:41:53 +00:00
|
|
|
.Fl s
|
|
|
|
option, temporary files named
|
|
|
|
.Pa INS@XXXX ,
|
|
|
|
where
|
|
|
|
.Pa XXXX
|
|
|
|
is decided by
|
1995-10-09 07:21:00 +00:00
|
|
|
.Xr mkstemp 3 ,
|
|
|
|
are created in the target directory.
|
2000-12-19 16:00:12 +00:00
|
|
|
.El
|
2005-01-18 13:43:56 +00:00
|
|
|
.Sh EXIT STATUS
|
|
|
|
.Ex -std
|
2001-05-30 09:45:47 +00:00
|
|
|
.Sh COMPATIBILITY
|
|
|
|
Historically
|
|
|
|
.Nm
|
|
|
|
moved files by default.
|
|
|
|
The default was changed to copy in
|
|
|
|
.Fx 4.4 .
|
1994-05-27 12:33:43 +00:00
|
|
|
.Sh SEE ALSO
|
|
|
|
.Xr chflags 1 ,
|
|
|
|
.Xr chgrp 1 ,
|
|
|
|
.Xr chmod 1 ,
|
|
|
|
.Xr cp 1 ,
|
|
|
|
.Xr mv 1 ,
|
|
|
|
.Xr strip 1 ,
|
1998-01-11 11:43:36 +00:00
|
|
|
.Xr mmap 2 ,
|
1994-05-27 12:33:43 +00:00
|
|
|
.Xr chown 8
|
|
|
|
.Sh HISTORY
|
|
|
|
The
|
1997-08-27 06:29:23 +00:00
|
|
|
.Nm
|
1994-05-27 12:33:43 +00:00
|
|
|
utility appeared in
|
|
|
|
.Bx 4.2 .
|
1995-10-09 07:21:00 +00:00
|
|
|
.Sh BUGS
|
|
|
|
Temporary files may be left in the target directory if
|
1997-08-27 06:29:23 +00:00
|
|
|
.Nm
|
1995-10-09 07:21:00 +00:00
|
|
|
exits abnormally.
|
1998-06-02 12:00:08 +00:00
|
|
|
.Pp
|
|
|
|
File flags cannot be set by
|
1998-06-10 07:17:59 +00:00
|
|
|
.Xr fchflags 2
|
2004-07-02 22:22:35 +00:00
|
|
|
over a NFS file system.
|
|
|
|
Other file systems do not have a concept of flags.
|
2002-04-20 12:18:28 +00:00
|
|
|
The
|
1998-06-02 12:00:08 +00:00
|
|
|
.Nm
|
2002-12-12 17:26:04 +00:00
|
|
|
utility will only warn when flags could not be set on a file system
|
1998-06-02 12:00:08 +00:00
|
|
|
that does not support them.
|
1999-12-06 05:01:14 +00:00
|
|
|
.Pp
|
2002-04-20 12:18:28 +00:00
|
|
|
The
|
1999-12-06 05:01:14 +00:00
|
|
|
.Nm
|
2002-04-20 12:18:28 +00:00
|
|
|
utility with
|
1999-12-06 05:01:14 +00:00
|
|
|
.Fl v
|
|
|
|
falsely says a file is copied when
|
|
|
|
.Fl C
|
|
|
|
snaps hard links.
|