Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 11 Dec 2012 20:38:53 +0000 (UTC)
From:      Brooks Davis <brooks@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r244125 - projects/mtree/contrib/mtree
Message-ID:  <201212112038.qBBKcrxw085276@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: brooks
Date: Tue Dec 11 20:38:53 2012
New Revision: 244125
URL: http://svnweb.freebsd.org/changeset/base/244125

Log:
  Sync with NetBSD as of 2012-12-10.  They have accepted most of my
  compability changes.
  
  Drop the no-op -w support.  The default behavior is better and if we do
  an MFC I'll implement the historic, awful behavior.
  
  Retain -T and encoding of glob characters.  Also retain some FreeBSD
  specific foramtting differences.  I'm seeking advice on retaining them
  under __FreeBSD__ or adding a -F flag.  I've also discovered that there
  are formatting differences in the -d case.

Modified:
  projects/mtree/contrib/mtree/Makefile
  projects/mtree/contrib/mtree/compare.c
  projects/mtree/contrib/mtree/crc.c
  projects/mtree/contrib/mtree/create.c
  projects/mtree/contrib/mtree/extern.h
  projects/mtree/contrib/mtree/misc.c
  projects/mtree/contrib/mtree/mtree.8
  projects/mtree/contrib/mtree/mtree.c
  projects/mtree/contrib/mtree/mtree.h
  projects/mtree/contrib/mtree/spec.c
  projects/mtree/contrib/mtree/specspec.c
  projects/mtree/contrib/mtree/verify.c

Modified: projects/mtree/contrib/mtree/Makefile
==============================================================================
--- projects/mtree/contrib/mtree/Makefile	Tue Dec 11 20:08:57 2012	(r244124)
+++ projects/mtree/contrib/mtree/Makefile	Tue Dec 11 20:38:53 2012	(r244125)
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.32 2009/04/22 15:23:05 lukem Exp $
+#	$NetBSD: Makefile,v 1.33 2012/10/05 01:26:56 christos Exp $
 #	from: @(#)Makefile	8.2 (Berkeley) 4/27/95
 
 .include <bsd.own.mk>
@@ -8,8 +8,7 @@ PROG=	mtree
 CPPFLAGS+= -DMTREE
 MAN=	mtree.8
 SRCS=	compare.c crc.c create.c excludes.c misc.c mtree.c spec.c specspec.c \
-	verify.c \
-	getid.c pack_dev.c
+	verify.c getid.c pack_dev.c
 .if (${HOSTPROG:U} == "")
 DPADD+= ${LIBUTIL}
 LDADD+= -lutil

