From owner-freebsd-ports@FreeBSD.ORG Wed May 15 16:24:34 2013 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 94A8A2BD for ; Wed, 15 May 2013 16:24:34 +0000 (UTC) (envelope-from gyrd-se@thanelange.no) Received: from smtp.getmail.no (smtp.getmail.no [84.208.15.66]) by mx1.freebsd.org (Postfix) with ESMTP id 2D3EBA59 for ; Wed, 15 May 2013 16:24:34 +0000 (UTC) MIME-version: 1.0 Content-type: multipart/mixed; boundary="Boundary_(ID_isg6SnZki9FxcShUbsppSw)" Received: from get-mta-scan01.get.basefarm.net ([10.5.16.4]) by get-mta-out03.get.basefarm.net (Sun Java(tm) System Messaging Server 7.0-0.04 64bit (built Jun 20 2008)) with ESMTP id <0MMU00H8AISNQG50@get-mta-out03.get.basefarm.net> for freebsd-ports@freebsd.org; Wed, 15 May 2013 17:24:23 +0200 (MEST) Received: from get-mta-scan01.get.basefarm.net (localhost.localdomain [127.0.0.1]) by localhost (Email Security Appliance) with SMTP id 70CCF179AB4D_193A8A7B for ; Wed, 15 May 2013 15:24:23 +0000 (GMT) Received: from smtp.getmail.no (unknown [10.5.16.4]) by get-mta-scan01.get.basefarm.net (Sophos Email Appliance) with ESMTP id 32A8C179A6C8_193A8A7F for ; Wed, 15 May 2013 15:24:23 +0000 (GMT) Received: from cm-84.211.88.167.getinternet.no ([84.211.88.167]) by get-mta-in03.get.basefarm.net (Sun Java(tm) System Messaging Server 7.0-0.04 64bit (built Jun 20 2008)) with SMTP id <0MMU00I7VISMMG00@get-mta-in03.get.basefarm.net> for freebsd-ports@freebsd.org; Wed, 15 May 2013 17:24:23 +0200 (MEST) Received: (qmail 59123 invoked by uid 89); Wed, 15 May 2013 17:24:22 +0200 Received: from unknown (HELO ?10.0.10.184?) (gyrd@thanelange.no@77.241.104.2) by cm-84.211.88.167.getinternet.no with SMTP; Wed, 15 May 2013 17:24:22 +0200 Message-id: <5193A8A6.2000108@thanelange.no> Date: Wed, 15 May 2013 17:24:22 +0200 From: Gyrd Thane Lange User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130509 Thunderbird/17.0.6 To: Gyrd Thane Lange Subject: Re: OPTIONSng: Overide options in /var/db/ports/*/options ? References: <5145B415.80303@executive-computing.de> <5145C9DC.6010300@infracaninophile.co.uk> <5145E47D.4050201@executive-computing.de> <51460B2C.6080500@executive-computing.de> <20130317184927.GF72627@ithaqua.etoilebsd.net> <20130317212713.326fc93d@parvati.thanelange.no> In-reply-to: <20130317212713.326fc93d@parvati.thanelange.no> Cc: Marco Steinbach , Baptiste Daroussin , FreeBSD Mailing List , Chris Rees X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 May 2013 16:24:34 -0000 This is a multi-part message in MIME format. --Boundary_(ID_isg6SnZki9FxcShUbsppSw) Content-type: text/plain; charset=ISO-8859-1 Content-transfer-encoding: 7BIT Hi all, its been a while but I have prepared a patch. On 17.03.2013 21:27, Gyrd Thane Lange wrote: [Snipped away most of the discussion about whether /var/db/ports/*/options or make.conf should have the final word, and mechanisms for forcing one or the other.] > I would rather have a mechanism where the port dialogue is brought up > automatically if there is a conflict between the settings in make.conf > and those stored in */options. The dialogue should then present the > stored settings, with the make.conf settings applied latest. (Forget about raising the dialogue and resolving conflicts automatically. I found a better way.) > This way my settings in make.conf will no longer be silently ignored. Rather than forcing either of make.conf or /var/db/ports/*/options to thrumph the other I have instead settled on a conflict reporting mechanism that will prevent the port system from silently ignoring my wishes and allow me to manually resolve the conflicts before building. The gist of the attached patch is: 1) Go through the options in make.conf and command line (in priority order) and build two lists: - a list of all options that MUST be set - a list of all options that MUST NOT be set 2) Compare with current options and build lists where options do not match users MUST [NOT] preferences. 3) Act on any conflict Currently I've only implemented a simple way of setting IGNORE with a list of conflicting options when the following make variable is set. OPTIONS_CONFLICT_ACTION=fail If the variable is not set then no action will be taken (making this feature non-obtrusive to users unless they activate it.) In the future we may implement other actions: perhaps to automatically bring up the configuration dialogue. Note about (1). I see that _[UN]SET_FORCE options have been implemented after I prepared this patch. This may easily be added to the patch if required. I have not needed it yet. This patch is complementary to all the other preference logic, since it doesn't actually change any options but only report on them. Best regards, Gyrd ^_^ --Boundary_(ID_isg6SnZki9FxcShUbsppSw) Content-type: text/plain; charset=windows-1252; name=mk_options_conflict.diff Content-transfer-encoding: 7BIT Content-disposition: attachment; filename=mk_options_conflict.diff Index: Mk/bsd.options.mk =================================================================== --- Mk/bsd.options.mk (revision 317733) +++ Mk/bsd.options.mk (working copy) @@ -315,6 +315,88 @@ .undef _SORTED_OPTIONS .endif +### 2013-04-19, GTL, check for conflicts +# Build list of users express preference +# Maintain two lists: +# a) A positive list of all options that MUST be set +# b) A negative list of all options that MUST NOT be set +# Priority: (first listed is least important) +# 1) Global +# 2) Uniquename +# 3) with_/without_ (from make.conf) +# 4) command line + +# Global options... +_OPTIONS_MUST_SET= ${OPTIONS_SET} +_OPTIONS_MUST_UNSET= ${OPTIONS_UNSET} + +# Port specific options... +.for opt in ${${UNIQUENAME}_SET} +_OPTIONS_MUST_SET+= ${opt} +_OPTIONS_MUST_UNSET:= ${_OPTIONS_MUST_UNSET:N${opt}} +.endfor +.for opt in ${${UNIQUENAME}_UNSET} +_OPTIONS_MUST_SET:= ${_OPTIONS_MUST_SET:N${opt}} +_OPTIONS_MUST_UNSET+= ${opt} +.endfor + +# WITH and WITHOUT found in make.conf or reloaded from old optionsfile +# Actually, we only want to heed settings from make.conf (not the optionsfile), +# but I don't know how to tell them apart. +#.for opt in ${ALL_OPTIONS} +#. if defined(WITH_${opt}) +#_OPTIONS_MUST_SET+= ${opt} +#_OPTIONS_MUST_UNSET:= ${_OPTIONS_MUST_UNSET:N${opt}} +#. endif +#. if defined(WITHOUT_${opt}) +#_OPTIONS_MUST_SET:= ${_OPTIONS_MUST_SET:N${opt}} +#_OPTIONS_MUST_UNSET+= ${opt} +#. endif +#.endfor + +# Command line... +.for opt in ${WITH} +_OPTIONS_MUST_SET+= ${opt} +_OPTIONS_MUST_UNSET:= ${_OPTIONS_MUST_UNSET:N${opt}} +.endfor +.for opt in ${WITHOUT} +_OPTIONS_MUST_SET:= ${_OPTIONS_MUST_SET:N${opt}} +_OPTIONS_MUST_UNSET+= ${opt} +.endfor + +# Prettify... +_OPTIONS_MUST_SET:= ${_OPTIONS_MUST_SET:O:u} +_OPTIONS_MUST_UNSET:= ${_OPTIONS_MUST_UNSET:O:u} + +# report where current options does match users preferences +.for opt in ${ALL_OPTIONS} +. if empty(PORT_OPTIONS:M${opt}) +. if ${_OPTIONS_MUST_SET:M${opt}} +_OPTIONS_CONFLICT_SET+= ${opt} +. endif +. else +. if ${_OPTIONS_MUST_UNSET:M${opt}} +_OPTIONS_CONFLICT_UNSET+= ${opt} +. endif +. endif +.endfor +.undef opt +.if !empty(OPTIONS_CONFLICT_ACTION:Mfail) +. if defined(_OPTIONS_CONFLICT_SET) +. if defined(_OPTIONS_CONFLICT_UNSET) +eol_marker=. +. endif +# Complain about options that should have been set +IGNORE+= Option ${_OPTIONS_CONFLICT_SET} unexpectedly unset${eol_marker} +. endif +. if defined(_OPTIONS_CONFLICT_UNSET) +# Complain about options that should not have been set +IGNORE+= Option ${_OPTIONS_CONFLICT_UNSET} unexpectedly set +. endif +.endif +### End of conflicts check + + ### to be removed once old OPTIONS disappear .for opt in ${ALL_OPTIONS} .if empty(PORT_OPTIONS:M${opt}) --Boundary_(ID_isg6SnZki9FxcShUbsppSw)--