Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/xinstall Make "copy the file" (the -c option) the de...



details:   https://anonhg.NetBSD.org/src/rev/02f442c72f0a
branches:  trunk
changeset: 556845:02f442c72f0a
user:      simonb <simonb%NetBSD.org@localhost>
date:      Mon Dec 29 02:01:27 2003 +0000

description:
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.

diffstat:

 usr.bin/xinstall/install.1  |  14 ++++++--------
 usr.bin/xinstall/xinstall.c |  12 ++++--------
 2 files changed, 10 insertions(+), 16 deletions(-)

diffs (89 lines):

diff -r 27ec9e521fc0 -r 02f442c72f0a usr.bin/xinstall/install.1
--- a/usr.bin/xinstall/install.1        Mon Dec 29 01:34:02 2003 +0000
+++ b/usr.bin/xinstall/install.1        Mon Dec 29 02:01:27 2003 +0000
@@ -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 @@
 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.
diff -r 27ec9e521fc0 -r 02f442c72f0a usr.bin/xinstall/xinstall.c
--- a/usr.bin/xinstall/xinstall.c       Mon Dec 29 01:34:02 2003 +0000
+++ b/usr.bin/xinstall/xinstall.c       Mon Dec 29 02:01:27 2003 +0000
@@ -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 @@
 #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 @@
 #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 @@
                        dobackup = 1;
                        break;
                case 'c':
-                       docopy = 1;
+                       /* ignored; was "docopy" which is now the default. */
                        break;
                case 'd':
                        dodir = 1;
@@ -672,9 +671,6 @@
                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.



Home | Main Index | Thread Index | Old Index