Source-Changes-HG archive

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

[src/trunk]: src/bin/pax If an entry is in the specfile but not in the underl...



details:   https://anonhg.NetBSD.org/src/rev/10618463821f
branches:  trunk
changeset: 525481:10618463821f
user:      lukem <lukem%NetBSD.org@localhost>
date:      Fri Apr 12 04:44:08 2002 +0000

description:
If an entry is in the specfile but not in the underlying file system, and it's
marked "optional", don't add it.

diffstat:

 bin/pax/ftree.c |  13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diffs (48 lines):

diff -r 189bc0d96da6 -r 10618463821f bin/pax/ftree.c
--- a/bin/pax/ftree.c   Fri Apr 12 03:51:31 2002 +0000
+++ b/bin/pax/ftree.c   Fri Apr 12 04:44:08 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ftree.c,v 1.18 2002/02/02 12:34:39 lukem Exp $ */
+/*     $NetBSD: ftree.c,v 1.19 2002/04/12 04:44:08 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.18 2002/02/02 12:34:39 lukem Exp $");
+__RCSID("$NetBSD: ftree.c,v 1.19 2002/04/12 04:44:08 lukem Exp $");
 #endif
 #endif /* not lint */
 
@@ -430,6 +430,10 @@
         * from specfile info, and jump below to complete setup of arcn.
         */
        if (Mflag) {
+               int     optionalfake;
+
+ next_ftnode:
+               optionalfake = 0;
                if (ftnode == NULL)             /* tree is empty */
                        return (-1);
 
@@ -450,6 +454,9 @@
                ftent = &Mftent;
                                                /* look for existing file */
                if (lstat(Mftent.fts_path, &statbuf) == -1) {
+                       if (ftnode->flags & F_OPT)
+                               optionalfake = 1;
+
                                                /* missing: fake up stat info */
                        memset(&statbuf, 0, sizeof(statbuf));
                        statbuf.st_dev = MFTENT_DUMMY_DEV;
@@ -543,6 +550,8 @@
                                }
                        }
                } while (ftnode != NULL && ftnode->flags & F_VISIT);
+               if (optionalfake)       /* skip optional faked up entries */
+                       goto next_ftnode;
                goto got_ftent;
        }
 #endif /* SMALL */



Home | Main Index | Thread Index | Old Index