How can I override global OPTIONS_UNSET for specific port in make.conf? www/xcache

Marco Steinbach coco at executive-computing.de
Sun Jun 22 12:03:06 UTC 2014


Baptiste Daroussin wrote on 22.06.2014 12:03:
> On Thu, Jun 19, 2014 at 11:49:29PM +0200, Marco Steinbach wrote:
>> Miroslav Lachman schrieb:
>>> I don't need DOCS, EXAMPLES etc. for each port as I normaly do not use 
>>> them on servers.
>>> I have this line in make.conf
>>>
>>> OPTIONS_UNSET= X11 GUI CUPS DOCS EXAMPLES NLS
>>>
>>> Now I need www/xcache port installed with EXAMPLES.
>>> I tried following in make.conf:
>>>
>>> xcache_SET= EXAMPLES
>>>
>>> or
>>>
>>> xcache_SET_FORCE= EXAMPLES
>>>
>>> In both cases, xcache is installed without EXAMPLES.
>>>
>>> So how can I have globally disabled EXAMPLES and enable it only for one 
>>> specific port?
>> After some testing, I think this could be a bug in the handling of 
>> PORTEXAMPLES / PORTDOCS, since flipping EXAMPLES / DOCS options (and any 
>> other options I tried) with these switches works as expected.
>>
>> I'll try and have a go at this.
> 
> The port should just add EXAMPLES to OPTIONS_DEFINE otherwise the framework is
> not entierly followed, if maintainer adds EXAMPLES then a simple
> xcache_SET= EXAMPLES or www_xcache_SET= EXAMPLES
> 
> will just works.
> 
> That is why all DOCS, NLS, EXAMPLES etc should not anymore be hidden.
> 
> regards,
> Bapt


The current handling, while working as designed, leads to confusing results.

I'll illustrate this for www/xcache:

Does install EXAMPLES:
OPTIONS_SET_FORCE=EXAMPLES

Does install EXAMPLES:
www_xcache_SET_FORCE=EXAMPLES

But this one does not install examples:
OPTIONS_UNSET_FORCE=EXAMPLES
www_xcache_SET_FORCE=EXAMPLES


The first two install EXAMPLES rather by accident, while the last one 
doesn't, because it prevents the accident from happening, but promptly 
ends up in a different one.


While I'd also prefer maintainers to fix their options, the current 
behaviour leads to users trying to access the ports systems internals 
for working around this, instead of using the interfaces OPTIONSng provides.

I think that's what my attached patch is mainly about.  Prevent users 
from introducing more complexity into their world, by keeping it in the 
ports framework, instead of exposing them to the current deficiencies of 
some 1700 [1] ports.


If we can agree on an approach, I'm first in line to volunteer for 
fixing these ports.  But that doesn't mean, I wouldn't want my patch to 
be commited, of course :)

MfG CoCo
[1] Quick scan of the ports tree:
Ports that are using PORTEXAMPLES / PORTDOCS, but either don't have port 
options at all, or just not for DOCS / EXAMPLES: ~1700 -- and I'm 
reasonably sure, that this is not too far from the correct numbers.

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: bsd.options.mk.patch
URL: <http://lists.freebsd.org/pipermail/freebsd-ports/attachments/20140622/9a42707a/attachment.ksh>


More information about the freebsd-ports mailing list