Re: cpio reporting too many 'blocks'

From: Giorgos Keramidas <keramida_at_freebsd.org>
Date: Thu, 04 Sep 2008 17:29:50 +0300
On Wed, 03 Sep 2008 22:07:56 -0700, Tim Kientzle <kientzle_at_freebsd.org> 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.  <sigh>  Try this and let me know.
>
> Tim
> Index: cpio.c
> ===================================================================
> --- cpio.c	(revision 182102)
> +++ cpio.c	(working copy)
> _at__at_ -863,7 +863,6 _at__at_
>  	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)
> _at__at_ -872,6 +871,7 _at__at_
>  		    blocks == 1 ? "block" : "blocks");
>  	}
>  
> +	archive_write_finish(cpio->archive);
>  }

That's it.  Not the blocks reported look more sensible:

keramida_at_kobe:/ws/bsd/doc$ find * | cpio -p -dmu /hg/doc/bsd-import
40345 blocks
keramida_at_kobe:/ws/bsd/doc$ echo $(( $( find * | xargs cat | wc -c ) / 512 ))
40916

Thanks :)
Received on Thu Sep 04 2008 - 12:30:12 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:34 UTC