Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin/sup/source Add -u flag, that prevents sup from atte...



details:   https://anonhg.NetBSD.org/src/rev/b6c8e6a1b5ea
branches:  trunk
changeset: 473731:b6c8e6a1b5ea
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Jun 17 05:11:47 1999 +0000

description:
Add -u flag, that prevents sup from attempting to restore a and m times
on the received files.

diffstat:

 usr.sbin/sup/source/sup.1      |   8 +++++++-
 usr.sbin/sup/source/supcmain.c |  11 ++++++++++-
 usr.sbin/sup/source/supcmeat.c |  12 ++++++++----
 3 files changed, 25 insertions(+), 6 deletions(-)

diffs (108 lines):

diff -r f0abe357ee9b -r b6c8e6a1b5ea usr.sbin/sup/source/sup.1
--- a/usr.sbin/sup/source/sup.1 Thu Jun 17 04:20:55 1999 +0000
+++ b/usr.sbin/sup/source/sup.1 Thu Jun 17 05:11:47 1999 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: sup.1,v 1.8 1999/04/12 20:48:07 pk Exp $
+.\"    $NetBSD: sup.1,v 1.9 1999/06/17 05:11:47 christos Exp $
 .\"
 .\" Copyright (c) 1992 Carnegie Mellon University
 .\" All Rights Reserved.
@@ -109,6 +109,12 @@
 that each collection was last upgraded, rather than
 performing actual upgrades.
 .TP
+.B -u
+When this flag is given,
+.I sup
+will not try to restore the user access and modified times of files in
+the collections from the server.
+.TP
 .B -S
 Operate silently printing messages only on errors.
 .TP
diff -r f0abe357ee9b -r b6c8e6a1b5ea usr.sbin/sup/source/supcmain.c
--- a/usr.sbin/sup/source/supcmain.c    Thu Jun 17 04:20:55 1999 +0000
+++ b/usr.sbin/sup/source/supcmain.c    Thu Jun 17 05:11:47 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: supcmain.c,v 1.12 1999/04/12 20:48:07 pk Exp $ */
+/*     $NetBSD: supcmain.c,v 1.13 1999/06/17 05:11:48 christos Exp $   */
 
 /*
  * Copyright (c) 1992 Carnegie Mellon University
@@ -45,6 +45,11 @@
  *                     that each collection was last upgraded, rather than
  *                     performing actual upgrades.
  *
+ *     -u      "utimes" flag
+ *                     When this flags is given sup will not attempt to
+ *                     restore access and modification files on the collection
+ *                     files from the server.
+ *
  *     -R      "resource pause" flag
  *                     Sup will not disable resource pausing and will not
  *                     make filesystem space checks.
@@ -334,6 +339,7 @@
 int silent;                            /* Silent run, print only errors */
 int sysflag;                           /* system upgrade flag */
 int timeflag;                          /* print times flag */
+int noutime;                           /* Don't preserve utimes */
 #if    MACH
 int rpauseflag;                                /* don't disable resource pausing */
 #endif /* MACH */
@@ -554,6 +560,9 @@
                        oflags &= ~CFOLD;
                        aflags |= CFOLD;
                        break;
+               case 'u':
+                       noutime = TRUE;
+                       break;
                case 'v':
                        oflags |= CFVERBOSE;
                        break;
diff -r f0abe357ee9b -r b6c8e6a1b5ea usr.sbin/sup/source/supcmeat.c
--- a/usr.sbin/sup/source/supcmeat.c    Thu Jun 17 04:20:55 1999 +0000
+++ b/usr.sbin/sup/source/supcmeat.c    Thu Jun 17 05:11:47 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: supcmeat.c,v 1.19 1999/04/12 20:48:07 pk Exp $ */
+/*     $NetBSD: supcmeat.c,v 1.20 1999/06/17 05:11:48 christos Exp $   */
 
 /*
  * Copyright (c) 1992 Carnegie Mellon University
@@ -127,6 +127,7 @@
 extern COLLECTION *thisC;              /* collection list pointer */
 extern int rpauseflag;                 /* don't disable resource pausing */
 extern int portdebug;                  /* network debugging ports */
+extern int noutime;                    /* don't set utimes */
 
 /*************************************************
  ***    U P G R A D E   C O L L E C T I O N    ***
@@ -888,7 +889,8 @@
        }
        tbuf[0].tv_sec = time((time_t *)NULL);  tbuf[0].tv_usec = 0;
        tbuf[1].tv_sec = t->Tmtime;  tbuf[1].tv_usec = 0;
-       (void) utimes (t->Tname,tbuf);
+       if (!noutime)
+               (void) utimes (t->Tname,tbuf);
        vnotify ("SUP %s directory %s\n",new?"Created":"Updated",t->Tname);
        return (FALSE);
 }
@@ -964,7 +966,8 @@
                }
                tbuf[0].tv_sec = time((time_t *)NULL);  tbuf[0].tv_usec = 0;
                tbuf[1].tv_sec = t->Tmtime;  tbuf[1].tv_usec = 0;
-               (void) utimes (t->Tname,tbuf);
+               if (!noutime)
+                       (void) utimes (t->Tname,tbuf);
                return (FALSE);
        }
        if (thisC->Cflags&CFLIST) {
@@ -1023,7 +1026,8 @@
        }
        tbuf[0].tv_sec = time((time_t *)NULL);  tbuf[0].tv_usec = 0;
        tbuf[1].tv_sec = t->Tmtime;  tbuf[1].tv_usec = 0;
-       (void) utimes (t->Tname,tbuf);
+       if (!noutime)
+               (void) utimes (t->Tname,tbuf);
        return (FALSE);
 }
 



Home | Main Index | Thread Index | Old Index