From laszlof@ritamari.vonostingroup.com  Wed Mar 29 22:46:22 2006
Return-Path: <laszlof@ritamari.vonostingroup.com>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 4471716A424;
	Wed, 29 Mar 2006 22:46:22 +0000 (UTC)
	(envelope-from laszlof@ritamari.vonostingroup.com)
Received: from ritamari.vonostingroup.com (ritamari.vonostingroup.com [216.144.193.230])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 5908D43D5D;
	Wed, 29 Mar 2006 22:46:19 +0000 (GMT)
	(envelope-from laszlof@ritamari.vonostingroup.com)
Received: from laszlof by ritamari.vonostingroup.com with local (Exim 4.60 (FreeBSD))
	(envelope-from <laszlof@ritamari.vonostingroup.com>)
	id 1FOjSr-000CHU-8U; Wed, 29 Mar 2006 17:48:33 -0500
Message-Id: <E1FOjSr-000CHU-8U@ritamari.vonostingroup.com>
Date: Wed, 29 Mar 2006 17:48:33 -0500
From: Frank Laszlo <laszlof@vonostingroup.com>
Reply-To: Frank Laszlo <laszlof@vonostingroup.com>
To: FreeBSD-gnats-submit@freebsd.org
Cc: portmgr@freebsd.org,pav@FreeBSD.org
Subject: [PATCH]: Add knob to allow for mutually exclusive OPTIONS
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         95085
>Category:       ports
>Synopsis:       [PATCH]: bsd.port.mk: Add knob to allow for mutually exclusive OPTIONS
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    portmgr
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Wed Mar 29 22:50:08 GMT 2006
>Closed-Date:    Tue Jun 05 16:44:45 UTC 2012
>Last-Modified:  Tue Jun 05 16:44:45 UTC 2012
>Originator:     Frank Laszlo
>Release:        FreeBSD 6.0-STABLE i386
>Organization:
>Environment:
System: FreeBSD ritamari.vonostingroup.com 6.0-STABLE FreeBSD 6.0-STABLE #0: Mon Nov 7 12:06:15 EST 2005 laszlof@ritamari.vonostingroup.com:/usr/obj/usr/src/sys/RITAMARI i386


	
>Description:
	This is a small patch to allow for DIALOG to use the --radiolist option. This will allow port maintainers to
	create mutually exclusive port options. I have added an 'OPTIONS_RADIO' knob to enable this feature. I have CC'd
	portmgr as I believe it falls under their territory.

>How-To-Repeat:
	
>Fix:

	



--- bsd.port.mk.diff begins here ---
--- bsd.port.mk.orig	Wed Mar 29 17:30:40 2006
+++ bsd.port.mk	Wed Mar 29 17:43:28 2006
@@ -685,6 +685,8 @@
 #				  into a single variable.  NOTE: To make options work, you need
 #				  to include bsd.port.pre.mk before you start testing the
 #				  WITH_xyz variables.
+# OPTIONS_RADIO		- Use the "--radiolist" option with DIALOG rather than the default
+#				  "--checklist" to allow for mutually exclusive options.
 #
 # For fetch:
 #
@@ -1166,6 +1168,11 @@
 .	if exists(${_OPTIONSFILE}.local)
 .	include "${_OPTIONSFILE}.local"
 .	endif
+.	if defined(OPTIONS_RADIO)
+DIALOG_FLAGS+=	--radiolist
+.	else
+DIALOG_FLAGS+=	--checklist
+.	endif
 .endif
 
 # check for old, crufty, makefile types, part 1:
@@ -5247,7 +5254,7 @@
 	done; \
 	TMPOPTIONSFILE=$$(mktemp -t portoptions); \
 	trap "${RM} -f $${TMPOPTIONSFILE}; exit 1" 1 2 3 5 10 13 15; \
-	${SH} -c "${DIALOG} --checklist \"Options for ${PKGNAME:C/-([^-]+)$/ \1/}\" 21 70 15 $${DEFOPTIONS} 2> $${TMPOPTIONSFILE}"; \
+	${SH} -c "${DIALOG} ${DIALOG_FLAGS} \"Options for ${PKGNAME:C/-([^-]+)$/ \1/}\" 21 70 15 $${DEFOPTIONS} 2> $${TMPOPTIONSFILE}"; \
 	status=$$?; \
 	if [ $${status} -ne 0 ] ; then \
 		${RM} -f $${TMPOPTIONSFILE}; \
