FreePKG is a complete re-write of the FreeBSD pkg_install tools, which are the software behind the FreeBSD Port's Collection. These tools create, add, remove and otherwise manage the process of installing the more the 10,000 pieces of software in the FreeBSD Port's Collection. They are also used by NetBSD, OpenBSD, DragonFlyBSD and several other projects for a similar function. They are quite similar to Debian's dpkg or Redhat's PRM.

These tools have been re-written (as FreePKG) to provide a number of new features:

FreePKG aims to implement all of these, although there are some rought edges still, and as a side effect, there is also a new taget for which can check to ensure that a port does not overwrite existing files. However, this does not work for ports with dynamically generated plists. To make this work, we would have to move all plist munging into a make-plist target, which would get called after post-build.

The code has been almost completely rewritten, to make it much more flexible, and to provide all of the functionality from within a shared library (although this is not built yet). The design uses a 'Pacakge Manager', which keeps track of all of the packages installed on the system. The pkg_* utilities use the pkg_mgr API to interact with the pacakge manager, which does all of the work. The package manager manages packages as package entries. These are structures which contain the system specific information about the package (like it's playpen/tmpdir location). These are a state machine, which keeps track of the current state of a package and move it from one state to another. The non-system information is stored in the package structure, which now contains the name, and some other one-to-one mapped data in it's head, and also has three lists - the packaging list, the dependency list and the required by list. All of the list managment is done with macros which implement a singly linked list with a managed tail pointer, and can contain information in the head.

At the moment this code is being tested. It will very likely crash on you in very unexpected ways, because of some stupid thing. Jeremy Lea began from a CVS copy of pkg_install from a number of years ago, and so there are a large number of changes to pkg_install which need to be merged in so that the new version has the same (or equivalent) functionality as the existing code base.

The '@option preserve' functionality is no longer provided. It will be entrirely reimplemented, using a backup package, created before package installation of all of the files which would be overwritten. The REQUIRED_BY and @pkfdep lists now only contains those packages which directly require us, not all of the packages which we depend on or which require us, so pkg_info functions need to be added to list these. Otherwise, things should behave fairly similarly.

Things to do are still:

Some thoughts on package signing. The +CONTENTS file in it's current form contains MD5 checksums for all of our files, including scripts. We can just plaintext sign the +CONTENTS file with pgp/openssl, and then append the signature to the file in a new @signature entry. To check, we just pipe out the file up to this entry to pgp/openssl and check it. We don't have to play with tarballs, or any other mechanisms.

A Patch to FreeBSD's is needed to use these with the FreeBSD Port's collection. Logo

Updated: $Id: index.html,v 1.2 2004/05/04 22:46:24 jlea Exp $