Moving pkg_radd, pkg_search config to different location

For configuring pkg_radd/pkg_search, how about /usr/pkg/etc/mk.conf
instead of /etc/settings.conf or /etc/pkg_radd.conf. We create mk.conf
automatically anyway, so it will normally exist.

Putting the config for pkg_radd and pkg_search there makes sense in that
other pkgsrc config options go there. The default values would still work
as expected, even if mk.conf did not exist.

Also, this puts it in a place where it will integrate with the bin-install
target if a user wants to change it. I don't want to have to set the same
variable in multiple places to get the desired results.

On Tue, February 8, 2011 6:06 am, Thomas Nikolajsen \(via DragonFly issue
tracker\) wrote:
>
> Thomas Nikolajsen <thomas.nikolajsen@mail.dk> added the comment:
>
> /usr/pkg/etc/mk.conf isn't a good file location,
> as other pkgsrc install directory (LOCALBASE) can be used,
> also 'etc' directory for pkgsrc can be set separately (PKG_SYSCONFBASE),
> see link below.
>
> If pkgsrc directory is used location must be determined;
> I'm not sure how this is done;
> see also mail archive thread on this very same topic:
> http://leaf.dragonflybsd.org/mailarchive/kernel/2008-01/msg00014.html>
> You could also just stick to using file location in /etc ;-)

Then instead of using /usr/pkg/etc/mk.conf, we use $PKG_SYSCONFDIR/mk.conf
in there, with $PKG_SYSCONFDIR being set to /usr/pkg/etc by default.

If a person is using a different location for their pkgsrc install,
they're probably setting those different variables already just to be able
to reach the files.

The scenario where this would affect a person with a pkgsrc install in a
different location is this: they'd have to :
- install to a different location than /usr/pkg
- not set anything to accomodate this; LOCALBASE, path, etc
- not have set BINPKG_SITES in their environment
- be using pkg_radd or pkg_search
- ignored documentation in the man page that says "$PKG_SYSCONFDIR,
defaulting to /usr/pkg"
- want to use a different download location than the default
- have entered location in /different/location/for/etc/mk.conf

Pkgsrc installs are supposed (generally) to stay within the installed
$prefix. We're duplicating a basic pkgsrc variable outside of the pkgsrc
$prefix. These changes correct for that - I don't want to ever have to
say to somebody, "Oh, you changed the wrong BINPKG_SITES setting."

> Then instead of using /usr/pkg/etc/mk.conf, we use $PKG_SYSCONFDIR/mk.conf
> in there, with $PKG_SYSCONFDIR being set to /usr/pkg/etc by default.
>
> If a person is using a different location for their pkgsrc install,
> they're probably setting those different variables already just to be able
> to reach the files.

After thinking about it, even if all these things came to pass and mk.conf
wasn't found, BINPKG_SITES would still be set by

: ${BINPKG_BASE:=http://mirror-master.dragonflybsd.org/packages}

So this problem situation wouldn't arise, but BINPKG_SITES would still be
set in one location within pkgsrc files.