--- bsd.port.mk.diff ends here ---

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->portmgr 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Wed Mar 29 22:55:07 UTC 2006 
Responsible-Changed-Why:  
Affects bsd.port.mk. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=95085 

Adding to audit trail from misfiled PR ports/95088:

Date: Wed, 29 Mar 2006 18:25:20 -0500
From: Kris Kennaway <kris@obsecurity.org>
 
 This seems of somewhat restricted utility.  How many ports are there
 where all options are mutually exclusive?
 
 Kris
Adding to audit trail from misfiled PR ports/95090:

Date: Wed, 29 Mar 2006 18:37:55 -0500
From: Frank Laszlo <laszlof@vonostingroup.com>

 There are actually quite a few of them, Currently the port maintainers 
 are just doing something like:
 
 .if defined(WITH_OPTION1) && defined(WITH_OPTION2)
 IGNORE=      Please only choose only 1 option
 .endif
 
 Or something along the lines of that. For the few lines of code it adds 
 to bsd.port.mk, and the fact that it doesn't affect the current 
 operation of existing ports using OPTIONS. I think it would be a valued 
 addition to the ports.
 
 -Frank
Adding to audit trail from misfiled PR ports/95091:

Date: Wed, 29 Mar 2006 18:41:31 -0500
From: Kris Kennaway <kris@obsecurity.org>
 
 Can you point out say half a dozen of them & provide a sample patch to
 convert them?
 
 Kris
Adding to audit trail from misfiled PR ports/95092:

Date: Wed, 29 Mar 2006 19:23:03 -0500
From: Frank Laszlo <laszlof@vonostingroup.com>

 I was only able to come up with 2 current ports that would use this 
 functionality. But I found around 20 that could use something like this, 
 but it would require OPTIONS to support submenus. Since there would be 
 both checklist options, and radiolist options. The ports that would be 
 directly benefitial from this patch are mail/roundcube and 
 print/xfce4-print. And the patches are here:
 
 http://www.franksworld.org/~laszlof/patches/roundcube.diff
 http://www.franksworld.org/~laszlof/patches/xfce4-print.diff
 
 Cheers,
     Frank
Adding to audit trail from misfiled PR ports/95093:

Date: Wed, 29 Mar 2006 19:28:28 -0500
From: Kris Kennaway <kris@obsecurity.org>
 
 I don't like adding new bsd.port.mk variables for the benefit of only
 2/14000 ports..
 
 Kris

Adding to audit trail from misfiled PR ports/95101:

Date: Thu, 30 Mar 2006 11:20:45 +0200
From: Clement Laforet <clement@FreeBSD.org>
 
 On Wed, Mar 29, 2006 at 07:28:28PM -0500, Kris Kennaway wrote:
 > I don't like adding new bsd.port.mk variables for the benefit of only
 > 2/14000 ports..
 
 Many ports don't use OPTIONS because of the lack of mutual exclusive
 support.
 
 clem

Adding to audit trail from misfiled PR ports/95133:

Date: Thu, 30 Mar 2006 19:18:25 -0500
From: Kris Kennaway <kris@obsecurity.org>
 
 On Thu, Mar 30, 2006 at 11:20:45AM +0200, Clement Laforet wrote:
 > On Wed, Mar 29, 2006 at 07:28:28PM -0500, Kris Kennaway wrote:
 > > I don't like adding new bsd.port.mk variables for the benefit of only
 > > 2/14000 ports..
 >
 > Many ports don't use OPTIONS because of the lack of mutual exclusive
 > support.
 
 Really?  Didn't know that :)
 
 Kris
State-Changed-From-To: open->feedback 
State-Changed-By: linimon 
State-Changed-When: Fri May 25 03:25:42 UTC 2007 
State-Changed-Why:  
To pav: are you interested in working on this as part of OPTIONS?  Neither 
kris nor I are convinced that this will not create more problems than it 
solves, but we're willing to listen. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=95085 
State-Changed-From-To: feedback->suspended 
State-Changed-By: pav 
State-Changed-When: Fri May 25 10:03:46 UTC 2007 
State-Changed-Why:  
My take is this is potentionally useful feature, but the submitted patch does 
not allow mixing of checkboxes and radio buttons in a single port; thus making 
it of little use. 

Suspend, and let's see if someone can come up with something more universal. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=95085 
State-Changed-From-To: suspended->closed 
State-Changed-By: bapt 
State-Changed-When: Tue Jun 5 16:44:44 UTC 2012 
State-Changed-Why:  
New options framework implements that kind of features 

http://www.freebsd.org/cgi/query-pr.cgi?pr=95085 
>Unformatted:
