Implement FreeBSD's "nochange" keyworld which causes the existance of a filesystem object to be checked but none of its attiributes. Index: mtree.8 =================================================================== --- mtree.8 (revision 240795) +++ mtree.8 (revision 240796) @@ -463,6 +463,8 @@ 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. Index: mtree.h =================================================================== --- mtree.h (revision 240795) +++ mtree.h (revision 240796) @@ -86,6 +86,8 @@ #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 */ Index: verify.c =================================================================== --- verify.c (revision 240795) +++ verify.c (revision 240796) @@ -124,7 +124,8 @@ !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 && Index: misc.c =================================================================== --- misc.c (revision 240795) +++ misc.c (revision 240796) @@ -71,6 +71,7 @@ {"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},