tech-pkg archive

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

Re: Time to change defaults for PKG_DBDIR



So, this is all essentially NetBSD specific, as I don't know who else needs "split brain" handling. Suggest whatever we do is enabled for NetBSD by default, but disabled for others unless someone sets a build option

I think the only way to manage this is to have pkgsrc pkg_install make a runtime decision for PKG_DBDIR
- Use any value set in a config file, environment or command-line as now
- Else check for $PREFIX/pkgdb/pkgdb.byfile.db and /var/db/pkg/pkgdb.byfile.db
  a) If only one is found, use it (at some later date start printing a warning to stderr if using /var/db/pkg)
  b) If neither are found use $PREFIX/pkgdb
  c) If both are found print an error to stderr and stop - suggest include detail explaining what is happening, how to fix and include a link to a netbsd.org page

Enumerating some use cases (All NetBSD, all focussed on binary package pkg_install & therefore pkgin behaviour)

1) Any system with split brain (all others assumed not to be)
  - Will get the error and info on how to fix
2) Any system with PKG_DBDIR set in config files
  - Will continue as now
2) Newer netbsd system, new to pkgsrc, base pkgtools use $PREFIX/pkgdb
  - Will use $PREFIX/pkgdb
3) Older netbsd system, new to pkgsrc, base pkgtools use /var/db/pkgdb
  - Will use /var/db/pkgdb
4) Any netbsd system, existing pkgsrc, with pkgsrc pkg_install using $PREFIX/pkgdb
  - Will continue to use $PREFIX/pkgdb
5) Any netbsd system, existing pkgsrc, with pkgsrc pkg_install using /var/db/pkgdb
  - Will continue to use /var/db/pkg

They key points are
- Binary packages will work for existing systems using either $PREFIX/pkgdb or /var/db/pkgdb
- Recent netbsd systems newly setting up pkgsrc will use $PREFIX/pkgdb
- Anyone can override by setting PKG_DBDIR

David

On Sat, 30 Apr 2022 at 17:04, Emmanuel Dreyfus <manu%netbsd.org@localhost> wrote:
On Fri, Apr 29, 2022 at 05:25:07PM +0100, David Brownlee wrote:
> Just had an entertaining time split brain /var/db/pkg and /usr/pkg/pkgdb on
> a fresh NetBSD-9.2 macppc box trying to use pkgin.

It would be nice if tools could check both locations...
--
Emmanuel Dreyfus
manu%netbsd.org@localhost


Home | Main Index | Thread Index | Old Index