From owner-svn-src-projects@FreeBSD.ORG  Wed Dec 19 18:51:36 2012
Return-Path: <owner-svn-src-projects@FreeBSD.ORG>
Delivered-To: svn-src-projects@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
 by hub.freebsd.org (Postfix) with ESMTP id 1946CFBD;
 Wed, 19 Dec 2012 18:51:36 +0000 (UTC)
 (envelope-from brooks@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id D87D78FC13;
 Wed, 19 Dec 2012 18:51:35 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
 by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBJIpZEs061457;
 Wed, 19 Dec 2012 18:51:35 GMT (envelope-from brooks@svn.freebsd.org)
Received: (from brooks@localhost)
 by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBJIpZG9061453;
 Wed, 19 Dec 2012 18:51:35 GMT (envelope-from brooks@svn.freebsd.org)
Message-Id: <201212191851.qBJIpZG9061453@svn.freebsd.org>
From: Brooks Davis <brooks@FreeBSD.org>
Date: Wed, 19 Dec 2012 18:51:35 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject: svn commit: r244443 - projects/mtree/contrib/mtree
X-SVN-Group: projects
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-projects@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the src &quot; projects&quot;
 tree" <svn-src-projects.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-projects>
List-Post: <mailto:svn-src-projects@freebsd.org>
List-Help: <mailto:svn-src-projects-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 19 Dec 2012 18:51:36 -0000

Author: brooks
Date: Wed Dec 19 18:51:35 2012
New Revision: 244443
URL: http://svnweb.freebsd.org/changeset/base/244443

Log:
  Add a compatibility option to imply -j when -c and -i are given.
  
  Add a COMPATIBILITY section to document differences from FreeBSD's
  historic mtree.  Not all are currently documented pending further
  discussion with NetBSD developers.

Modified:
  projects/mtree/contrib/mtree/mtree.8
  projects/mtree/contrib/mtree/mtree.c

Modified: projects/mtree/contrib/mtree/mtree.8
==============================================================================
--- projects/mtree/contrib/mtree/mtree.8	Wed Dec 19 18:15:33 2012	(r244442)
+++ projects/mtree/contrib/mtree/mtree.8	Wed Dec 19 18:51:35 2012	(r244443)
@@ -166,6 +166,16 @@ and
 If no inclusion list is provided, the default is to display all files.
 .It Fl i
 If specified, set the schg and/or sappnd flags.
+For compatiblity with
+.Fx
+if the
+.Fl c
+and
+.Fl i
+option are both passed,
+then the
+.Fl j
+option is implied and a warning is emitted.
 .It Fl j
 Indent the output 4 spaces each time a directory level is descended when
 creating a specification with the
@@ -690,6 +700,37 @@ option can be used in combination with
 or
 .Fl u
 to create directory hierarchies for, for example, distributions.
+.Sh COMPATIBILITY
+This version of the
+.Nm utility differs from the version in
+.Fx 9
+and earlier in several ways:
+.Bl -bullet -compact
+.It
+When the
+.Fl c
+option is specified a final ``..'' is not emitted to match the top
+directory.
+Files made to match by appending ``..\\n\\n''.
+.It
+The
+.Fl U
+and
+.Fl u
+options do not set the modification time or the schg and/or sappnd
+file flags unless the
+.Fl t
+and
+.Fl i
+options are also passed.
+.It
+The
+.Fl j
+option is equivalent to the
+.Fx
+.Fl i
+option and should be used in its place.
+.El
 .Sh SEE ALSO
 .Xr chflags 1 ,
 .Xr chgrp 1 ,

Modified: projects/mtree/contrib/mtree/mtree.c
==============================================================================
--- projects/mtree/contrib/mtree/mtree.c	Wed Dec 19 18:15:33 2012	(r244442)
+++ projects/mtree/contrib/mtree/mtree.c	Wed Dec 19 18:51:35 2012	(r244443)
@@ -236,6 +236,12 @@ main(int argc, char **argv)
 	if ((cflag && Cflag) || (cflag && Dflag) || (Cflag && Dflag))
 		mtree_err("-c, -C and -D flags are mutually exclusive");
 
+	if (cflag && iflag) {
+		warnx("-c and -i specified, setting -j and unsetting -i");
+		iflag = 0;
+		jflag = 1;
+	}
+
 	if (iflag && mflag)
 		mtree_err("-i and -m flags are mutually exclusive");