Libarchive is a great and flexible library. It allows extracting as well as writing data from many archive formats and many compressions without having to deal with them specifically.
Libarchive is used by many projects like gnomes archive manager (file-roller) or KDEs ark – and there will be at least one more application using it in the future: Boxes.
What is Done
Since Boxes needs more archive handling for the express installation I started writing a Libarchive wrapper for Vala with a gnomish (simple) API. Although this wrapper currently lacks some features (I don’t have the time to do a full-grown thing right now) it is capable of the most basic operations (synchronous for now):
- List files from an archive.
- Extract files from an archive.
- Write files into an existing/new archive.
In order to achieve this I also updated the vapi file to Libarchive 3. This will hopefully go into the Vala repositories soon .
For the Wrapper
So far the wrapper can do everything needed by Boxes so far. Since the wrapper is merely a byproduct at this moment I will not be able to continue the development at the moment. However, since this wrapper seems to be of interest to the community  I do have a TODO-list for some later time:
- Implement the iterators for the readable archive (this works well together with the stream-based Libarchive API).
- Allow deletion of existing files in archives.
- Make extraction/insertion operations asynchronous and cancellable.
You can read more about my GSOC project on a previous post of mine.
Libarchive is needed for handling ISOs and the initrd archives. It will be used to insert preseed.cfg files for the express installation of Debian based systems. I have taken a look at the important parts of the code in Boxes; this is what needs to be done:
- Integration of a stripped version of the wrapper into Boxes.
- Refactoring of the UnattendedFile class to support several injection methods.
- Writing of desktop-profile installation scripts for several distributions (mainly Debian and Ubuntu, JEOS scripts do exist).
I also hope I can reduce the runtime dependencies for Boxes a bit. However, we cannot use Libarchive for all archive operations at this moment since there is a bug concerning the Fedora 20 DVD iso (affecting ark, file-roller and my own wrapper, a bug is already filed ).