From owner-freebsd-ports@FreeBSD.ORG Sat Jun 21 10:42:24 2014 Return-Path: Delivered-To: ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4D25C81A for ; Sat, 21 Jun 2014 10:42:24 +0000 (UTC) Received: from mail.moehre.org (mail.moehre.org [195.96.35.7]) by mx1.freebsd.org (Postfix) with ESMTP id D4BB72743 for ; Sat, 21 Jun 2014 10:42:23 +0000 (UTC) Received: from mail.moehre.org (unknown [195.96.35.7]) by mail.moehre.org (Postfix) with ESMTP id C02098B143B; Sat, 21 Jun 2014 12:42:15 +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 O2Dis1ZyJIkX; Sat, 21 Jun 2014 12:42:14 +0200 (CEST) Received: from [192.168.100.30] (p54B087A7.dip0.t-ipconnect.de [84.176.135.167]) (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 181A18B141C; Sat, 21 Jun 2014 12:42:14 +0200 (CEST) Message-ID: <53A56124.7010409@executive-computing.de> Date: Sat, 21 Jun 2014 12:40:36 +0200 From: Marco Steinbach User-Agent: Thunderbird 2.0.0.12 (Windows/20080213) MIME-Version: 1.0 To: Miroslav Lachman <000.fbsd@quip.cz> 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> <53A37AFD.3060302@executive-computing.de> In-Reply-To: <53A37AFD.3060302@executive-computing.de> Content-Type: multipart/mixed; boundary="------------060204000606030209090903" Cc: FreeBSD Ports 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: Sat, 21 Jun 2014 10:42:24 -0000 This is a multi-part message in MIME format. --------------060204000606030209090903 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Marco Steinbach wrote on 20.06.2014 02:06: > Marco Steinbach wrote on 19.06.2014 23:49: >> 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. >> > > [...] > > If a port does not explicitly define an option for a feature in its > Makefile, then a port specific setting for that option has no effect, > since it simply doesn't match against the options defined in the ports > Makefile. > > IOW: If a port does not explicity define an EXAMPLES option, then a port > specific SET or UNSET for the EXAMPLES option in /etc/make.conf has no > effect. > > Consequently, in the case of www/xcache, simply adding a dummy EXAMPLE > option to OPTIONS_DEFINE makes xcache_SET_FORCE=EXAMPLES work as > expected: It installs examples, overriding OPTIONS_UNSET_FORCE. > > > Depending on ones point of view, one could say, that this works as > advertised. But it's confusing and robs us of port specific _FORCE > flags in certain cases. > > One possible solution could be, to have Mk/bsd.options.mk detect the use > of PORTEXAMPLES and PORTDOCS in a port, and then silently translate > these into DOCS / EXAMPLES options (adding them to > ${COMPLETE_OPTIONS_LIST}), if they're not present. > > Without them popping up in a dialog, since that would be the maintainers > domain, and without persisting them, of course. > > I'm still trying to wrap my head around these parts of the ports system, > though, in order to not accidentially break things. > > MfG CoCo > PS: I'm taking bapt@ out of the loop again, until we're either > completely stuck or are able to produce a patch. > > I think I found a more simple way to do this. Could you please try the attached patch ? Thanks. MfG CoCo --------------060204000606030209090903 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 357923) +++ Mk/bsd.options.mk (working copy) @@ -199,6 +199,14 @@ # complete list COMPLETE_OPTIONS_LIST= ${ALL_OPTIONS} + +# Handle ports that are using PORTDOCS / PORTEXAMPLES +.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}} --------------060204000606030209090903--