libarchive, bsdtar, pkg_add

Comments, questions, patches: kientzle@freebsd.org

Source Code

About versions: An a in the version indicates a release with known problems unsuitable for production use. A b in the version indicates a release with experimental features that work, but may not yet be fully tested. For production applications, please use the most recent non-alpha/non-beta release. Feedback on any version is always appreciated.

NEWS

Platform Support

Libarchive and bsdtar run on so many platforms now that I'm no longer keeping a list. In particular, I have reports of it running on most Linux distributions, most BSD-based systems, MacOS X, AIX, Interix, Solaris, HP-UX, and Cygwin. It is the standard system tar for FreeBSD, DragonflyBSD, and TinySofa classic server. If you have problems with libarchive or bsdtar on any platform, please let me know.

Regarding Windows: Windows support continues to gradually improve thanks to feedback from a growing number of users. I know of one remaining architectural issue--the reliance on dev/ino numbers to identify like files--that needs to be reconsidered. This is related to the question of how best to handle hardlink and symbolic links on Windows. The next big milestones are to get a Visual C++ solutions file for building libarchive and to build and run some subset of the libarchive_test harness on Windows. Please let me know if you find any other issues.

Documentation

What Is It?

Libarchive is a programming library that can create and read several different streaming archive formats, including most popular tar variants, several cpio formats, and both BSD and GNU ar variants. It can also write shar archives and read ISO9660 CDROM images and ZIP archives. The bsdtar program is an implementation of tar(1) that is built on top of libarchive. It started as a test harness, but has grown into a feature-competitive replacement for GNU tar. The bsdcpio program is an implementation of cpio(1) that is built on top of libarchive.

The libarchive library offers a number of features that make it both very flexible and very powerful.

The bsdtar archiving program is built on libarchive, so offers a variety of modern features. One unusual feature it offers is the ability to function as a format-conversion filter, reading entries from one archive and emitting an archive in a different format with the same contents. This feature was simple to implement because libarchive's robust automatic format detection makes it unnecessary to specify the format of the input archive. More details are available in the bsdtar documentation above.

The bsdtar program has a number of advantages over previous tar implementations:

The new pkg_add I've been experimenting with has a number of advantages over the earlier implementation:

What Still Needs To Be Done?

Why?

A few years ago, there was a debate on one of the mailing lists about the FreeBSD package tools. The debate concerned two interrelated questions:

After looking into it a bit, I concluded that tar/gzip and tar/bzip2 were fine formats and that the performance problems were purely implementation issues.

So, I started a project to rewrite the package tools, beginning with pkg_add. Key to this project is a library that understands tar/gzip and tar/bzip2 archives. Once I had built libarchive, I realized that I nearly had a complete BSD-licensed replacement for GNU tar, hence bsdtar. My rewrite of pkg_add to use libarchive has stalled due to lack of time; I hope to get back to it sometime soon. An early prototype of the core ideas showed a three-fold performance increase over the earlier pkg_add implementation without any changes to the package file format.

Comments, questions, patches: kientzle@freebsd.org