tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: PKG_DBDIR migration script

On Mon, Dec 28, 2020 at 09:39:14AM -0500, Greg Troxel wrote:
> writes:
> > I believe that the change to tolerate /var/db/pkg silently has made it
> > possible to update setups without harm, and makes upgrade scripts less
> > urgent.
> It has helped greatly.  But there is still the PKG_DBDIR value in the
> mk.conf world, which gets passed in via -K to various operations; I see
> it in make replace (why it's there, I'm not sure, but that's for another
> day).  I feel that I can't prove there are no troubles from having a
> mismatch from mk.conf and fileysystem, and that having users force-point
> their pkgsrc/mk world and tools world to their actual database dirs is
> going to take a lot of problems -- some of which I probably haven't
> even thought of -- off the table.

FWIW, It's now a fatal error to be relying on "compatibility
/var/db/pkg" and not setting PKG_DBDIR in mk.conf when building packages.

.if !defined(PKG_DBDIR) && exists(/var/db/pkg)
PKG_DBDIR_ERROR=        Compatibility pkgdb location exists, but PKG_DBDIR not specified. \
                        This may cause unexpected issues. To avoid problems, add \
                        PKG_DBDIR=/var/db/pkg to /etc/mk.conf.

> In addition, lots of people have somewhat broken setups from manual
> migration, and this script checks that the two databases are in a pair,
> there is only one set, and that the paths in the refcount database are
> ok.  Some of this, including refcount paths, can be fixed automatically.
> So part of the point is to repair people's setups.
> For someone in the situation of not having moved, and having tools with
> your fix, all the "fix" operation will do is add PKG_DBDIR=/var/db/pkg
> to /etc/pkg_install.conf, /usr/pkg/sbin/pkg_install.conf and mk.conf.
> Basically, I am not comfortable cutting 2020Q4 without a check/fix
> script for users.

Home | Main Index | Thread Index | Old Index