Subject: Re: /var/db/pkg [was Re: AFS/arla]
To: Michael C. Richardson <mcr@lox.sandelman.ottawa.on.ca>
From: Alistair Crooks <azcb0@amdahl.com>
List: current-users
Date: 09/18/1998 10:14:14
> >>>>> "Manuel" == Manuel Bouyer <bouyer@antioche.lip6.fr> writes:
> 
>     Manuel> On Sep 18, Jason Thorpe wrote
>     >> What about stuff installed in / (like, say, the netbsd14_base pkg?).
>     >> 
> 
>     Manuel> Same problem: / may be a different partition from /var.  One
>     Manuel> should not have to backup /var to be able to restore a fully
>     Manuel> functionnal system. /var should only contain log or run-time
>     Manuel> files, that is, files that can be lost without much harm in most
>     Manuel> cases.
> 
>   I would agree. This is my major problem with current pkg-system. It
> should use /etc/pkg or something. Perhaps the rules should look like:
> 
>   if -d $PKG_BASE/etc/pkg
>   then
> 	PKG_DB=$PKG_BASE/etc/pkg
>   else
> 	PKG_DB=/etc/pkg
>   fi
> 
>   This solves the problem with the netbsd14_base pkg, and also puts
> everything where you expect it (/etc/pkg) unless you go and create a
> seperate pkg tree.

Actually, things are a bit more complicated than this - the pkg_*
tools need to be taught which database to query/update etc

Notwithstanding this, I have an xfer.sh script which moves all the
/var/db/pkg/* directories to ${LOCALBASE}/etc/pkg,
${CROSSBASE}/etc/pkg or ${X11BASE}/etc/pkg, depending upon the prefix
with which the package was built.  (The cases where we modify "system"
binaries do not count at the moment, as we do not register those
packages to avoid de-installation of the same packages, which would
potentially leave people without certain system binaries).

I also have some mods in the pipeline to the pkg_install tools to use
the new prefices.

These mods all depend upon a single /etc/mk.conf variable,
PREFIX_PKG_DBDIR, which is a boolean.

These are not ready for primetime yet - but they will be coming soon,
most people I've talked to seem to be in agreement that this is a good
thing.  Also, I am unwilling to modify the pkg_install tools whilst we
have a mini-freeze in pkgsrc - one thing at a time, same as always.