From owner-freebsd-current@FreeBSD.ORG Thu Sep 4 14:30:12 2008 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F01BB106566B; Thu, 4 Sep 2008 14:30:12 +0000 (UTC) (envelope-from keramida@freebsd.org) Received: from igloo.linux.gr (igloo.linux.gr [62.1.205.36]) by mx1.freebsd.org (Postfix) with ESMTP id 5138C8FC08; Thu, 4 Sep 2008 14:30:12 +0000 (UTC) (envelope-from keramida@freebsd.org) Received: from kobe.laptop (adsl57-66.kln.forthnet.gr [77.49.184.66]) (authenticated bits=128) by igloo.linux.gr (8.14.3/8.14.3/Debian-5) with ESMTP id m84ETpLW003671 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 4 Sep 2008 17:29:57 +0300 Received: from kobe.laptop (kobe.laptop [127.0.0.1]) by kobe.laptop (8.14.3/8.14.3) with ESMTP id m84ETp9B003770; Thu, 4 Sep 2008 17:29:51 +0300 (EEST) (envelope-from keramida@freebsd.org) Received: (from keramida@localhost) by kobe.laptop (8.14.3/8.14.3/Submit) id m84ETo0m003769; Thu, 4 Sep 2008 17:29:50 +0300 (EEST) (envelope-from keramida@freebsd.org) From: Giorgos Keramidas To: Tim Kientzle References: <87hc8x74nd.fsf@kobe.laptop> <48BEB5E1.8080906@freebsd.org> <87ej41rkpk.fsf@kobe.laptop> <48BF6D2C.4030001@freebsd.org> Date: Thu, 04 Sep 2008 17:29:50 +0300 In-Reply-To: <48BF6D2C.4030001@freebsd.org> (Tim Kientzle's message of "Wed, 03 Sep 2008 22:07:56 -0700") Message-ID: <87ljy8j869.fsf@kobe.laptop> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-MailScanner-ID: m84ETpLW003671 X-Hellug-MailScanner: Found to be clean X-Hellug-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-4.284, required 5, autolearn=not spam, ALL_TRUSTED -1.80, AWL 0.12, BAYES_00 -2.60) X-Hellug-MailScanner-From: keramida@freebsd.org X-Spam-Status: No Cc: freebsd-current@freebsd.org Subject: Re: cpio reporting too many 'blocks' X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 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: Thu, 04 Sep 2008 14:30:13 -0000 On Wed, 03 Sep 2008 22:07:56 -0700, Tim Kientzle wrote: >Giorgos Keramidas wrote: >> ACK. If you want me to run any tests or test patches, please feel free >> to send them this way :-) > > I think I found it. Try this and let me know. > > Tim > Index: cpio.c > =================================================================== > --- cpio.c (revision 182102) > +++ cpio.c (working copy) > @@ -863,7 +863,6 @@ > r = archive_write_close(cpio->archive); > if (r != ARCHIVE_OK) > cpio_errc(1, 0, archive_error_string(cpio->archive)); > - archive_write_finish(cpio->archive); > > if (!cpio->quiet) { > blocks = (archive_position_uncompressed(cpio->archive) + 511) > @@ -872,6 +871,7 @@ > blocks == 1 ? "block" : "blocks"); > } > > + archive_write_finish(cpio->archive); > } That's it. Not the blocks reported look more sensible: keramida@kobe:/ws/bsd/doc$ find * | cpio -p -dmu /hg/doc/bsd-import 40345 blocks keramida@kobe:/ws/bsd/doc$ echo $(( $( find * | xargs cat | wc -c ) / 512 )) 40916 Thanks :)