tech-pkg archive

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

Re: Moving mk.conf



Jean-Yves Migeon <jeanyves.migeon%free.fr@localhost> writes:

> On Mon, 13 Dec 2010 07:10:58 +0300, Aleksej Saushev
> <asau%inbox.ru@localhost> wrote:
>> On moving mk.conf.
>>
>> The most reasonable approach I can come up, is installing default
>> /etc/mk.conf
>> with this content:
>>
>> .ifdef BSD_PKG_MK
>> .sinclude "/usr/pkg/etc/mk.conf"
>> .else
>> # Put your non-pkgsrc configuration here.
>> .endif
>>
>> This is basically what I use.
>
> This is wrong: mk.conf relates to pkgsrc, not system package
> configuration directory.

mk.conf relates to package configuration directory.

> BTW, that's dubious, you hardcode path to /usr/pkg (which is
> completely arbitrary, so how is it supposed to work when someone
> bootstraps with a different --sysconfdir?)

You don't understand how pkgsrc works then. pkgsrc tries hard to isolate
packages and itself from anything outside base system and prefix.
("Oh, it's Solaris, sh is broken on Solaris, let's install pdksh...
And sed is broken too, let's install nbsed...")

When you bootstrap pkgsrc, you build and install bmake.
bmake knows location of its own configuration file, and it is package
configuration directory. bmake's default configuration file sets
LOCALBASE, PKG_SYSCONFDIR, VARBASE and other necessary variables.
When you run specific instance of bmake, it sets all necessary paths
that are outside pkgsrc tree, and all paths inside pkgsrc tree are
relative and thus independent of pkgsrc tree location.

The only difference is NetBSD itself, which comes with bmake preinstalled
and under another name. On NetBSD bmake is called "make" and looks for
its configuration file in /etc.

If we agree that /usr/pkg is default prefix on NetBSD, then it has to be
embedded somewhere. It is embedded into pkgsrc already (default prefix),
and in binary packages, which are built and shipped with default options.
I suspect that /usr/pkg is embedded into default login.conf or profile too.
Thus embedding default /usr/pkg in system's default is reasonable. It is
already spread over system configuration, doing it once more doesn't
change much.

> If you want to share a common core between multiple pkgsrc
> setups, just have PKGSRCDIR/conf/mk.conf (whatever its name,
> just put it below PKGSRCDIR), and .sinclude /etc/mk.conf (which
> can be done by added by default, if you want to.

This is overly complex and error-prone, it works much better already.

> All paths in pkgsrc are relative. It's not obvious that its
> behaviour can depend on a file living _outside_ its base dir. I
> hardly cannot see the reason why it was made that way by default
> with NetBSD...

When you bootstrap pkgsrc you explicitly set some parameters that point
outside pkgsrc. When you install package, you use tools that exist
outside pkgsrc tree. It is done this way already, and there's absolutely
no need to change it. It provides enough flexibility for more complex
administration and development patterns than using single central tree
and single central prefix for packages.


-- 
HE CE3OH...



Home | Main Index | Thread Index | Old Index