tech-pkg archive

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

Re: PKG_DBDIR migration script



On Sun, Dec 27, 2020 at 08:24:57PM -0500, Greg Troxel wrote:
> I just committed a script to deal with PKG_DBDIR migration; it lives in
> the top-level of /usr/pkgsrc as _NetBSD-pkgdb.
> 
> (To non-NetBSD users, sorry for the ick, but it's one file and easy to
> ignore, and is prefixed with _ to make it sort not near anything else.)
> 
> This script can "check", "fix", or "migrate".  I've tested it on a
> number of my systems but I'm running out of computers with pkgsrc.
> 
> Using "check" can be done as non-root and should be entirely safe.  It
> simply figures out where your PKG_DBDIR is, checks if that's set in
> pkg_install.conf (/etc and /usr/pkg/etc) and in the mk.conf world, and
> checks your refcount dir for referencs to the other PKG_DBDIR location.
> 
> The "fix" operation will add PKG_DBDIR= lines to config files, and
> patch up refcount files.
> 
> The "migrate" operation will do all the above, and actually move the
> database.
> 
> I would of course appreciate testing and review from tech-pkg, before
> pkgsrc-users tries this out.

Thanks for working on it. I'll have a closer look & test it later.
I believe the appropriate place to put it is in NetBSD's postinstall
script. That one is meant to handle updates, and as a bonus, is easily
available for binary package users as well.



Home | Main Index | Thread Index | Old Index