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



David Brownlee <abs%absd.org@localhost> writes:

> Following up on this, as it seems like people have had enough time to
> chime in, a final proposal:
>
> 1) Change pkgtools/pkg_install's pkgdb_get_dir() #ifdef NETBSD logic:
> - from: if defined/default PKG_DBDIR is missing, and /var/db/pkg if
> present (even if empty) use /var/db/pkg
> - to: if /var/db/pkg is present _and non empty_, and different to
> PKG_DBDIR, show warning and exit
> New warning text:
>   ERROR: PKG_DBDIR is not explicitly set in @etcdir@/pkg-install.conf
>   and /var/db/pkg contains data. See
>   http://pkgsrc.org/pkgdb-change/#set-PKG_DBDIR for instructions.
>
> 2) Adjust platform/NetBSD.mk warning:
> New warning text:
>   ERROR: PKG_DBDIR is not explicitly set in /etc/mk.conf
>   and /var/db/pkg exists.  See
>   http://pkgsrc.org/pkgdb-change/#set-PKG_DBDIR for instructions.
>
> (*) the pkgdb_get_dir() check is non empty, as is trivial to check for
> non empty in C, and an empty /var/db/pkg should not have to cause a
> binary package user to go read up on setting values, while the
> platform/NetBSD.mk warning is stricter as it's reasonable to expect a
> package builder to have a little more awareness of pkgsrc
> infrastructure, and keeps the make test simpler and cheaper

I would drop "and non empty" from step 1.  The point as I see it is that
a new tool (which is all we get to control) should fail with an error if
it detects an unsafe situation.  If /var/db/pkg exists and PKG_DBDIR is
something else, that's trouble waiting to happen if an older pkg_install
is run even once.  I'd rather make people who aren't intending to use
/var/db/pkg actually remove it, to get the benefit of saving even a tiny
number of people from ending up in split-brain.

But I favor the change, even if consensus comes down on including the
"and non empty".  I just think it's better to also error on an empty
/var/db/pkg.

> 3) Contact all NetBSD bulk-builders to ask them to ensure they are not
> building with PKG_DBDIR set to /var/db/pkg

Indeed, and this is already happening anyway.  It is a general principle
that published bulk builds with any official standing should be done
with the checked-in defaults.  (I think any published build that
deviates from the defaults should really clearly explain that
difference.)

Attachment: signature.asc
Description: PGP signature



Home | Main Index | Thread Index | Old Index