From owner-freebsd-current@FreeBSD.ORG Tue Sep 10 06:00:12 2013 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id E2B0839B for ; Tue, 10 Sep 2013 06:00:12 +0000 (UTC) (envelope-from matthias.andree@gmx.de) Received: from mout.gmx.net (mout.gmx.net [212.227.17.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6077D2C1D for ; Tue, 10 Sep 2013 06:00:12 +0000 (UTC) Received: from mandree.no-ip.org ([78.48.41.58]) by mail.gmx.com (mrgmx001) with ESMTPSA (Nemesis) id 0LpKKr-1Vvt0I2sJp-00fCA8 for ; Tue, 10 Sep 2013 08:00:03 +0200 Received: from [IPv6:::1] (localhost6.localdomain6 [IPv6:::1]) by apollo.emma.line.org (Postfix) with ESMTP id A773223CF75 for ; Tue, 10 Sep 2013 08:00:02 +0200 (CEST) Message-ID: <522EB562.8060501@gmx.de> Date: Tue, 10 Sep 2013 08:00:02 +0200 From: Matthias Andree User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130804 Thunderbird/17.0.8 MIME-Version: 1.0 To: freebsd-current@freebsd.org Subject: Re: [PATCH] mtree should not output size if the file is not a regular file References: <20130909235122.4A9C997129@rebar.astron.com> In-Reply-To: <20130909235122.4A9C997129@rebar.astron.com> X-Enigmail-Version: 1.4.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:K74H9yhQrtDigBFAp54JXYRyVucogpo0n73RyFsB/1id4rFKCmY fRfMJ38r1rsHJVce0AJgQ6Z3Kuned96+n2du9D5dtvEOfRUIbzmmdn3Ftuhnwu4skB3wFvU kkK8CKIRCm3/Ta0biQeIuBTuQZournvj8VbjlsWZf011nbuyXFs2Av2S/A+YsbwL7ZS5Uf9 jeWB5G9Zl7AJUkhEmQpUg== 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 06:00:13 -0000 Am 10.09.2013 01:51, schrieb Christos Zoulas: > On Sep 10, 1:21am, des@des.no (=?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?=) wrote: > -- Subject: Re: [PATCH] mtree should not output size if the file is not a reg > > | 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. > > Yes, I agree. I would like to note that the current NetBSD code looks like: > > if (keys & F_SIZE && > (flavor != F_NETBSD6 || S_ISREG(p->fts_statp->st_mode))) > > 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: > > if (keys & F_SIZE && > (flavor == F_FREEBSD9 || S_ISREG(p->fts_statp->st_mode))) Uh, does that flavor == F_FREEBSD9 solve a real problem? Or is it just to reflect some syntax without proper semantics? Or is this just gratuitious because someone else does nonsense we need to do it, too? Or is it required to cater for expectations on the other end (when reading such an mtree description)? If not, let's just drop the size where it's meaningless. It's meant for the next major update, after all. If necessary, bump the OSREVISION.