From owner-freebsd-ports@FreeBSD.ORG Sun Jun 22 12:03:06 2014 Return-Path: Delivered-To: ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2A8ECE5C; Sun, 22 Jun 2014 12:03:06 +0000 (UTC) Received: from mail.moehre.org (mail.moehre.org [195.96.35.7]) by mx1.freebsd.org (Postfix) with ESMTP id 7493E2FB7; Sun, 22 Jun 2014 12:03:05 +0000 (UTC) Received: from mail.moehre.org (unknown [195.96.35.7]) by mail.moehre.org (Postfix) with ESMTP id 4B2C38B143B; Sun, 22 Jun 2014 14:02:58 +0200 (CEST) X-Spam-Flag: NO X-Spam-Score: -100.967 X-Spam-Level: X-Spam-Status: No, score=-100.967 tagged_above=-999 required=5 tests=[ALL_TRUSTED=-1, AWL=0.033, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mail.moehre.org ([195.96.35.7]) by mail.moehre.org (mail.moehre.org [195.96.35.7]) (amavisd-new, port 10024) with ESMTP id z1-D7C5VOWyW; Sun, 22 Jun 2014 14:02:56 +0200 (CEST) Received: from [192.168.100.30] (p54B0A291.dip0.t-ipconnect.de [84.176.162.145]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: coco@executive-computing.de) by mail.moehre.org (Postfix) with ESMTPSA id A29898B141C; Sun, 22 Jun 2014 14:02:56 +0200 (CEST) Message-ID: <53A6C58C.70808@executive-computing.de> Date: Sun, 22 Jun 2014 14:01:16 +0200 From: Marco Steinbach User-Agent: Thunderbird 2.0.0.12 (Windows/20080213) MIME-Version: 1.0 To: Baptiste Daroussin Subject: Re: How can I override global OPTIONS_UNSET for specific port in make.conf? www/xcache References: <53A33F83.7050807@quip.cz> <53A35AE9.8090702@executive-computing.de> <20140622100355.GE23976@ivaldir.etoilebsd.net> In-Reply-To: <20140622100355.GE23976@ivaldir.etoilebsd.net> Content-Type: multipart/mixed; boundary="------------030401060903090702050003" Cc: FreeBSD Ports , Miroslav Lachman <000.fbsd@quip.cz> X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jun 2014 12:03:06 -0000 This is a multi-part message in MIME format. --------------030401060903090702050003 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit 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. --------------030401060903090702050003 Content-Type: text/plain; name="bsd.options.mk.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="bsd.options.mk.patch" Index: Mk/bsd.options.mk =================================================================== --- Mk/bsd.options.mk (revision 358740) +++ Mk/bsd.options.mk (working copy) @@ -196,6 +196,15 @@ # complete list COMPLETE_OPTIONS_LIST= ${ALL_OPTIONS} + +# Handle ports that are using PORTDOCS / PORTEXAMPLES, but do not provide +# EXAMPLES / DOCS options +.for m in DOCS EXAMPLES +. if !empty(PORT_OPTIONS:M${m}) && empty(COMPLETE_OPTIONS_LIST:M${m}) +COMPLETE_OPTIONS_LIST+= ${m} +. endif +.endfor + .for otype in SINGLE RADIO MULTI GROUP . for m in ${OPTIONS_${otype}} COMPLETE_OPTIONS_LIST+= ${OPTIONS_${otype}_${m}} --------------030401060903090702050003--