Modified: projects/mtree/contrib/mtree/compare.c
==============================================================================
--- projects/mtree/contrib/mtree/compare.c	Tue Dec 11 20:08:57 2012	(r244124)
+++ projects/mtree/contrib/mtree/compare.c	Tue Dec 11 20:38:53 2012	(r244125)
@@ -1,4 +1,4 @@
-/*	$NetBSD: compare.c,v 1.52 2008/12/28 19:36:30 christos Exp $	*/
+/*	$NetBSD: compare.c,v 1.55 2012/10/05 00:59:35 christos Exp $	*/
 
 /*-
  * Copyright (c) 1989, 1993
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)compare.c	8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: compare.c,v 1.52 2008/12/28 19:36:30 christos Exp $");
+__RCSID("$NetBSD: compare.c,v 1.55 2012/10/05 00:59:35 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -463,7 +463,7 @@ typeerr:		LABEL;
 			free(digestbuf);
 		}
 	}
-#ifndef NO_SHA384
+#ifdef SHA384_BLOCK_LENGTH
 	if (s->flags & F_SHA384) {
 		if ((digestbuf = SHA384_File(p->fts_accpath, NULL)) == NULL) {
 			LABEL;
@@ -480,7 +480,7 @@ typeerr:		LABEL;
 			free(digestbuf);
 		}
 	}
-#endif	/* ! NO_SHA384 */
+#endif
 	if (s->flags & F_SHA512) {
 		if ((digestbuf = SHA512_File(p->fts_accpath, NULL)) == NULL) {
 			LABEL;

Modified: projects/mtree/contrib/mtree/crc.c
==============================================================================
--- projects/mtree/contrib/mtree/crc.c	Tue Dec 11 20:08:57 2012	(r244124)
+++ projects/mtree/contrib/mtree/crc.c	Tue Dec 11 20:38:53 2012	(r244125)
@@ -1,4 +1,4 @@
-/*	$NetBSD: crc.c,v 1.8 2005/06/02 06:04:46 lukem Exp $	*/
+/*	$NetBSD: crc.c,v 1.9 2012/10/05 00:40:51 christos Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -41,7 +41,7 @@
 #if 0
 static char sccsid[] = "@(#)crc.c	8.1 (Berkeley) 6/17/93";
 #else
-__RCSID("$NetBSD: crc.c,v 1.8 2005/06/02 06:04:46 lukem Exp $");
+__RCSID("$NetBSD: crc.c,v 1.9 2012/10/05 00:40:51 christos Exp $");
 #endif
 #endif /* not lint */
 

Modified: projects/mtree/contrib/mtree/create.c
==============================================================================
--- projects/mtree/contrib/mtree/create.c	Tue Dec 11 20:08:57 2012	(r244124)
+++ projects/mtree/contrib/mtree/create.c	Tue Dec 11 20:38:53 2012	(r244125)
@@ -1,4 +1,4 @@
-/*	$NetBSD: create.c,v 1.59 2012/07/15 09:08:29 spz Exp $	*/
+/*	$NetBSD: create.c,v 1.65 2012/10/05 01:21:44 christos Exp $	*/
 
 /*-
  * Copyright (c) 1989, 1993
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)create.c	8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: create.c,v 1.59 2012/07/15 09:08:29 spz Exp $");
+__RCSID("$NetBSD: create.c,v 1.65 2012/10/05 01:21:44 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -83,7 +83,13 @@ static uid_t uid;
 static mode_t mode;
 static u_long flags;
 
-static int	dcmp(const FTSENT * const *, const FTSENT * const *);
+#ifdef __FreeBSD__
+#define	FTS_CONST const
+#else
+#define	FTS_CONST
+#endif
+
+static int	dcmp(const FTSENT *FTS_CONST *, const FTSENT *FTS_CONST *);
 static void	output(int, int *, const char *, ...)
 	__attribute__((__format__(__printf__, 3, 4)));
 static int	statd(FTS *, FTSENT *, uid_t *, gid_t *, mode_t *, u_long *);
@@ -136,12 +142,16 @@ cwalk(void)
 			statf(indent, p);
 			break;
 		case FTS_DP:
-			if (!nflag && p->fts_level > 0)
-				printf("%*s# %s\n", indent, "", p->fts_path);
-#ifndef __FreeBSD__
-			if (p->fts_level > 0)
+			if (p->fts_level > 0) {
+				if (!nflag)
+					printf("%*s# %s\n", indent, "",
+					    p->fts_path);
+#ifdef __FreeBSD__
+			}
+			if (1) {
 #endif
 				printf("%*s..\n\n", indent, "");
+			}
 
 			break;
 		case FTS_DNR:
@@ -206,11 +216,11 @@ statf(int indent, FTSENT *p)
 		    (long long)p->fts_statp->st_rdev);
 	if (keys & F_NLINK && p->fts_statp->st_nlink != 1)
 		output(indent, &offset, "nlink=%u", p->fts_statp->st_nlink);
-	if (keys & F_SIZE
 #ifndef __FreeBSD__
-	    && S_ISREG(p->fts_statp->st_mode)
+	if (keys & F_SIZE && S_ISREG(p->fts_statp->st_mode))
+#else
+	if (keys & F_SIZE)
 #endif
-	    )
 		output(indent, &offset, "size=%lld",
 		    (long long)p->fts_statp->st_size);
 	if (keys & F_TIME)
@@ -232,7 +242,8 @@ statf(int indent, FTSENT *p)
 #ifndef NO_MD5
 	if (keys & F_MD5 && S_ISREG(p->fts_statp->st_mode)) {
 		if ((digestbuf = MD5File(p->fts_accpath, NULL)) == NULL)
-			mtree_err("%s: MD5File failed: %s", p->fts_accpath, strerror(errno));
+			mtree_err("%s: MD5File failed: %s", p->fts_accpath,
+			    strerror(errno));
 		output(indent, &offset, "%s=%s", MD5KEY, digestbuf);
 		free(digestbuf);
 	}
@@ -240,7 +251,8 @@ statf(int indent, FTSENT *p)
 #ifndef NO_RMD160
 	if (keys & F_RMD160 && S_ISREG(p->fts_statp->st_mode)) {
 		if ((digestbuf = RMD160File(p->fts_accpath, NULL)) == NULL)
-			mtree_err("%s: RMD160File failed: %s", p->fts_accpath, strerror(errno));
+			mtree_err("%s: RMD160File failed: %s", p->fts_accpath,
+			    strerror(errno));
 		output(indent, &offset, "%s=%s", RMD160KEY, digestbuf);
 		free(digestbuf);
 	}
@@ -248,7 +260,8 @@ statf(int indent, FTSENT *p)
 #ifndef NO_SHA1
 	if (keys & F_SHA1 && S_ISREG(p->fts_statp->st_mode)) {
 		if ((digestbuf = SHA1File(p->fts_accpath, NULL)) == NULL)
-			mtree_err("%s: SHA1File failed: %s", p->fts_accpath, strerror(errno));
+			mtree_err("%s: SHA1File failed: %s", p->fts_accpath,
+			    strerror(errno));
 		output(indent, &offset, "%s=%s", SHA1KEY, digestbuf);
 		free(digestbuf);
 	}
@@ -256,21 +269,24 @@ statf(int indent, FTSENT *p)
 #ifndef NO_SHA2
 	if (keys & F_SHA256 && S_ISREG(p->fts_statp->st_mode)) {
 		if ((digestbuf = SHA256_File(p->fts_accpath, NULL)) == NULL)
-			mtree_err("%s: SHA256_File failed: %s", p->fts_accpath, strerror(errno));
+			mtree_err("%s: SHA256_File failed: %s", p->fts_accpath,
+			    strerror(errno));
 		output(indent, &offset, "%s=%s", SHA256KEY, digestbuf);
 		free(digestbuf);
 	}
-#ifndef NO_SHA384
+#ifdef SHA384_BLOCK_LENGTH
 	if (keys & F_SHA384 && S_ISREG(p->fts_statp->st_mode)) {
 		if ((digestbuf = SHA384_File(p->fts_accpath, NULL)) == NULL)
-			mtree_err("%s: SHA384_File failed: %s", p->fts_accpath, strerror(errno));
+			mtree_err("%s: SHA384_File failed: %s", p->fts_accpath,
+			    strerror(errno));
 		output(indent, &offset, "%s=%s", SHA384KEY, digestbuf);
 		free(digestbuf);
 	}
 #endif
 	if (keys & F_SHA512 && S_ISREG(p->fts_statp->st_mode)) {
 		if ((digestbuf = SHA512_File(p->fts_accpath, NULL)) == NULL)
-			mtree_err("%s: SHA512_File failed: %s", p->fts_accpath, strerror(errno));
+			mtree_err("%s: SHA512_File failed: %s", p->fts_accpath,
+			    strerror(errno));
 		output(indent, &offset, "%s=%s", SHA512KEY, digestbuf);
 		free(digestbuf);
 	}
@@ -419,7 +435,7 @@ statd(FTS *t, FTSENT *parent, uid_t *pui
  * Keep this in sync with nodecmp() in spec.c.
  */
 static int
-dcmp(const FTSENT * const *a, const FTSENT * const *b)
+dcmp(const FTSENT *FTS_CONST *a, const FTSENT *FTS_CONST *b)
 {
 
 	if (S_ISDIR((*a)->fts_statp->st_mode)) {

Modified: projects/mtree/contrib/mtree/extern.h
==============================================================================
--- projects/mtree/contrib/mtree/extern.h	Tue Dec 11 20:08:57 2012	(r244124)
+++ projects/mtree/contrib/mtree/extern.h	Tue Dec 11 20:38:53 2012	(r244125)
@@ -1,4 +1,4 @@
-/*	$NetBSD: extern.h,v 1.32 2011/08/29 20:37:43 joerg Exp $	*/
+/*	$NetBSD: extern.h,v 1.36 2012/10/05 01:26:56 christos Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993

Modified: projects/mtree/contrib/mtree/misc.c
==============================================================================
--- projects/mtree/contrib/mtree/misc.c	Tue Dec 11 20:08:57 2012	(r244124)
+++ projects/mtree/contrib/mtree/misc.c	Tue Dec 11 20:38:53 2012	(r244125)
@@ -1,4 +1,4 @@
-/*	$NetBSD: misc.c,v 1.30 2009/01/18 12:09:38 lukem Exp $	*/
+/*	$NetBSD: misc.c,v 1.32 2012/10/05 01:31:05 christos Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -37,7 +37,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: misc.c,v 1.30 2009/01/18 12:09:38 lukem Exp $");
+__RCSID("$NetBSD: misc.c,v 1.32 2012/10/05 01:31:05 christos Exp $");
 #endif /* not lint */
 
 #include <sys/types.h>

Modified: projects/mtree/contrib/mtree/mtree.8
==============================================================================
--- projects/mtree/contrib/mtree/mtree.8	Tue Dec 11 20:08:57 2012	(r244124)
+++ projects/mtree/contrib/mtree/mtree.8	Tue Dec 11 20:38:53 2012	(r244125)
@@ -1,4 +1,4 @@
-.\"	$NetBSD: mtree.8,v 1.53 2010/01/20 14:00:48 wiz Exp $
+.\"	$NetBSD: mtree.8,v 1.63 2012/10/05 09:18:02 wiz Exp $
 .\"
 .\" Copyright (c) 1989, 1990, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -56,7 +56,7 @@
 .\"
 .\"     @(#)mtree.8	8.2 (Berkeley) 12/11/93
 .\"
-.Dd January 20, 2010
+.Dd October 4, 2012
 .Dt MTREE 8
 .Os
 .Sh NAME
@@ -64,7 +64,7 @@
 .Nd map a directory hierarchy
 .Sh SYNOPSIS
 .Nm
-.Op Fl CcDdeLlMPrSUuWx
+.Op Fl CcDdejLlMnPqrSTtUuWx
 .Op Fl i | Fl m
 .Op Fl E Ar tags
 .Op Fl f Ar spec
@@ -104,8 +104,8 @@ The full path name
 (beginning with
 .Dq \&./ )
 is always printed as the first field;
-.Fl k ,
 .Fl K ,
+.Fl k ,
 and
 .Fl R
 can be used to control which other keywords are printed;
@@ -113,6 +113,7 @@ can be used to control which other keywo
 and
 .Fl I
 can be used to control which files are printed;
+and the
 .Fl S
 option can be used to sort the output.
 .It Fl c
@@ -148,13 +149,12 @@ If this option is specified twice, the t
 to each other rather than to the file hierarchy.
 The specifications will be sorted like output generated using
 .Fl c .
-The output format in this case is somewhat remniscent of
+The output format in this case is somewhat reminiscent of
 .Xr comm 1 ,
 having "in first spec only", "in second spec only", and "different"
 columns, prefixed by zero, one and two TAB characters respectively.
 Each entry in the "different" column occupies two lines, one from each
-specifica
-tion.
+specification.
 .It Fl I Ar tags
 Add the comma separated tags to the
 .Dq inclusion
@@ -167,7 +167,7 @@ If no inclusion list is provided, the de
 .It Fl i
 If specified, set the schg and/or sappnd flags.
 .It Fl j
-Indent the output 4 spaces each time a directory level is descended when  
+Indent the output 4 spaces each time a directory level is descended when
 creating a specification with the
 .Fl c
 option.
@@ -213,13 +213,13 @@ particular, if other bits like the stick
 set either in the specification or the file, exact checking will be
 performed.
 This option may not be set at the same time as the
-.Fl u
-or
 .Fl U
+or
+.Fl u
 option.
 .It Fl M
 Permit merging of specification entries with different types,
-with the last entry take precedence.
+with the last entry taking precedence.
 .It Fl m
 If the schg and/or sappnd flags are specified, reset these flags.
 Note that this is only possible with securelevel less than 1 (i.e.,
@@ -230,7 +230,7 @@ See
 for information on security levels.
 .It Fl n
 Do not emit pathname comments when creating a specification.
-Normally  
+Normally
 a comment is emitted before each directory and before the close of that
 directory when using the
 .Fl c
@@ -297,19 +297,18 @@ of the files for which the keyword
 .Sy cksum
 was specified.
 The checksum is seeded with the specified value.
-.It Fl t
-Modify the modified time of existing files, the device type of devices, and
-symbolic link targets, to match the specification.
-This is the default on
-.Fx
-systems.
 .It Fl T
 .Em Do not
 modify the modified time of existing files, the device type of devices, and
 symbolic link targets, to match the specification.
 This is the default on systems other than
+.Fx .
+.It Fl t
+Modify the modified time of existing files, the device type of devices, and
+symbolic link targets, to match the specification.
+This is the default on
 .Fx
-.
+systems.
 .It Fl U
 Same as
 .Fl u
@@ -331,17 +330,14 @@ is given, these flags will be reset.
 Exit with a status of 0 on success,
 2 if the file hierarchy did not match the specification, and
 1 if any other error occurred.
-.It Fl w
-Ignored for compatibility with FreeBSD versions of
-.Nm .
 .It Fl W
 Don't attempt to set various file attributes such as the
 ownership, mode, flags, or time
 when creating new directories or changing existing entries.
 This option will be most useful when used in conjunction with
-.Fl u
+.Fl U
 or
-.Fl U .
+.Fl u .
 .It Fl X Ar exclude-file
 The specified file contains
 .Xr fnmatch 3
@@ -381,7 +377,6 @@ or
 .Sy char
 file types.
 The argument must be one of the following forms:
-.Pp
 .Bl -tag -width 4n
 .It Ar format , Ns Ar major , Ns Ar minor
 A device with
@@ -558,7 +553,6 @@ and
 .Sy uid .
 .Pp
 There are four types of lines in a specification:
-.Pp
 .Bl -enum
 .It
 Set global values for a keyword.
@@ -641,7 +635,7 @@ appropriately.
 Multiple entries for the same full path are permitted if the types
 are the same (unless
 .Fl M
-is given, and then the types may differ);
+is given, in which case 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.
@@ -691,10 +685,11 @@ can be used to detect which of the binar
 .Pp
 The
 .Fl d
-and
+option can be used in combination with
+.Fl U
+or
 .Fl u
-options can be used in combination to create directory hierarchies
-for distributions and other such things.
+to create directory hierarchies for, for example, distributions.
 .Sh SEE ALSO
 .Xr chflags 1 ,
 .Xr chgrp 1 ,
@@ -741,8 +736,8 @@ keywords,
 .Fl D ,
 .Fl E ,
 .Fl I ,
-.Fl l ,
 .Fl L ,
+.Fl l ,
 .Fl N ,
 .Fl P ,
 .Fl R ,

Modified: projects/mtree/contrib/mtree/mtree.c
==============================================================================
--- projects/mtree/contrib/mtree/mtree.c	Tue Dec 11 20:08:57 2012	(r244124)
+++ projects/mtree/contrib/mtree/mtree.c	Tue Dec 11 20:38:53 2012	(r244125)
@@ -1,4 +1,4 @@
-/*	$NetBSD: mtree.c,v 1.37 2011/08/29 20:37:43 joerg Exp $	*/
+/*	$NetBSD: mtree.c,v 1.42 2012/10/05 09:18:08 wiz Exp $	*/
 
 /*-
  * Copyright (c) 1989, 1990, 1993
@@ -43,7 +43,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 19
 #if 0
 static char sccsid[] = "@(#)mtree.c	8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: mtree.c,v 1.37 2011/08/29 20:37:43 joerg Exp $");
+__RCSID("$NetBSD: mtree.c,v 1.42 2012/10/05 09:18:08 wiz Exp $");
 #endif
 #endif /* not lint */
 
@@ -84,7 +84,7 @@ main(int argc, char **argv)
 #endif
 
 	while ((ch = getopt(argc, argv,
-	    "cCdDeE:f:I:ijk:K:lLmMnN:p:PqrR:s:StTuUwWxX:"))
+	    "cCdDeE:f:I:ijk:K:lLmMnN:p:PqrR:s:StTuUWxX:"))
 	    != -1) {
 		switch((char)ch) {
 		case 'c':
@@ -200,9 +200,6 @@ main(int argc, char **argv)
 		case 'U':
 			Uflag = uflag = 1;
 			break;
-		case 'w':
-			/* Ignored for compatibility with FreeBSD's mtree. */
-			break;
 		case 'W':
 			mtree_Wflag = 1;
 			break;
@@ -267,7 +264,7 @@ usage(void)
 {
 
 	fprintf(stderr,
-	    "usage: %s [-CcDdeLlMnPrSUuWx] [-i|-m] [-E tags]\n"
+	    "usage: %s [-CcDdejLlMnPqrSTtUuWx] [-i|-m] [-E tags]\n"
 	    "\t\t[-f spec] [-f spec]\n"
 	    "\t\t[-I tags] [-K keywords] [-k keywords] [-N dbdir] [-p path]\n"
 	    "\t\t[-R keywords] [-s seed] [-X exclude-file]\n",

Modified: projects/mtree/contrib/mtree/mtree.h
==============================================================================
--- projects/mtree/contrib/mtree/mtree.h	Tue Dec 11 20:08:57 2012	(r244124)
+++ projects/mtree/contrib/mtree/mtree.h	Tue Dec 11 20:38:53 2012	(r244125)
@@ -1,4 +1,4 @@
-/*	$NetBSD: mtree.h,v 1.27 2009/04/04 21:49:49 apb Exp $	*/
+/*	$NetBSD: mtree.h,v 1.31 2012/10/05 09:17:29 wiz Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993
@@ -86,7 +86,7 @@ typedef struct _node {
 #define	F_UID		0x00080000		/* uid */
 #define	F_UNAME		0x00100000		/* user name */
 #define	F_VISIT		0x00200000		/* file visited */
-#define	F_NOCHANGE	0x00400000		/* check existance, but not */
+#define	F_NOCHANGE	0x00400000		/* check existence, but not */
 						/* other properties */
 #define	F_SHA256	0x00800000		/* SHA256 digest */
 #define	F_SHA384	0x01000000		/* SHA384 digest */
@@ -126,17 +126,20 @@ int		 mtree_specspec(FILE *, FILE *);
 void		 free_nodes(NODE *);
 char		*vispath(const char *);
 
-#ifndef __FreeBSD__
-#define	MD5KEY		"md5"
-#define	RMD160KEY	"rmd160"
-#define	SHA1KEY		"sha1"
-#define	SHA256KEY	"sha256"
+#ifdef __FreeBSD__
+#define KEY_DIGEST "digest"
 #else
-#define	MD5KEY		"md5digest"
-#define	RMD160KEY	"ripemd160digest"
-#define	SHA1KEY		"sha1digest"
-#define	SHA256KEY	"sha256digest"
+#define KEY_DIGEST
 #endif
+
+#define	MD5KEY		"md5"		KEY_DIGEST
+#ifdef __FreeBSD__
+#define	RMD160KEY	"ripemd160"	KEY_DIGEST
+#else
+#define	RMD160KEY	"rmd160"	KEY_DIGEST
+#endif
+#define	SHA1KEY		"sha1"		KEY_DIGEST
+#define	SHA256KEY	"sha256"	KEY_DIGEST
 #define	SHA384KEY	"sha384"
 #define	SHA512KEY	"sha512"
 

Modified: projects/mtree/contrib/mtree/spec.c
==============================================================================
--- projects/mtree/contrib/mtree/spec.c	Tue Dec 11 20:08:57 2012	(r244124)
+++ projects/mtree/contrib/mtree/spec.c	Tue Dec 11 20:38:53 2012	(r244125)
@@ -1,4 +1,4 @@
-/*	$NetBSD: spec.c,v 1.80 2012/03/15 02:02:24 joerg Exp $	*/
+/*	$NetBSD: spec.c,v 1.84 2012/10/07 18:40:49 christos Exp $	*/
 
 /*-
  * Copyright (c) 1989, 1993
@@ -67,7 +67,7 @@
 #if 0
 static char sccsid[] = "@(#)spec.c	8.2 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: spec.c,v 1.80 2012/03/15 02:02:24 joerg Exp $");
+__RCSID("$NetBSD: spec.c,v 1.84 2012/10/07 18:40:49 christos Exp $");
 #endif
 #endif /* not lint */
 

Modified: projects/mtree/contrib/mtree/specspec.c
==============================================================================
--- projects/mtree/contrib/mtree/specspec.c	Tue Dec 11 20:08:57 2012	(r244124)
+++ projects/mtree/contrib/mtree/specspec.c	Tue Dec 11 20:38:53 2012	(r244125)
@@ -1,3 +1,5 @@
+/*	$NetBSD: specspec.c,v 1.2 2012/10/05 01:27:29 christos Exp $	*/
+
 /*-
  * Copyright (c) 2003 Poul-Henning Kamp
  * All rights reserved.
@@ -24,12 +26,17 @@
  * SUCH DAMAGE.
  */
 
+#if HAVE_NBTOOL_CONFIG_H
+#include "nbtool_config.h"
+#endif
+
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
+__RCSID("$NetBSD: specspec.c,v 1.2 2012/10/05 01:27:29 christos Exp $");
 
 #include <err.h>
 #include <grp.h>
 #include <pwd.h>
+#include <time.h>
 #include <stdio.h>
 #include <stdint.h>
 #include <stdlib.h>
@@ -84,14 +91,12 @@ shownode(NODE *n, int f, char const *pat
 		printf(" %s=%s", SHA1KEY, n->sha1digest);
 	if (f & F_RMD160)
 		printf(" %s=%s", RMD160KEY, n->rmd160digest);
-	if (f & F_SHA1)
-		printf(" %s=%s", SHA1KEY, n->sha256digest);
 	if (f & F_SHA256)
 		printf(" %s=%s", SHA256KEY, n->sha256digest);
 	if (f & F_SHA384)
 		printf(" %s=%s", SHA384KEY, n->sha384digest);
 	if (f & F_SHA512)
-		printf(" %s=%s", SHA512KEY,  n->sha512digest);
+		printf(" %s=%s", SHA512KEY, n->sha512digest);
 	if (f & F_FLAGS)
 		printf(" flags=%s", flags_to_string(n->st_flags, "none"));
 	printf("\n");

Modified: projects/mtree/contrib/mtree/verify.c
==============================================================================
--- projects/mtree/contrib/mtree/verify.c	Tue Dec 11 20:08:57 2012	(r244124)
+++ projects/mtree/contrib/mtree/verify.c	Tue Dec 11 20:38:53 2012	(r244125)
@@ -1,4 +1,4 @@
-/*	$NetBSD: verify.c,v 1.40 2012/03/25 16:07:04 christos Exp $	*/
+/*	$NetBSD: verify.c,v 1.43 2012/10/05 01:31:05 christos Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)verify.c	8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: verify.c,v 1.40 2012/03/25 16:07:04 christos Exp $");
+__RCSID("$NetBSD: verify.c,v 1.43 2012/10/05 01:31:05 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -181,7 +181,8 @@ miss(NODE *p, char *tail)
 			   symbolic link and the -q flag is set. */
 			struct stat statbuf;
 
-			if (qflag && stat(path, &statbuf) == 0)
+			if (qflag && stat(path, &statbuf) == 0 &&
+			    S_ISDIR(statbuf.st_mode))
 				p->flags |= F_VISIT;
 			else
 				(void)printf("%s missing", path);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201212112038.qBBKcrxw085276>