Subject: Changing from /var/db/pkg
To: None <>
From: Curt Sampson <>
List: tech-pkg
Date: 03/04/2005 14:56:25
In the default configuration, currently, almost everything to do with
packages is stored under "pkgdir", which defaults to /usr/pkg. There are
two exceptions to this:

     1. Configuration files, are sometimes stored in /etc, sometimes in
     /usr/pkg/etc, according to criteria which are not clear to me.

     2. The database of installed packages, files, etc. is stored in

I think my opinions on the first case are pretty well known, but it's
been a while since I bought up the second, if I ever have.

I'd like to propose we move the package database files under pkgdir.
There are a few advantages to this:

     1. If we're trying to store all package stuff together, why single
     this out to store separately?

     2. It makes it more obvious how to completely wipe out all installed
     packages (except for some of their config files--which one could
     argue ought not be so easy to wipe out anyway): rm -rf /usr/pkg (or
     wherever you put pkgdir). You don't have to know beforehand that you
     also need to remove /var/db/pkg.

     3. When sharing pkgdir in some way (be it via NFS, or just tarring
     it up and extracting it on another machine), the database files move
     as well.

Can anybody think of any disadvantages to this scheme? How about
disadvantages to making the change?

It seems to me that backward compatability can be achieved by checking for
the existence of various directories. In the default case:

     1. If /usr/pkg and /usr/pkg/.pkgdb exist, use /usr/pkg/.pkgdb.

     2. If /usr/pkg exists and /usr/pkg/.pkgdb does not exist, but
     /var/db/pkg does exist, use /var/db/pkg.

     3. If neithe exist, do whatever we'd do now when /var/db/pkg is not
     found, but use /usr/pkg/.pkgdb for the package database.


Curt Sampson  <>   +81 90 7737 2974
      Make up enjoying your city life...produced by BIC CAMERA