diff options
author | jlam <jlam@pkgsrc.org> | 2004-08-21 04:10:40 +0000 |
---|---|---|
committer | jlam <jlam@pkgsrc.org> | 2004-08-21 04:10:40 +0000 |
commit | 9488cfa1457efebae86e232bc3bc9b694abf9a9a (patch) | |
tree | 0dde80fc1ed503e4d4ea35cd178735a3dac7d33b /pkgtools/mtree | |
parent | ff44898db4c0b765e4f054b0cf6c29ac6d18d254 (diff) | |
download | pkgsrc-9488cfa1457efebae86e232bc3bc9b694abf9a9a.tar.gz |
Update pkgtools/mtree to 20040722 (the latest on src HEAD). Changes
from the previous version include:
- Add a mtree2nbcompat script to ease importing from src HEAD into
pkgsrc.
* Implement -M to "merge" entries, even with different types. This
can be used in /etc/security to allow special.local to override
types of entries in special (e.g, replacing a dir with a link).
* Rename Wflag to mtree_Wflag, to be more "external namespace" friendly.
Diffstat (limited to 'pkgtools/mtree')
-rw-r--r-- | pkgtools/mtree/Makefile | 4 | ||||
-rw-r--r-- | pkgtools/mtree/files/compare.c | 26 | ||||
-rw-r--r-- | pkgtools/mtree/files/config.h.in | 4 | ||||
-rw-r--r-- | pkgtools/mtree/files/configure.ac | 4 | ||||
-rw-r--r-- | pkgtools/mtree/files/crc.c | 8 | ||||
-rw-r--r-- | pkgtools/mtree/files/create.c | 13 | ||||
-rw-r--r-- | pkgtools/mtree/files/excludes.c | 8 | ||||
-rw-r--r-- | pkgtools/mtree/files/extern.h | 13 | ||||
-rw-r--r-- | pkgtools/mtree/files/getid.c | 6 | ||||
-rw-r--r-- | pkgtools/mtree/files/misc.c | 12 | ||||
-rw-r--r-- | pkgtools/mtree/files/mtree.8 | 47 | ||||
-rw-r--r-- | pkgtools/mtree/files/mtree.c | 17 | ||||
-rw-r--r-- | pkgtools/mtree/files/mtree.cat8 | 28 | ||||
-rw-r--r-- | pkgtools/mtree/files/mtree.h | 3 | ||||
-rwxr-xr-x | pkgtools/mtree/files/mtree2nbcompat | 57 | ||||
-rw-r--r-- | pkgtools/mtree/files/pack_dev.c | 110 | ||||
-rw-r--r-- | pkgtools/mtree/files/pack_dev.h | 4 | ||||
-rw-r--r-- | pkgtools/mtree/files/spec.c | 68 | ||||
-rw-r--r-- | pkgtools/mtree/files/stat_flags.c | 20 | ||||
-rw-r--r-- | pkgtools/mtree/files/verify.c | 16 |
20 files changed, 327 insertions, 141 deletions
diff --git a/pkgtools/mtree/Makefile b/pkgtools/mtree/Makefile index 5d40db6a593..f12c1ac7a00 100644 --- a/pkgtools/mtree/Makefile +++ b/pkgtools/mtree/Makefile @@ -1,7 +1,7 @@ -# $NetBSD: Makefile,v 1.11 2004/08/14 02:33:32 jlam Exp $ +# $NetBSD: Makefile,v 1.12 2004/08/21 04:10:45 jlam Exp $ # -DISTNAME= mtree-20031220 +DISTNAME= mtree-20040722 CATEGORIES= pkgtools MASTER_SITES= # empty DISTFILES= # empty diff --git a/pkgtools/mtree/files/compare.c b/pkgtools/mtree/files/compare.c index a3d6b08813f..94ba6bb7586 100644 --- a/pkgtools/mtree/files/compare.c +++ b/pkgtools/mtree/files/compare.c @@ -1,4 +1,4 @@ -/* $NetBSD: compare.c,v 1.3 2004/04/16 23:43:36 heinz Exp $ */ +/* $NetBSD: compare.c,v 1.4 2004/08/21 04:10:45 jlam Exp $ */ /*- * Copyright (c) 1989, 1993 @@ -32,6 +32,10 @@ #if HAVE_CONFIG_H #include "config.h" #endif +#if HAVE_NBTOOL_CONFIG_H +#include "nbtool_config.h" +#endif + #include <nbcompat.h> #if HAVE_SYS_CDEFS_H #include <sys/cdefs.h> @@ -40,7 +44,7 @@ #if 0 static char sccsid[] = "@(#)compare.c 8.1 (Berkeley) 6/6/93"; #else -__RCSID("$NetBSD: compare.c,v 1.3 2004/04/16 23:43:36 heinz Exp $"); +__RCSID("$NetBSD: compare.c,v 1.4 2004/08/21 04:10:45 jlam Exp $"); #endif #endif /* not lint */ @@ -176,16 +180,18 @@ compare(NODE *s, FTSENT *p) if (!S_ISLNK(p->fts_statp->st_mode)) goto typeerr; break; +#ifdef S_ISSOCK case F_SOCK: - if (!S_ISSOCK(p->fts_statp->st_mode)) { - typeerr: LABEL; - printf("\ttype (%s, %s)\n", - nodetype(s->type), inotype(p->fts_statp->st_mode)); - return (label); - } + if (!S_ISSOCK(p->fts_statp->st_mode)) + goto typeerr; break; +#endif +typeerr: LABEL; + printf("\ttype (%s, %s)\n", + nodetype(s->type), inotype(p->fts_statp->st_mode)); + return (label); } - if (Wflag) + if (mtree_Wflag) goto afterpermwhack; #if HAVE_FILE_FLAGS if (iflag && !uflag) { @@ -311,7 +317,7 @@ compare(NODE *s, FTSENT *p) struct stat *ps = p->fts_statp; time_t smtime = s->st_mtimespec.tv_sec; -#ifdef BSD4_4 +#if defined(BSD4_4) && !defined(HAVE_NBTOOL_CONFIG_H) time_t pmtime = ps->st_mtimespec.tv_sec; TIMESPEC_TO_TIMEVAL(&tv[0], &s->st_mtimespec); diff --git a/pkgtools/mtree/files/config.h.in b/pkgtools/mtree/files/config.h.in index 65b0cc7ace4..6023477baf2 100644 --- a/pkgtools/mtree/files/config.h.in +++ b/pkgtools/mtree/files/config.h.in @@ -238,9 +238,7 @@ /* define HAVE_FILE_FLAGS if the user- and root-changeable masks were detected */ -#if defined(HAVE_STRUCT_STAT_ST_FLAGS) && (HAVE_DECL_UF_SETTABLE == 1) && (HAVE_DECL_SF_SETTABLE == 1) +#if HAVE_STRUCT_STAT_ST_FLAGS && HAVE_DECL_UF_SETTABLE && HAVE_DECL_SF_SETTABLE #define HAVE_FILE_FLAGS 1 -#else -#define HAVE_FILE_FLAGS 0 #endif diff --git a/pkgtools/mtree/files/configure.ac b/pkgtools/mtree/files/configure.ac index 82c2f1c7ebf..94f0d5cd4ee 100644 --- a/pkgtools/mtree/files/configure.ac +++ b/pkgtools/mtree/files/configure.ac @@ -32,10 +32,8 @@ AC_CHECK_MEMBERS([struct stat.st_flags]) AC_CHECK_DECLS([UF_SETTABLE, SF_SETTABLE]) AH_BOTTOM([/* define HAVE_FILE_FLAGS if the user- and root-changeable masks were detected */ -#if defined(HAVE_STRUCT_STAT_ST_FLAGS) && (HAVE_DECL_UF_SETTABLE == 1) && (HAVE_DECL_SF_SETTABLE == 1) +#if HAVE_STRUCT_STAT_ST_FLAGS && HAVE_DECL_UF_SETTABLE && HAVE_DECL_SF_SETTABLE #define HAVE_FILE_FLAGS 1 -#else -#define HAVE_FILE_FLAGS 0 #endif ]) AC_HEADER_TIME diff --git a/pkgtools/mtree/files/crc.c b/pkgtools/mtree/files/crc.c index e75cdb6756e..3d4008ea6dd 100644 --- a/pkgtools/mtree/files/crc.c +++ b/pkgtools/mtree/files/crc.c @@ -1,4 +1,4 @@ -/* $NetBSD: crc.c,v 1.2 2003/09/05 04:38:47 grant Exp $ */ +/* $NetBSD: crc.c,v 1.3 2004/08/21 04:10:45 jlam Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -35,6 +35,10 @@ #if HAVE_CONFIG_H #include "config.h" #endif +#if HAVE_NBTOOL_CONFIG_H +#include "nbtool_config.h" +#endif + #include <nbcompat.h> #if HAVE_SYS_CDEFS_H #include <sys/cdefs.h> @@ -43,7 +47,7 @@ #if 0 static char sccsid[] = "@(#)crc.c 8.1 (Berkeley) 6/17/93"; #else -__RCSID("$NetBSD: crc.c,v 1.2 2003/09/05 04:38:47 grant Exp $"); +__RCSID("$NetBSD: crc.c,v 1.3 2004/08/21 04:10:45 jlam Exp $"); #endif #endif /* not lint */ diff --git a/pkgtools/mtree/files/create.c b/pkgtools/mtree/files/create.c index 86990f93d8d..1a3f693b5e7 100644 --- a/pkgtools/mtree/files/create.c +++ b/pkgtools/mtree/files/create.c @@ -1,4 +1,4 @@ -/* $NetBSD: create.c,v 1.3 2004/04/16 23:43:36 heinz Exp $ */ +/* $NetBSD: create.c,v 1.4 2004/08/21 04:10:45 jlam Exp $ */ /*- * Copyright (c) 1989, 1993 @@ -32,6 +32,10 @@ #if HAVE_CONFIG_H #include "config.h" #endif +#if HAVE_NBTOOL_CONFIG_H +#include "nbtool_config.h" +#endif + #include <nbcompat.h> #if HAVE_SYS_CDEFS_H #include <sys/cdefs.h> @@ -40,7 +44,7 @@ #if 0 static char sccsid[] = "@(#)create.c 8.1 (Berkeley) 6/6/93"; #else -__RCSID("$NetBSD: create.c,v 1.3 2004/04/16 23:43:36 heinz Exp $"); +__RCSID("$NetBSD: create.c,v 1.4 2004/08/21 04:10:45 jlam Exp $"); #endif #endif /* not lint */ @@ -51,7 +55,7 @@ __RCSID("$NetBSD: create.c,v 1.3 2004/04/16 23:43:36 heinz Exp $"); #include <sys/stat.h> #endif -#if !HAVE_CONFIG_H +#if ! HAVE_NBTOOL_CONFIG_H #if HAVE_DIRENT_H #include <dirent.h> #endif @@ -218,7 +222,7 @@ statf(FTSENT *p) output(&indent, "nlink=%u", p->fts_statp->st_nlink); if (keys & F_SIZE && S_ISREG(p->fts_statp->st_mode)) output(&indent, "size=%lld", (long long)p->fts_statp->st_size); -#ifdef BSD4_4 +#if defined(BSD4_4) && !defined(HAVE_NBTOOL_CONFIG_H) if (keys & F_TIME) output(&indent, "time=%ld.%ld", (long)p->fts_statp->st_mtimespec.tv_sec, @@ -412,4 +416,3 @@ output(int *offset, const char *fmt, ...) } *offset += printf(" %s", buf) + 1; } - diff --git a/pkgtools/mtree/files/excludes.c b/pkgtools/mtree/files/excludes.c index f377121f8aa..111da4e82c0 100644 --- a/pkgtools/mtree/files/excludes.c +++ b/pkgtools/mtree/files/excludes.c @@ -1,4 +1,4 @@ -/* $NetBSD: excludes.c,v 1.3 2003/12/20 04:54:56 grant Exp $ */ +/* $NetBSD: excludes.c,v 1.4 2004/08/21 04:10:45 jlam Exp $ */ /* * Copyright 2000 Massachusetts Institute of Technology @@ -32,13 +32,17 @@ #if HAVE_CONFIG_H #include "config.h" #endif +#if HAVE_NBTOOL_CONFIG_H +#include "nbtool_config.h" +#endif + #include <nbcompat.h> #if HAVE_SYS_CDEFS_H #include <sys/cdefs.h> #endif #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: excludes.c,v 1.3 2003/12/20 04:54:56 grant Exp $"); +__RCSID("$NetBSD: excludes.c,v 1.4 2004/08/21 04:10:45 jlam Exp $"); #endif #if HAVE_SYS_TYPES_H diff --git a/pkgtools/mtree/files/extern.h b/pkgtools/mtree/files/extern.h index 9bba26ca45d..df10fde4164 100644 --- a/pkgtools/mtree/files/extern.h +++ b/pkgtools/mtree/files/extern.h @@ -1,4 +1,4 @@ -/* $NetBSD: extern.h,v 1.1 2003/09/05 18:38:58 jlam Exp $ */ +/* $NetBSD: extern.h,v 1.2 2004/08/21 04:10:45 jlam Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -31,12 +31,13 @@ * @(#)extern.h 8.1 (Berkeley) 6/6/93 */ +#if HAVE_CONFIG_H +#include "config.h" +#endif #include "mtree.h" -#if HAVE_CONFIG_H -#include "config.h" -#else -#define HAVE_STRUCT_STAT_ST_FLAGS 1 +#if HAVE_NBTOOL_CONFIG_H +#include "nbtool_config.h" #endif #include <nbcompat.h> @@ -77,7 +78,7 @@ const char *rlink(const char *); int verify(void); extern int dflag, eflag, iflag, lflag, mflag, rflag, sflag, tflag, uflag; -extern int Wflag; +extern int mtree_Mflag, mtree_Wflag; extern size_t mtree_lineno; extern u_int32_t crc_total; extern int ftsoptions, keys; diff --git a/pkgtools/mtree/files/getid.c b/pkgtools/mtree/files/getid.c index e2303ec1bd5..55b93ed3b96 100644 --- a/pkgtools/mtree/files/getid.c +++ b/pkgtools/mtree/files/getid.c @@ -1,4 +1,4 @@ -/* $NetBSD: getid.c,v 1.1 2003/09/05 18:38:58 jlam Exp $ */ +/* $NetBSD: getid.c,v 1.2 2004/08/21 04:10:45 jlam Exp $ */ /* from: NetBSD: getpwent.c,v 1.48 2000/10/03 03:22:26 enami Exp */ /* from: NetBSD: getgrent.c,v 1.41 2002/01/12 23:51:30 lukem Exp */ @@ -70,6 +70,10 @@ #if HAVE_CONFIG_H #include "config.h" #endif +#if HAVE_NBTOOL_CONFIG_H +#include "nbtool_config.h" +#endif + #include <nbcompat.h> #if HAVE_SYS_PARAM_H #include <sys/param.h> diff --git a/pkgtools/mtree/files/misc.c b/pkgtools/mtree/files/misc.c index c72bd0bfc24..4a759116fc5 100644 --- a/pkgtools/mtree/files/misc.c +++ b/pkgtools/mtree/files/misc.c @@ -1,4 +1,4 @@ -/* $NetBSD: misc.c,v 1.1 2003/09/05 18:38:59 jlam Exp $ */ +/* $NetBSD: misc.c,v 1.2 2004/08/21 04:10:45 jlam Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -34,12 +34,16 @@ #if HAVE_CONFIG_H #include "config.h" #endif +#if HAVE_NBTOOL_CONFIG_H +#include "nbtool_config.h" +#endif + #include <nbcompat.h> #if HAVE_SYS_CDEFS_H #include <sys/cdefs.h> #endif #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: misc.c,v 1.1 2003/09/05 18:38:59 jlam Exp $"); +__RCSID("$NetBSD: misc.c,v 1.2 2004/08/21 04:10:45 jlam Exp $"); #endif /* not lint */ #if HAVE_SYS_TYPES_H @@ -262,8 +266,10 @@ nodetoino(u_int type) return S_IFREG; case F_LINK: return S_IFLNK; +#ifdef S_IFSOCK case F_SOCK: return S_IFSOCK; +#endif default: printf("unknown type %d", type); abort(); @@ -296,8 +302,10 @@ inotype(u_int type) return ("file"); case S_IFLNK: return ("link"); +#ifdef S_IFSOCK case S_IFSOCK: return ("socket"); +#endif default: return ("unknown"); } diff --git a/pkgtools/mtree/files/mtree.8 b/pkgtools/mtree/files/mtree.8 index 0cf56d3bfd7..1166a07fef3 100644 --- a/pkgtools/mtree/files/mtree.8 +++ b/pkgtools/mtree/files/mtree.8 @@ -1,4 +1,4 @@ -.\" $NetBSD: mtree.8,v 1.2 2003/09/05 04:38:47 grant Exp $ +.\" $NetBSD: mtree.8,v 1.3 2004/08/21 04:10:45 jlam Exp $ .\" .\" Copyright (c) 1989, 1990, 1993 .\" The Regents of the University of California. All rights reserved. @@ -27,9 +27,43 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" +.\" Copyright (c) 2001-2004 The NetBSD Foundation, Inc. +.\" All rights reserved. +.\" +.\" This code is derived from software contributed to The NetBSD Foundation +.\" by Luke Mewburn of Wasabi Systems. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by the NetBSD +.\" Foundation, Inc. and its contributors. +.\" 4. Neither the name of The NetBSD Foundation nor the names of its +.\" contributors may be used to endorse or promote products derived +.\" from this software without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS +.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS +.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. +.\" .\" @(#)mtree.8 8.2 (Berkeley) 12/11/93 .\" -.Dd December 22, 2002 +.Dd July 22, 2004 .Dt MTREE 8 .Os .Sh NAME @@ -37,7 +71,7 @@ .Nd map a directory hierarchy .Sh SYNOPSIS .Nm -.Op Fl cCdDelLPruUWx +.Op Fl cCdDelLMPruUWx .Bk -words .Op Fl i | Fl m .Ek @@ -167,6 +201,9 @@ this is only possible with securelevel less than 1 (i. e. in single user mode or while the system is running in insecure mode). See .Xr init 8 for information on security levels. +.It Fl M +Permit merging of specification entries with different types, +with the last entry take precedence. .It Fl N Ar dbdir Use the user database text file .Pa master.passwd @@ -508,7 +545,9 @@ All parent directories referenced in the path name must exist. The current directory path used by relative path names will be updated appropriately. Multiple entries for the same full path are permitted if the types -are the same; +are the same (unless +.Fl M +is given, and then the types may differ); in this case the settings for the last entry take precedence. .Pp A path name that does not contain a slash will be treated as a relative path. diff --git a/pkgtools/mtree/files/mtree.c b/pkgtools/mtree/files/mtree.c index 7f87e2a585b..77c4d710b7a 100644 --- a/pkgtools/mtree/files/mtree.c +++ b/pkgtools/mtree/files/mtree.c @@ -1,4 +1,4 @@ -/* $NetBSD: mtree.c,v 1.2 2003/09/05 04:38:47 grant Exp $ */ +/* $NetBSD: mtree.c,v 1.3 2004/08/21 04:10:45 jlam Exp $ */ /*- * Copyright (c) 1989, 1990, 1993 @@ -32,6 +32,10 @@ #if HAVE_CONFIG_H #include "config.h" #endif +#if HAVE_NBTOOL_CONFIG_H +#include "nbtool_config.h" +#endif + #include <nbcompat.h> #if HAVE_SYS_CDEFS_H #include <sys/cdefs.h> @@ -45,7 +49,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 1990, 1993\n\ #if 0 static char sccsid[] = "@(#)mtree.c 8.1 (Berkeley) 6/6/93"; #else -__RCSID("$NetBSD: mtree.c,v 1.2 2003/09/05 04:38:47 grant Exp $"); +__RCSID("$NetBSD: mtree.c,v 1.3 2004/08/21 04:10:45 jlam Exp $"); #endif #endif /* not lint */ @@ -93,7 +97,7 @@ main(int argc, char **argv) dir = NULL; init_excludes(); - while ((ch = getopt(argc, argv, "cCdDeE:f:I:ik:K:lLmN:p:PrR:s:tuUWxX:")) + while ((ch = getopt(argc, argv, "cCdDeE:f:I:ik:K:lLmMN:p:PrR:s:tuUWxX:")) != -1) { switch((char)ch) { case 'c': @@ -145,6 +149,9 @@ main(int argc, char **argv) case 'm': mflag = 1; break; + case 'M': + mtree_Mflag = 1; + break; case 'N': if (! setup_getid(optarg)) mtree_err( @@ -182,7 +189,7 @@ main(int argc, char **argv) Uflag = uflag = 1; break; case 'W': - Wflag = 1; + mtree_Wflag = 1; break; case 'x': ftsoptions |= FTS_XDEV; @@ -235,7 +242,7 @@ usage(void) { fprintf(stderr, - "usage: %s [-cCdDelLPruUWx] [-i|-m] [-f spec] [-k key]\n" + "usage: %s [-cCdDelLMPruUWx] [-i|-m] [-f spec] [-k key]\n" "\t\t[-K addkey] [-R removekey] [-I inctags] [-E exctags]\n" "\t\t[-N userdbdir] [-X exclude-file] [-p path] [-s seed]\n", getprogname()); diff --git a/pkgtools/mtree/files/mtree.cat8 b/pkgtools/mtree/files/mtree.cat8 index 2835f2bf4f5..9b93e35ef96 100644 --- a/pkgtools/mtree/files/mtree.cat8 +++ b/pkgtools/mtree/files/mtree.cat8 @@ -4,7 +4,7 @@ NNAAMMEE mmttrreeee - map a directory hierarchy SSYYNNOOPPSSIISS - mmttrreeee [--ccCCddDDeellLLPPrruuUUWWxx] [--ii | --mm] [--ff _s_p_e_c] [--pp _p_a_t_h] [--kk _k_e_y_w_o_r_d_s] + mmttrreeee [--ccCCddDDeellLLMMPPrruuUUWWxx] [--ii | --mm] [--ff _s_p_e_c] [--pp _p_a_t_h] [--kk _k_e_y_w_o_r_d_s] [--KK _k_e_y_w_o_r_d_s] [--RR _k_e_y_w_o_r_d_s] [--EE _t_a_g_s] [--II _t_a_g_s] [--NN _d_b_d_i_r] [--ss _s_e_e_d] [--XX _e_x_c_l_u_d_e_-_f_i_l_e] @@ -46,8 +46,8 @@ DDEESSCCRRIIPPTTIIOONN --II _t_a_g_s Add the comma separated tags to the ``inclusion'' list. Non-direc- tories with tags which are in the inclusion list are printed with - --DD. If no inclusion list is provided, the default is to display - all files. + --DD. If no inclusion list is provided, the default is to display all + files. --ii If specified, set the schg and/or sappnd flags. @@ -76,6 +76,9 @@ DDEESSCCRRIIPPTTIIOONN in single user mode or while the system is running in insecure mode). See init(8) for information on security levels. + --MM Permit merging of specification entries with different types, with + the last entry take precedence. + --NN _d_b_d_i_r Use the user database text file _m_a_s_t_e_r_._p_a_s_s_w_d and group database text file _g_r_o_u_p from _d_b_d_i_r, rather than using the results from the @@ -199,7 +202,7 @@ DDEESSCCRRIIPPTTIIOONN ssiizzee The size, in bytes, of the file. - ttaaggss Comma delimited tags to be matched with --EE and --II. These may be + ttaaggss Comma delimited tags to be matched with --EE and --II. These may be specified without leading or trailing commas, but will be stored internally with them. @@ -236,8 +239,8 @@ DDEESSCCRRIIPPTTIIOONN separated by whitespace. If `all' is specified, unset all of the keywords. - 3. A file specification, consisting of a path name, followed by white- - space, followed by zero or more whitespace separated keyword/value + 3. A file specification, consisting of a path name, followed by whites- + pace, followed by zero or more whitespace separated keyword/value pairs. The path name may be preceded by whitespace characters. The path @@ -251,9 +254,9 @@ DDEESSCCRRIIPPTTIIOONN from comments. Each of the keyword/value pairs consist of a keyword, followed by an - equals sign (`='), followed by the keyword's value, without white- - space characters. These values override, without changing, the - global value of the corresponding keyword. + equals sign (`='), followed by the keyword's value, without whites- + pace characters. These values override, without changing, the glob- + al value of the corresponding keyword. The first path name entry listed must be a directory named `.', as this ensures that intermixing full and relative path names will work @@ -266,8 +269,9 @@ DDEESSCCRRIIPPTTIIOONN tree). All parent directories referenced in the path name must ex- ist. The current directory path used by relative path names will be updated appropriately. Multiple entries for the same full path are - permitted if the types are the same; in this case the settings for - the last entry take precedence. + permitted if the types are the same (unless --MM is given, and then + the types may differ); in this case the settings for the last entry + take precedence. A path name that does not contain a slash will be treated as a rela- tive path. Specifying a directory will cause subsequent files to be @@ -313,4 +317,4 @@ HHIISSTTOORRYY rrmmdd116600, sshhaa11, ttaaggss, and aallll keywords, --DD, --EE, --II, --ll, --LL, --NN, --PP, --RR, --WW, and --XX flags, and support for full paths appeared in NetBSD 1.6. -NetBSD 1.6 December 22, 2002 NetBSD 1.6 +NetBSD 1.6.2 July 22, 2004 5 diff --git a/pkgtools/mtree/files/mtree.h b/pkgtools/mtree/files/mtree.h index 709600def70..30b81722354 100644 --- a/pkgtools/mtree/files/mtree.h +++ b/pkgtools/mtree/files/mtree.h @@ -1,4 +1,4 @@ -/* $NetBSD: mtree.h,v 1.1 2003/09/05 18:38:59 jlam Exp $ */ +/* $NetBSD: mtree.h,v 1.2 2004/08/21 04:10:45 jlam Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -111,6 +111,7 @@ const char *inotype(u_int); u_int nodetoino(u_int); int setup_getid(const char *); NODE *spec(FILE *); +void free_nodes(NODE *); char *vispath(const char *); diff --git a/pkgtools/mtree/files/mtree2nbcompat b/pkgtools/mtree/files/mtree2nbcompat new file mode 100755 index 00000000000..c8c79d300ea --- /dev/null +++ b/pkgtools/mtree/files/mtree2nbcompat @@ -0,0 +1,57 @@ +#!/bin/sh +# +# $NetBSD: mtree2nbcompat,v 1.1 2004/08/21 04:10:45 jlam Exp $ +# +# Copyright (c) 2004 The NetBSD Foundation, Inc. +# All rights reserved. +# +# This code is derived from software contributed to The NetBSD Foundation +# by Johnny C. Lam. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. All advertising materials mentioning features or use of this software +# must display the following acknowledgement: +# This product includes software developed by the NetBSD +# Foundation, Inc. and its contributors. +# 4. Neither the name of The NetBSD Foundation nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS +# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS +# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# + +if [ $# -lt 1 ]; then echo "pax2nbcompat dest"; exit 1; fi + +: ${PKGSRCDIR:=/usr/pkgsrc} +: ${BSDSRCDIR:=/usr/src} + +if [ ! -d "${BSDSRCDIR}" ]; then + echo "${BSDSRCDIR} doesn't exist" + exit 1 +fi + +src2nbcompat="${PKGSRCDIR}/pkgtools/libnbcompat/files/src2nbcompat" +dest=$1 + +$src2nbcompat ${BSDSRCDIR}/usr.sbin/mtree $dest +$src2nbcompat ${BSDSRCDIR}/bin/ls/stat_flags.c $dest/stat_flags.c +$src2nbcompat ${BSDSRCDIR}/bin/ls/stat_flags.h $dest/stat_flags.h +$src2nbcompat ${BSDSRCDIR}/sbin/mknod/pack_dev.c $dest/pack_dev.c +$src2nbcompat ${BSDSRCDIR}/sbin/mknod/pack_dev.h $dest/pack_dev.h diff --git a/pkgtools/mtree/files/pack_dev.c b/pkgtools/mtree/files/pack_dev.c index 781332351a6..3a6407be3c2 100644 --- a/pkgtools/mtree/files/pack_dev.c +++ b/pkgtools/mtree/files/pack_dev.c @@ -1,4 +1,4 @@ -/* $NetBSD: pack_dev.c,v 1.1 2003/09/05 18:38:59 jlam Exp $ */ +/* $NetBSD: pack_dev.c,v 1.2 2004/08/21 04:10:45 jlam Exp $ */ /*- * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc. @@ -39,12 +39,16 @@ #if HAVE_CONFIG_H #include "config.h" #endif +#if HAVE_NBTOOL_CONFIG_H +#include "nbtool_config.h" +#endif + #include <nbcompat.h> #if HAVE_SYS_CDEFS_H #include <sys/cdefs.h> #endif -#if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: pack_dev.c,v 1.1 2003/09/05 18:38:59 jlam Exp $"); +#if !defined(lint) +__RCSID("$NetBSD: pack_dev.c,v 1.2 2004/08/21 04:10:45 jlam Exp $"); #endif /* not lint */ #if HAVE_SYS_TYPES_H @@ -54,9 +58,6 @@ __RCSID("$NetBSD: pack_dev.c,v 1.1 2003/09/05 18:38:59 jlam Exp $"); #include <sys/stat.h> #endif -#if HAVE_ERR_H -#include <err.h> -#endif #if HAVE_LIMITS_H #include <limits.h> #endif @@ -73,10 +74,6 @@ __RCSID("$NetBSD: pack_dev.c,v 1.1 2003/09/05 18:38:59 jlam Exp $"); #include <unistd.h> #endif -#if HAVE_CONFIG_H -#include "config.h" -#endif - #include "pack_dev.h" static pack_t pack_netbsd; @@ -88,38 +85,41 @@ static pack_t pack_8_24; static pack_t pack_bsdos; static int compare_format(const void *, const void *); +static const char iMajorError[] = "invalid major number"; +static const char iMinorError[] = "invalid minor number"; +static const char tooManyFields[] = "too many fields for format"; /* exported */ portdev_t -pack_native(int n, u_long numbers[]) +pack_native(int n, u_long numbers[], const char **error) { - portdev_t dev; + portdev_t dev = 0; if (n == 2) { dev = makedev(numbers[0], numbers[1]); if (major(dev) != numbers[0]) - errx(1, "invalid major number"); - if (minor(dev) != numbers[1]) - errx(1, "invalid minor number"); + *error = iMajorError; + else if (minor(dev) != numbers[1]) + *error = iMinorError; } else - errx(1, "too many fields for format"); + *error = tooManyFields; return (dev); } static portdev_t -pack_netbsd(int n, u_long numbers[]) +pack_netbsd(int n, u_long numbers[], const char **error) { - portdev_t dev; + portdev_t dev = 0; if (n == 2) { dev = makedev_netbsd(numbers[0], numbers[1]); if (major_netbsd(dev) != numbers[0]) - errx(1, "invalid major number"); - if (minor_netbsd(dev) != numbers[1]) - errx(1, "invalid minor number"); + *error = iMajorError; + else if (minor_netbsd(dev) != numbers[1]) + *error = iMinorError; } else - errx(1, "too many fields for format"); + *error = tooManyFields; return (dev); } @@ -130,18 +130,18 @@ pack_netbsd(int n, u_long numbers[]) (((y) << 0) & 0xffff00ff))) static portdev_t -pack_freebsd(int n, u_long numbers[]) +pack_freebsd(int n, u_long numbers[], const char **error) { - portdev_t dev; + portdev_t dev = 0; if (n == 2) { dev = makedev_freebsd(numbers[0], numbers[1]); if (major_freebsd(dev) != numbers[0]) - errx(1, "invalid major number"); + *error = iMajorError; if (minor_freebsd(dev) != numbers[1]) - errx(1, "invalid minor number"); + *error = iMinorError; } else - errx(1, "too many fields for format"); + *error = tooManyFields; return (dev); } @@ -152,18 +152,18 @@ pack_freebsd(int n, u_long numbers[]) (((y) << 0) & 0x000000ff))) static portdev_t -pack_8_8(int n, u_long numbers[]) +pack_8_8(int n, u_long numbers[], const char **error) { - portdev_t dev; + portdev_t dev = 0; if (n == 2) { dev = makedev_8_8(numbers[0], numbers[1]); if (major_8_8(dev) != numbers[0]) - errx(1, "invalid major number"); + *error = iMajorError; if (minor_8_8(dev) != numbers[1]) - errx(1, "invalid minor number"); + *error = iMinorError; } else - errx(1, "too many fields for format"); + *error = tooManyFields; return (dev); } @@ -174,18 +174,18 @@ pack_8_8(int n, u_long numbers[]) (((y) << 0) & 0x000fffff))) static portdev_t -pack_12_20(int n, u_long numbers[]) +pack_12_20(int n, u_long numbers[], const char **error) { - portdev_t dev; + portdev_t dev = 0; if (n == 2) { dev = makedev_12_20(numbers[0], numbers[1]); if (major_12_20(dev) != numbers[0]) - errx(1, "invalid major number"); + *error = iMajorError; if (minor_12_20(dev) != numbers[1]) - errx(1, "invalid minor number"); + *error = iMinorError; } else - errx(1, "too many fields for format"); + *error = tooManyFields; return (dev); } @@ -196,18 +196,18 @@ pack_12_20(int n, u_long numbers[]) (((y) << 0) & 0x0003ffff))) static portdev_t -pack_14_18(int n, u_long numbers[]) +pack_14_18(int n, u_long numbers[], const char **error) { - portdev_t dev; + portdev_t dev = 0; if (n == 2) { dev = makedev_14_18(numbers[0], numbers[1]); if (major_14_18(dev) != numbers[0]) - errx(1, "invalid major number"); + *error = iMajorError; if (minor_14_18(dev) != numbers[1]) - errx(1, "invalid minor number"); + *error = iMinorError; } else - errx(1, "too many fields for format"); + *error = tooManyFields; return (dev); } @@ -218,18 +218,18 @@ pack_14_18(int n, u_long numbers[]) (((y) << 0) & 0x00ffffff))) static portdev_t -pack_8_24(int n, u_long numbers[]) +pack_8_24(int n, u_long numbers[], const char **error) { - portdev_t dev; + portdev_t dev = 0; if (n == 2) { dev = makedev_8_24(numbers[0], numbers[1]); if (major_8_24(dev) != numbers[0]) - errx(1, "invalid major number"); + *error = iMajorError; if (minor_8_24(dev) != numbers[1]) - errx(1, "invalid minor number"); + *error = iMinorError; } else - errx(1, "too many fields for format"); + *error = tooManyFields; return (dev); } @@ -242,26 +242,26 @@ pack_8_24(int n, u_long numbers[]) (((z) << 0) & 0x000000ff))) static portdev_t -pack_bsdos(int n, u_long numbers[]) +pack_bsdos(int n, u_long numbers[], const char **error) { - portdev_t dev; + portdev_t dev = 0; if (n == 2) { dev = makedev_12_20(numbers[0], numbers[1]); if (major_12_20(dev) != numbers[0]) - errx(1, "invalid major number"); + *error = iMajorError; if (minor_12_20(dev) != numbers[1]) - errx(1, "invalid minor number"); + *error = iMinorError; } else if (n == 3) { dev = makedev_12_12_8(numbers[0], numbers[1], numbers[2]); if (major_12_12_8(dev) != numbers[0]) - errx(1, "invalid major number"); + *error = iMajorError; if (unit_12_12_8(dev) != numbers[1]) - errx(1, "invalid unit number"); + *error = "invalid unit number"; if (subunit_12_12_8(dev) != numbers[2]) - errx(1, "invalid subunit number"); + *error = "invalid subunit number"; } else - errx(1, "too many fields for format"); + *error = tooManyFields; return (dev); } diff --git a/pkgtools/mtree/files/pack_dev.h b/pkgtools/mtree/files/pack_dev.h index a1a5302f96f..9d87c227165 100644 --- a/pkgtools/mtree/files/pack_dev.h +++ b/pkgtools/mtree/files/pack_dev.h @@ -1,4 +1,4 @@ -/* $NetBSD: pack_dev.h,v 1.1 2003/09/05 18:39:00 jlam Exp $ */ +/* $NetBSD: pack_dev.h,v 1.2 2004/08/21 04:10:45 jlam Exp $ */ /*- * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc. @@ -44,7 +44,7 @@ typedef __dev32_t portdev_t; #else typedef dev_t portdev_t; #endif -typedef portdev_t pack_t(int, u_long []); +typedef portdev_t pack_t(int, u_long [], const char **); pack_t *pack_find(const char *); pack_t pack_native; diff --git a/pkgtools/mtree/files/spec.c b/pkgtools/mtree/files/spec.c index 3ad9493a717..184808a68ca 100644 --- a/pkgtools/mtree/files/spec.c +++ b/pkgtools/mtree/files/spec.c @@ -1,4 +1,4 @@ -/* $NetBSD: spec.c,v 1.2 2003/12/20 04:52:50 grant Exp $ */ +/* $NetBSD: spec.c,v 1.3 2004/08/21 04:10:45 jlam Exp $ */ /*- * Copyright (c) 1989, 1993 @@ -30,7 +30,7 @@ */ /*- - * Copyright (c) 2001-2002 The NetBSD Foundation, Inc. + * Copyright (c) 2001-2004 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation @@ -68,6 +68,10 @@ #if HAVE_CONFIG_H #include "config.h" #endif +#if HAVE_NBTOOL_CONFIG_H +#include "nbtool_config.h" +#endif + #include <nbcompat.h> #if HAVE_SYS_CDEFS_H #include <sys/cdefs.h> @@ -76,7 +80,7 @@ #if 0 static char sccsid[] = "@(#)spec.c 8.2 (Berkeley) 4/28/95"; #else -__RCSID("$NetBSD: spec.c,v 1.2 2003/12/20 04:52:50 grant Exp $"); +__RCSID("$NetBSD: spec.c,v 1.3 2004/08/21 04:10:45 jlam Exp $"); #endif #endif /* not lint */ @@ -122,13 +126,16 @@ __RCSID("$NetBSD: spec.c,v 1.2 2003/12/20 04:52:50 grant Exp $"); #include "pack_dev.h" size_t mtree_lineno; /* Current spec line number */ -int Wflag; /* Don't "whack" permissions */ +int mtree_Mflag; /* Merge duplicate entries */ +int mtree_Wflag; /* Don't "whack" permissions */ static dev_t parsedev(char *); static void replacenode(NODE *, NODE *); static void set(char *, NODE *); static void unset(char *, NODE *); +#define REPLACEPTR(x,v) do { if ((x)) free((x)); (x) = (v); } while (0) + NODE * spec(FILE *fp) { @@ -300,6 +307,27 @@ noparent: mtree_err("no parent node"); return (root); } +void +free_nodes(NODE *root) +{ + NODE *cur, *next; + + if (root == NULL) + return; + + next = NULL; + for (cur = root; cur != NULL; cur = next) { + next = cur->next; + free_nodes(cur->child); + REPLACEPTR(cur->slink, NULL); + REPLACEPTR(cur->md5digest, NULL); + REPLACEPTR(cur->rmd160digest, NULL); + REPLACEPTR(cur->sha1digest, NULL); + REPLACEPTR(cur->tags, NULL); + REPLACEPTR(cur, NULL); + } +} + /* * dump_nodes -- * dump the NODEs from `cur', based in the directory `dir'. @@ -406,6 +434,7 @@ parsedev(char *arg) int argc; pack_t *pack; dev_t result; + const char *error = NULL; if ((dev = strchr(arg, ',')) != NULL) { *dev++='\0'; @@ -424,7 +453,9 @@ parsedev(char *arg) } if (argc < 2) mtree_err("not enough arguments"); - result = (*pack)(argc, numbers); + result = (*pack)(argc, numbers, &error); + if (error != NULL) + mtree_err(error); } else { result = (dev_t)strtoul(arg, &ep, 0); if (*ep != '\0') @@ -437,11 +468,26 @@ static void replacenode(NODE *cur, NODE *new) { - if (cur->type != new->type) - mtree_err("existing entry for `%s', type `%s' does not match type `%s'", - cur->name, nodetype(cur->type), nodetype(new->type)); #define REPLACE(x) cur->x = new->x -#define REPLACESTR(x) if (cur->x) free(cur->x); cur->x = new->x +#define REPLACESTR(x) REPLACEPTR(cur->x,new->x) + + if (cur->type != new->type) { + if (mtree_Mflag) { + /* + * merge entries with different types; we + * don't want children retained in this case. + */ + REPLACE(type); + free_nodes(cur->child); + cur->child = NULL; + } else { + mtree_err( + "existing entry for `%s', type `%s'" + " does not match type `%s'", + cur->name, nodetype(cur->type), + nodetype(new->type)); + } + } REPLACE(st_size); REPLACE(st_mtimespec); @@ -507,7 +553,7 @@ set(char *t, NODE *ip) mtree_err("invalid gid `%s'", val); break; case F_GNAME: - if (Wflag) /* don't parse if whacking */ + if (mtree_Wflag) /* don't parse if whacking */ break; if (gid_from_group(val, &gid) == -1) mtree_err("unknown group `%s'", val); @@ -588,7 +634,7 @@ set(char *t, NODE *ip) mtree_err("invalid uid `%s'", val); break; case F_UNAME: - if (Wflag) /* don't parse if whacking */ + if (mtree_Wflag) /* don't parse if whacking */ break; if (uid_from_user(val, &uid) == -1) mtree_err("unknown user `%s'", val); diff --git a/pkgtools/mtree/files/stat_flags.c b/pkgtools/mtree/files/stat_flags.c index ca74e960e30..5d5986d074c 100644 --- a/pkgtools/mtree/files/stat_flags.c +++ b/pkgtools/mtree/files/stat_flags.c @@ -1,4 +1,4 @@ -/* $NetBSD: stat_flags.c,v 1.2 2004/04/16 23:43:36 heinz Exp $ */ +/* $NetBSD: stat_flags.c,v 1.3 2004/08/21 04:10:45 jlam Exp $ */ /*- * Copyright (c) 1993 @@ -32,24 +32,22 @@ #if HAVE_CONFIG_H #include "config.h" #endif +#if HAVE_NBTOOL_CONFIG_H +#include "nbtool_config.h" +#endif + #include <nbcompat.h> #if HAVE_SYS_CDEFS_H #include <sys/cdefs.h> #endif -#if defined(__RCSID) && !defined(lint) +#if !defined(lint) #if 0 static char sccsid[] = "@(#)stat_flags.c 8.2 (Berkeley) 7/28/94"; #else -__RCSID("$NetBSD: stat_flags.c,v 1.2 2004/04/16 23:43:36 heinz Exp $"); +__RCSID("$NetBSD: stat_flags.c,v 1.3 2004/08/21 04:10:45 jlam Exp $"); #endif #endif /* not lint */ -#if HAVE_CONFIG_H -#include "config.h" -#else -#define HAVE_FILE_FLAGS 1 -#endif - #if HAVE_SYS_TYPES_H #include <sys/types.h> #endif @@ -103,6 +101,10 @@ flags_to_string(u_long flags, const char *def) SAPPEND("arch"); if (flags & SF_IMMUTABLE) SAPPEND("schg"); +#ifdef SF_SNAPSHOT + if (flags & SF_SNAPSHOT) + SAPPEND("snap"); +#endif #endif if (prefix == NULL) strlcpy(string, def, sizeof(string)); diff --git a/pkgtools/mtree/files/verify.c b/pkgtools/mtree/files/verify.c index 0f233468be3..ade36f92b8a 100644 --- a/pkgtools/mtree/files/verify.c +++ b/pkgtools/mtree/files/verify.c @@ -1,4 +1,4 @@ -/* $NetBSD: verify.c,v 1.3 2004/04/16 23:43:36 heinz Exp $ */ +/* $NetBSD: verify.c,v 1.4 2004/08/21 04:10:45 jlam Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -32,6 +32,10 @@ #if HAVE_CONFIG_H #include "config.h" #endif +#if HAVE_NBTOOL_CONFIG_H +#include "nbtool_config.h" +#endif + #include <nbcompat.h> #if HAVE_SYS_CDEFS_H #include <sys/cdefs.h> @@ -40,7 +44,7 @@ #if 0 static char sccsid[] = "@(#)verify.c 8.1 (Berkeley) 6/6/93"; #else -__RCSID("$NetBSD: verify.c,v 1.3 2004/04/16 23:43:36 heinz Exp $"); +__RCSID("$NetBSD: verify.c,v 1.4 2004/08/21 04:10:45 jlam Exp $"); #endif #endif /* not lint */ @@ -51,7 +55,7 @@ __RCSID("$NetBSD: verify.c,v 1.3 2004/04/16 23:43:36 heinz Exp $"); #include <sys/stat.h> #endif -#if !HAVE_CONFIG_H +#if ! HAVE_NBTOOL_CONFIG_H #if HAVE_DIRENT_H #include <dirent.h> #endif @@ -211,7 +215,7 @@ miss(NODE *p, char *tail) create = 0; if (!(p->flags & F_VISIT) && uflag) { - if (Wflag || p->type == F_LINK) + if (mtree_Wflag || p->type == F_LINK) goto createit; if (!(p->flags & (F_UID | F_UNAME))) printf( @@ -227,7 +231,7 @@ miss(NODE *p, char *tail) switch (p->type) { case F_BLOCK: case F_CHAR: - if (Wflag) + if (mtree_Wflag) continue; if (!(p->flags & F_DEV)) printf( @@ -278,7 +282,7 @@ miss(NODE *p, char *tail) } else putchar('\n'); - if (!create || Wflag) + if (!create || mtree_Wflag) continue; if ((p->flags & (F_UID | F_UNAME)) && (p->flags & (F_GID | F_GNAME)) && |