Make "copy the file" (the -c option) the default behaviour. The -c option

is kept for backwards compatibility but now has no effect.

Patch from Bruce Nourish in PR bin/23874, with some minor changes by me.
This commit is contained in:
simonb 2003-12-29 02:01:27 +00:00
parent 5c83b03a81
commit 60e35b79cc
2 changed files with 10 additions and 16 deletions

View File

@ -1,4 +1,4 @@
.\" $NetBSD: install.1,v 1.38 2003/08/07 11:17:50 agc Exp $
.\" $NetBSD: install.1,v 1.39 2003/12/29 02:01:27 simonb Exp $
.\"
.\" Copyright (c) 1987, 1990, 1993
.\" The Regents of the University of California. All rights reserved.
@ -29,7 +29,7 @@
.\"
.\" @(#)install.1 8.1 (Berkeley) 6/6/93
.\"
.Dd December 21, 2002
.Dd December 29, 2003
.Dt INSTALL 1
.Os
.Sh NAME
@ -144,9 +144,8 @@
.Ek
.Ar directory ...\&
.Sh DESCRIPTION
The file(s) are moved (copied if the
.Fl c
option is specified, or linked if the
The file(s) are copied
(or linked if the
.Fl l
option is specified) to the target file or directory.
If the destination is a directory, then the
@ -205,9 +204,8 @@ The counter used starts from 0, and the first available name resulting
from the expansion is used.
.It Fl c
Copy the file.
This flag turns off the default behavior of
.Nm
where it deletes the original file after creating the target.
This is the default behavior; the flag is maintained for backwards
compatibility only.
.It Fl d
Create directories.
Missing parent directories are created as required.

View File

@ -1,4 +1,4 @@
/* $NetBSD: xinstall.c,v 1.82 2003/12/16 20:51:57 heas Exp $ */
/* $NetBSD: xinstall.c,v 1.83 2003/12/29 02:01:27 simonb Exp $ */
/*
* Copyright (c) 1987, 1993
@ -46,7 +46,7 @@ __COPYRIGHT("@(#) Copyright (c) 1987, 1993\n\
#if 0
static char sccsid[] = "@(#)xinstall.c 8.1 (Berkeley) 7/21/93";
#else
__RCSID("$NetBSD: xinstall.c,v 1.82 2003/12/16 20:51:57 heas Exp $");
__RCSID("$NetBSD: xinstall.c,v 1.83 2003/12/29 02:01:27 simonb Exp $");
#endif
#endif /* not lint */
@ -76,8 +76,7 @@ __RCSID("$NetBSD: xinstall.c,v 1.82 2003/12/16 20:51:57 heas Exp $");
#define STRIP_ARGS_MAX 32
#define BACKUP_SUFFIX ".old"
int dobackup, docopy, dodir, dostrip, dolink, dopreserve, dorename,
dounpriv;
int dobackup, dodir, dostrip, dolink, dopreserve, dorename, dounpriv;
int numberedbackup;
int mode = S_IRWXU|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH;
char pathbuf[MAXPATHLEN];
@ -160,7 +159,7 @@ main(int argc, char *argv[])
dobackup = 1;
break;
case 'c':
docopy = 1;
/* ignored; was "docopy" which is now the default. */
break;
case 'd':
dodir = 1;
@ -672,9 +671,6 @@ install(char *from_name, char *to_name, u_int flags)
to_name = oto_name;
}
if (!docopy && !devnull && unlink(from_name))
err(1, "%s: unlink", from_name);
/*
* If provided a set of flags, set them, otherwise, preserve the
* flags, except for the dump flag.