Subject: Re: Changing from /var/db/pkg
To: Curt Sampson <cjs@cynic.net>
From: Johnny C. Lam <jlam@NetBSD.org>
List: tech-pkg
Date: 03/04/2005 06:36:29
On Fri, Mar 04, 2005 at 02:56:25PM +0900, Curt Sampson wrote:
> 
[proposal for putting package database files under ${LOCALBASE}]

I completely agree with your proposal for all of the reasons that you
cite.  The location of the package database in /var/db/pkg is historic.
It's where FreeBSD put their ports database files and NetBSD's
pkg_install tools trace their heritage to FreeBSD's same tools.

I'll not quibble over the actual new location of the package database.
The important property under consideration is that it's somewhere
under ${LOCALBASE}, and I'm sure there will be a long thread to decide
where exactly this will be.

> 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.

I think it's simpler to just create a utility to move the old database
to the new location, and to just hardcode using the new location from
that point forward.

As an aside, this merely changes the location of the package database
for the null view in pkgviews.

	Cheers,

	-- Johnny Lam <jlam@NetBSD.org>