svn commit: r240796 - projects/mtree/contrib/mtree
Brooks Davis
brooks at FreeBSD.org
Fri Sep 21 22:07:47 UTC 2012
Author: brooks
Date: Fri Sep 21 22:07:46 2012
New Revision: 240796
URL: http://svn.freebsd.org/changeset/base/240796
Log:
Implement FreeBSD's nochange keyword.
Modified:
projects/mtree/contrib/mtree/misc.c
projects/mtree/contrib/mtree/mtree.8
projects/mtree/contrib/mtree/mtree.h
projects/mtree/contrib/mtree/verify.c
Modified: projects/mtree/contrib/mtree/misc.c
==============================================================================
--- projects/mtree/contrib/mtree/misc.c Fri Sep 21 21:52:14 2012 (r240795)
+++ projects/mtree/contrib/mtree/misc.c Fri Sep 21 22:07:46 2012 (r240796)
@@ -71,6 +71,7 @@ static KEY keylist[] = {
{"md5digest", F_MD5, NEEDVALUE},
{"mode", F_MODE, NEEDVALUE},
{"nlink", F_NLINK, NEEDVALUE},
+ {"nochange", F_NOCHANGE, 0},
{"optional", F_OPT, 0},
{"ripemd160digest", F_RMD160, NEEDVALUE},
{"rmd160", F_RMD160, NEEDVALUE},
Modified: projects/mtree/contrib/mtree/mtree.8
==============================================================================
--- projects/mtree/contrib/mtree/mtree.8 Fri Sep 21 21:52:14 2012 (r240795)
+++ projects/mtree/contrib/mtree/mtree.8 Fri Sep 21 22:07:46 2012 (r240796)
@@ -463,6 +463,8 @@ The current file's permissions as a nume
value.
.It Sy nlink
The number of hard links the file is expected to have.
+.It Sy nochange
+Make sure this file or directory exists but otherwise ignore all attributes.
.It Sy optional
The file is optional; don't complain about the file if it's
not in the file hierarchy.
Modified: projects/mtree/contrib/mtree/mtree.h
==============================================================================
--- projects/mtree/contrib/mtree/mtree.h Fri Sep 21 21:52:14 2012 (r240795)
+++ projects/mtree/contrib/mtree/mtree.h Fri Sep 21 22:07:46 2012 (r240796)
@@ -86,6 +86,8 @@ 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 */
+ /* other properties */
#define F_SHA256 0x00800000 /* SHA256 digest */
#define F_SHA384 0x01000000 /* SHA384 digest */
#define F_SHA512 0x02000000 /* SHA512 digest */
Modified: projects/mtree/contrib/mtree/verify.c
==============================================================================
--- projects/mtree/contrib/mtree/verify.c Fri Sep 21 21:52:14 2012 (r240795)
+++ projects/mtree/contrib/mtree/verify.c Fri Sep 21 22:07:46 2012 (r240796)
@@ -124,7 +124,8 @@ vwalk(void)
!fnmatch(ep->name, p->fts_name, FNM_PATHNAME)) ||
!strcmp(ep->name, p->fts_name)) {
ep->flags |= F_VISIT;
- if (compare(ep, p))
+ if ((ep->flags & F_NOCHANGE) == 0 &&
+ compare(ep, p))
rval = MISMATCHEXIT;
if (!(ep->flags & F_IGN) &&
ep->type == F_DIR &&
More information about the svn-src-projects
mailing list