From owner-freebsd-current@FreeBSD.ORG Tue Sep 10 03:38:02 2013 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 14693749; Tue, 10 Sep 2013 03:38:02 +0000 (UTC) (envelope-from kientzle@acm.org) Received: from monday.kientzle.com (99-115-135-74.uvs.sntcca.sbcglobal.net [99.115.135.74]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E33702655; Tue, 10 Sep 2013 03:38:01 +0000 (UTC) Received: (from root@localhost) by monday.kientzle.com (8.14.4/8.14.4) id r8A3bjxZ030539; Tue, 10 Sep 2013 03:37:45 GMT (envelope-from kientzle@acm.org) Received: from [192.168.2.123] (CiscoE3000 [192.168.1.65]) by kientzle.com with SMTP id mca87kuindwp5yaf5d4j9gdees; Tue, 10 Sep 2013 03:37:45 +0000 (UTC) (envelope-from kientzle@acm.org) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\)) Subject: Re: [PATCH] mtree should not output size if the file is not a regular file From: Tim Kientzle In-Reply-To: <20130909235122.4A9C997129@rebar.astron.com> Date: Mon, 9 Sep 2013 20:37:44 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <4519D4C8-512D-450A-8B58-35A2C4795DA3@acm.org> References: <20130909235122.4A9C997129@rebar.astron.com> To: Christos Zoulas X-Mailer: Apple Mail (2.1508) Cc: =?iso-8859-1?Q?Dag-Erling_Sm=F8rgrav?= , FreeBSD Current , d@delphij.net, Brooks Davis X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2013 03:38:02 -0000 On Sep 9, 2013, at 4:51 PM, Christos Zoulas wrote: > On Sep 10, 1:21am, des@des.no (=3D?utf-8?Q?Dag-Erling_Sm=3DC3=3DB8rgrav= ?=3D) wrote: > -- Subject: Re: [PATCH] mtree should not output size if the file is = not a reg >=20 > | Roll a large tarball (e.g. a complete FreeBSD installation). Copy = it to > | different machines with different filesystems. Untar and run mtree = on > | the result. Notice that you get different output on each machine > | because they report different sizes for directories; one might = report > | the actual on-disk size (which might vary depending on past = contents) > | while the other might report the number of entries. >=20 > Yes, I agree. I would like to note that the current NetBSD code looks = like: >=20 > if (keys & F_SIZE && > (flavor !=3D F_NETBSD6 || S_ISREG(p->fts_statp->st_mode))) >=20 > which means that F_NETBSD6 did not print this, and we recently changed > it to print the size for compatibility with F_FREEBSD9... We also made > the default F_MTREE format to print the size. So I guess the thing to > do is change the code to: >=20 > if (keys & F_SIZE && > (flavor =3D=3D F_FREEBSD9 || = S_ISREG(p->fts_statp->st_mode))) DES is right: size should just be omitted for non-regular files. Bug-for-bug compatibility can be taken too far. I prefer Xin's original patch. Tim