Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 20 Sep 2012 14:38:22 +0000 (UTC)
From:      Brooks Davis <brooks@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r240746 - projects/mtree/contrib/mtree
Message-ID:  <201209201438.q8KEcMu9036117@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: brooks
Date: Thu Sep 20 14:38:21 2012
New Revision: 240746
URL: http://svn.freebsd.org/changeset/base/240746

Log:
  Implement ripemd160digest as a synonym for rmd160.  Emit ripemd160digest
  in output on FreeBSD for improved compatability with FreeBSD mtree versions.

Modified:
  projects/mtree/contrib/mtree/compare.c
  projects/mtree/contrib/mtree/misc.c
  projects/mtree/contrib/mtree/mtree.8
  projects/mtree/contrib/mtree/spec.c

Modified: projects/mtree/contrib/mtree/compare.c
==============================================================================
--- projects/mtree/contrib/mtree/compare.c	Thu Sep 20 10:28:44 2012	(r240745)
+++ projects/mtree/contrib/mtree/compare.c	Thu Sep 20 14:38:21 2012	(r240746)
@@ -414,13 +414,22 @@ typeerr:		LABEL;
 	if (s->flags & F_RMD160) {
 		if ((digestbuf = RMD160File(p->fts_accpath, NULL)) == NULL) {
 			LABEL;
+#ifndef __FreeBSD__
 			printf("%srmd160: %s: %s\n",
+#else
+			printf("%sripemd160digest: %s: %s\n",
+#endif
+
 			    tab, p->fts_accpath, strerror(errno));
 			tab = "\t";
 		} else {
 			if (strcmp(s->rmd160digest, digestbuf)) {
 				LABEL;
+#ifndef __FreeBSD__
 				printf("%srmd160 (0x%s, 0x%s)\n",
+#else
+				printf("%sripemd160digest (0x%s, 0x%s)\n",
+#endif
 				    tab, s->rmd160digest, digestbuf);
 			}
 			tab = "\t";

Modified: projects/mtree/contrib/mtree/misc.c
==============================================================================
--- projects/mtree/contrib/mtree/misc.c	Thu Sep 20 10:28:44 2012	(r240745)
+++ projects/mtree/contrib/mtree/misc.c	Thu Sep 20 14:38:21 2012	(r240746)
@@ -72,6 +72,7 @@ static KEY keylist[] = {
 	{"mode",	F_MODE,		NEEDVALUE},
 	{"nlink",	F_NLINK,	NEEDVALUE},
 	{"optional",	F_OPT,		0},
+	{"ripemd160digest", F_RMD160,	NEEDVALUE},
 	{"rmd160",	F_RMD160,	NEEDVALUE},
 	{"rmd160digest",F_RMD160,	NEEDVALUE},
 	{"sha1",	F_SHA1,		NEEDVALUE},

Modified: projects/mtree/contrib/mtree/mtree.8
==============================================================================
--- projects/mtree/contrib/mtree/mtree.8	Thu Sep 20 10:28:44 2012	(r240745)
+++ projects/mtree/contrib/mtree/mtree.8	Thu Sep 20 14:38:21 2012	(r240746)
@@ -414,6 +414,9 @@ The number of hard links the file is exp
 .It Sy optional
 The file is optional; don't complain about the file if it's
 not in the file hierarchy.
+.It Sy ripemd160digest
+Synonym for
+.Sy rmd160 .
 .It Sy rmd160
 The
 .Tn RMD-160

Modified: projects/mtree/contrib/mtree/spec.c
==============================================================================
--- projects/mtree/contrib/mtree/spec.c	Thu Sep 20 10:28:44 2012	(r240745)
+++ projects/mtree/contrib/mtree/spec.c	Thu Sep 20 14:38:21 2012	(r240746)
@@ -366,7 +366,12 @@ dump_nodes(const char *dir, NODE *root, 
 		if (MATCHFLAG(F_MD5))
 			appendfield(pathlast, "md5=%s", cur->md5digest);
 		if (MATCHFLAG(F_RMD160))
+#ifndef __FreeBSD__
 			appendfield(pathlast, "rmd160=%s", cur->rmd160digest);
+#else
+			appendfield(pathlast, "ripemd160digest=%s",
+			    cur->rmd160digest);
+#endif
 		if (MATCHFLAG(F_SHA1))
 			appendfield(pathlast, "sha1=%s", cur->sha1digest);
 		if (MATCHFLAG(F_SHA256))



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