tech-pkg archive

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

Re: Moving mk.conf

David Brownlee <> writes:

> Hijacking this across into the sub thread with my updated proposal.
> 2010/12/12 Aleksej Saushev <>:
>> David Brownlee <> writes:
>>> On 11 December 2010 23:59, David Holland 
>>> <> wrote:
>>>> On Sat, Dec 11, 2010 at 08:14:26PM +0000, David Brownlee wrote:
>>>>  > - Switch from mk.conf to pkgsrc.conf
>>> A file under PKGSRCDIR would make me happy - I'm less concerned about the 
>>> name
>> I don't like it under PKGSRCDIR, it doesn't belong there.
>> I can (and I do) have several pkgsrc trees in the same file names space
>> operating fine with the same LOCALBASE using the same mk.conf.
>> mk.conf belongs to deployment not the pkgsrc tree.
>> I don't think that $(TOP)/mk.conf is good idea either.
>> BTW, same should apply to pkgchk.conf, perhaps I should file PR on that.
>> It is annoying that pkg_chk defaults to configuration and cache/index files
> I think we have conflicting requirements here - (as I understand it) you would
> want any "pkgchk.conf" or similar to be shared across pkgsrc trees, as you
> would want for any pkg_chk.conf or similar files, while I want them to be
> pkgsrc tree specific. I specifically don't want to go messing around in 
> mk.conf
> when I switch to a different pkgsrc tree.

All paths in pkgsrc tree are relative, thus when you work inside the tree,
you work with current tree and everything is fine.

If you have to pass path to pkgsrc tree to some tool, e.g. revbump, you just do 

If you still need absolute path to pkgsrc tree, you're most likely playing 
but then you have to know what you do anyway.

One of such cases is when you're doing something like

  .if $(.CURDIR) == "$(HOME)/pkgsrc-local/category/package"
  CFLAGS+= -fsomething-evil

> I'm assuming if they lived under PREFIX that would be no better for you?
> What do you think about an environment variable which sets the basedir that
> contains the config files (pkg_chk.conf, "pkgsrc.conf", and anything else
> similar), though it may just be enough to specify it for "pkgsrc.conf" and
> rely on values being set in there to affect everything else.

No, it would be much better to me if configuration files that relate to
_installation_ go along with installation, that is if they live inside
prefix or related sysconfdir.

To make it clear to others, pkgsrc tree is independent of installed packages.
You can share it between different prefixes or you can use multiple trees
to work on packages within the same prefix. Unless you're playing tricks,
prefix is determined by installed binaries, it isn't remembered anywhere
in pkgsrc tree, and path to pkgsrc tree isn't remembered anywhere inside
prefix either. This gives you freedom to move pkgsrc tree around and to
build packages for several installations using the same tree.

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"
# Put your non-pkgsrc configuration here.

This is basically what I use.


Home | Main Index | Thread Index | Old Index