tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bsdcpio and bsdtar installed by default

On Thu, Jun 05, 2008 at 11:13:21AM +0200, Martin Husemann wrote:
> I don't understand the whole idea (besides I do not understand the advantages
> of the new stuff well enough) - if we replace tar/pax/cpio with the new
> stuff when it's ready, it will get good testing in -current after we branch
> for 5.0 - but if it is installed under some obscure different name, it will
> not be tested at all, so why import it?

One reason is that it makes it possible to use the mono package on
NetBSD 5.0 and supposedly other similiar packages. pax-as-tar can't deal
with the POSIX interchange format pkg_create creates and it can't even
create such archives correctly.  That is a very practical reason to do
it before the branch, especially given that the pkg_install-renovation
branch won't be part of NetBSD 5.0, which fixes the problem by avoiding
external tar completely.

bsdtar itself is mature code, it has been the system tar on FreeBSD for
a long time now.  It has some different defaults (e.g. --unlink is not
the default, neither is -S).  It does not support historic legacy like
-B.  For those two reasons I explicitly don't want to make it the
default right now.  Most of the recent work was to add some of the
NetBSD specific features like -S and -s.  bsdcpio on the other hard is
much newer code and still needs validation whether some of the more
obscure options are really desired or not.

Both programs have a number of advantages. They are often faster. On my
laptop with extraction to tmpfs:
% time bsdtar xzf Django-0.96.2.tar.gz 
bsdtar xzf Django-0.96.2.tar.gz  0.12s user 0.06s system 99% cpu 0.188 total
% time tar xzf Django-0.96.2.tar.gz 
tar xzf Django-0.96.2.tar.gz  0.13s user 0.13s system 105% cpu 0.256 total

That's after the first run, e.g. all binaries are in memory. Same test
with uncompressed tarball:
% time bsdtar xf Django-0.96.2.tar 
bsdtar xf Django-0.96.2.tar  0.01s user 0.07s system 99% cpu 0.084 total
% time tar xf Django-0.96.2.tar 
tar xf Django-0.96.2.tar  0.01s user 0.13s system 99% cpu 0.147 total

Both programs have transparent detection of input format and can handle
all relevant tar formats, cpio and a number of other things. For
example, pax-as-cpio can't create the new cpio format, which allows
storing hardlinks without all the duplication.


Home | Main Index | Thread Index | Old Index