From owner-svn-src-projects@FreeBSD.ORG Thu Sep 20 22:56:12 2012 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7CD52106564A; Thu, 20 Sep 2012 22:56:12 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 68F198FC08; Thu, 20 Sep 2012 22:56:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8KMuCRX009031; Thu, 20 Sep 2012 22:56:12 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8KMuCj3009029; Thu, 20 Sep 2012 22:56:12 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201209202256.q8KMuCj3009029@svn.freebsd.org> From: Brooks Davis Date: Thu, 20 Sep 2012 22:56:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240766 - projects/mtree/contrib/mtree X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Sep 2012 22:56:12 -0000 Author: brooks Date: Thu Sep 20 22:56:11 2012 New Revision: 240766 URL: http://svn.freebsd.org/changeset/base/240766 Log: Tweak the output to match FreeBSD's mtree when running on FreeBSD systems: - Emit ripemd160digest= keywords rather them rmd160=. - Output the size of all objects rather than just regular files. - Emit the trailing .. when leaving the root directory. Modified: projects/mtree/contrib/mtree/create.c Modified: projects/mtree/contrib/mtree/create.c ============================================================================== --- projects/mtree/contrib/mtree/create.c Thu Sep 20 22:12:50 2012 (r240765) +++ projects/mtree/contrib/mtree/create.c Thu Sep 20 22:56:11 2012 (r240766) @@ -137,8 +137,12 @@ cwalk(void) break; case FTS_DP: if (!nflag && p->fts_level > 0) - printf("%*s# %s\n%*s..\n\n", indent, "", - p->fts_path, indent, ""); + printf("%*s# %s\n", indent, "", p->fts_path); +#ifndef __FreeBSD__ + if (p->fts_level > 0) +#endif + printf("%*s..\n\n", indent, ""); + break; case FTS_DNR: case FTS_ERR: @@ -202,7 +206,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 && S_ISREG(p->fts_statp->st_mode)) + if (keys & F_SIZE +#ifndef __FreeBSD__ + && S_ISREG(p->fts_statp->st_mode) +#endif + ) output(indent, &offset, "size=%lld", (long long)p->fts_statp->st_size); if (keys & F_TIME) @@ -233,7 +241,11 @@ statf(int indent, FTSENT *p) 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)); +#ifndef __FreeBSD__ output(indent, &offset, "rmd160=%s", digestbuf); +#else + output(indent, &offset, "ripemd160digest=%s", digestbuf); +#endif free(digestbuf); } #endif /* ! NO_RMD160 */