Source-Changes-HG archive

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

[src/trunk]: src/bin/pax - Directories marked `optional' won't be stored, eve...



details:   https://anonhg.NetBSD.org/src/rev/afeb41cf366e
branches:  trunk
changeset: 525916:afeb41cf366e
user:      lukem <lukem%NetBSD.org@localhost>
date:      Sat Apr 20 23:36:48 2002 +0000

description:
- Directories marked `optional' won't be stored, even though their
  contents will be.
- Document that `optional' faked-up entries won't be created.

diffstat:

 bin/pax/ftree.c |  14 ++++++++------
 bin/pax/pax.1   |  16 +++++++++++++---
 2 files changed, 21 insertions(+), 9 deletions(-)

diffs (103 lines):

diff -r 566b423db561 -r afeb41cf366e bin/pax/ftree.c
--- a/bin/pax/ftree.c   Sat Apr 20 21:25:01 2002 +0000
+++ b/bin/pax/ftree.c   Sat Apr 20 23:36:48 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ftree.c,v 1.19 2002/04/12 04:44:08 lukem Exp $ */
+/*     $NetBSD: ftree.c,v 1.20 2002/04/20 23:36:48 lukem Exp $ */
 
 /*-
  * Copyright (c) 1992 Keith Muller.
@@ -78,7 +78,7 @@
 #if 0
 static char sccsid[] = "@(#)ftree.c    8.2 (Berkeley) 4/18/94";
 #else
-__RCSID("$NetBSD: ftree.c,v 1.19 2002/04/12 04:44:08 lukem Exp $");
+__RCSID("$NetBSD: ftree.c,v 1.20 2002/04/20 23:36:48 lukem Exp $");
 #endif
 #endif /* not lint */
 
@@ -430,10 +430,10 @@
         * from specfile info, and jump below to complete setup of arcn.
         */
        if (Mflag) {
-               int     optionalfake;
+               int     skipoptional;
 
  next_ftnode:
-               optionalfake = 0;
+               skipoptional = 0;
                if (ftnode == NULL)             /* tree is empty */
                        return (-1);
 
@@ -455,7 +455,7 @@
                                                /* look for existing file */
                if (lstat(Mftent.fts_path, &statbuf) == -1) {
                        if (ftnode->flags & F_OPT)
-                               optionalfake = 1;
+                               skipoptional = 1;
 
                                                /* missing: fake up stat info */
                        memset(&statbuf, 0, sizeof(statbuf));
@@ -493,6 +493,8 @@
                                    inotype(statbuf.st_mode));
                                return(-1);
                        }
+                       if (ftnode->type == F_DIR && (ftnode->flags & F_OPT))
+                               skipoptional = 1;
                }
                /*
                 * override settings with those from specfile
@@ -550,7 +552,7 @@
                                }
                        }
                } while (ftnode != NULL && ftnode->flags & F_VISIT);
-               if (optionalfake)       /* skip optional faked up entries */
+               if (skipoptional)       /* skip optional entries */
                        goto next_ftnode;
                goto got_ftent;
        }
diff -r 566b423db561 -r afeb41cf366e bin/pax/pax.1
--- a/bin/pax/pax.1     Sat Apr 20 21:25:01 2002 +0000
+++ b/bin/pax/pax.1     Sat Apr 20 23:36:48 2002 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: pax.1,v 1.31 2002/02/08 01:21:58 ross Exp $
+.\"    $NetBSD: pax.1,v 1.32 2002/04/20 23:36:48 lukem Exp $
 .\"
 .\" Copyright (c) 1992 Keith Muller.
 .\" Copyright (c) 1992, 1993
@@ -37,7 +37,7 @@
 .\"
 .\"    @(#)pax.1       8.4 (Berkeley) 4/18/94
 .\"
-.Dd January 24, 2002
+.Dd April 21, 2002
 .Dt PAX 1
 .Os
 .Sh NAME
@@ -894,8 +894,13 @@
 modification time will be used unless specifically overridden by the specfile.
 An error will be raised if the type of entry in the specfile conflicts
 with that of an existing file.
+A directory entry that is marked
+.Sq Sy optional
+will not be copied (even though its contents will be)
 .Pp
-Otherwise, it is necessary to specify at least the following parameters
+Otherwise, the entry will be
+.Sq faked-up ,
+and it is necessary to specify at least the following parameters
 in the specfile:
 .Sy type ,
 .Sy mode ,
@@ -913,6 +918,11 @@
 If
 .Sy time
 isn't provided, the current time will be used.
+A
+.Sq faked-up
+entry that is marked
+.Sq Sy optional
+will not be copied.
 .It Fl N Ar dbdir
 Except for lookups for the
 .Fl G



Home | Main Index | Thread Index | Old Index