From m.seaman@infracaninophile.co.uk  Tue Nov 22 15:31:21 2011
Return-Path: <m.seaman@infracaninophile.co.uk>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2EF6C1065677;
	Tue, 22 Nov 2011 15:31:21 +0000 (UTC)
	(envelope-from m.seaman@infracaninophile.co.uk)
Received: from smtp.infracaninophile.co.uk (smtp6.infracaninophile.co.uk [IPv6:2001:8b0:151:1:3cd3:cd67:fafa:3d78])
	by mx1.freebsd.org (Postfix) with ESMTP id 9A8958FC1E;
	Tue, 22 Nov 2011 15:31:20 +0000 (UTC)
Received: from lucid-nonsense.infracaninophile.co.uk (localhost [IPv6:::1])
	by smtp.infracaninophile.co.uk (8.14.5/8.14.5) with ESMTP id pAMFVCVQ075678;
	Tue, 22 Nov 2011 15:31:12 GMT
	(envelope-from matthew@lucid-nonsense.infracaninophile.co.uk)
Received: (from matthew@localhost)
	by lucid-nonsense.infracaninophile.co.uk (8.14.5/8.14.5/Submit) id pAMFV9xL075677;
	Tue, 22 Nov 2011 15:31:09 GMT
	(envelope-from matthew)
Message-Id: <201111221531.pAMFV9xL075677@lucid-nonsense.infracaninophile.co.uk>
Date: Tue, 22 Nov 2011 15:31:09 GMT
From: Matthew Seaman <m.seaman@infracaninophile.co.uk>
Reply-To: Matthew Seaman <m.seaman@infracaninophile.co.uk>
To: FreeBSD-gnats-submit@freebsd.org
Cc: wxs@atarininja.org, mmendez@energyhq.be, admin@lissyara.su,
        ale@freebsd.org, acm@freebsd.org, cristi@net.utcluj.ro,
        miwi@freebsd.org
Subject: [patch] Remove some redundancy in OPTIONS handling
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         162754
>Category:       ports
>Synopsis:       [patch] Remove some redundancy in OPTIONS handling
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    wxs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Nov 22 15:40:00 UTC 2011
>Closed-Date:    Sun Dec 25 19:37:20 UTC 2011
>Last-Modified:  Sun Dec 25 19:40:13 UTC 2011
>Originator:     Matthew Seaman
>Release:        FreeBSD 8.2-STABLE amd64
>Organization:
Infracaninophile.co.uk
>Environment:
System: FreeBSD lucid-nonsense.infracaninophile.co.uk 8.2-STABLE FreeBSD 8.2-STABLE #23: Fri Nov 18 09:25:59 GMT 2011 root@lucid-nonsense.infracaninophile.co.uk:/usr/obj/usr/src/sys/LUCID-NONSENSE amd64


	
>Description:

As discussed in the thread starting with this message:

http://lists.freebsd.org/pipermail/freebsd-ports/2011-November/071511.html

a number of ports are redefining PORT_DBDIR already defined with the
same value in bsd.port.mk

Affected ports are:

% grep -rl '/var/db/ports' .
./sysutils/thefish/Makefile
./lang/php52-extensions/Makefile
./lang/php5-extensions/Makefile
./lang/fpc-units/Makefile
./lang/php4-extensions/Makefile
./devel/mico/Makefile
./net-mgmt/netustad/Makefile
./net-mgmt/nedi/Makefile
./mail/squirrelmail-shared_calendars-plugin/Makefile
./security/pear-Crypt_RSA/Makefile
./Mk/bsd.port.mk    ---- where this should be defined
./UPDATING          ---- innocent bystander
./ports-mgmt/portmanager/files/patch-libMGPM__src__MGPMrUpdate.c ---- ditto

The attached patches fix the observed redundancy and bring those ports
into line with using OPTIONS in the standard ports way.

portlint has been petted only to the extent that any errors have been
suppressed.

After applying these patches, there are no more hits to the following
commands in any port Makefiles:

% grep -rl '${PORT_DBDIR}/${LATEST_LINK}/options' .
% grep -rl '\.include.*OPTIONSFILE' .

PR generated at request of wxs@...  Maintainers have been CC'd

>How-To-Repeat:
	
>Fix:

	

--- fpc-units.diff begins here ---
Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/lang/fpc-units/Makefile,v
retrieving revision 1.25
diff -u -u -r1.25 Makefile
--- Makefile	27 Sep 2011 06:58:55 -0000	1.25
+++ Makefile	22 Nov 2011 14:28:41 -0000
@@ -94,13 +94,9 @@
 		XFORMS	"Interface to X-Forms"	on \
 		ZLIB	"Interface to the zlib compression library"	on \
 
-PORT_DBDIR?=	/var/db/ports
 LATEST_LINK=	${PKGNAMEPREFIX}${PORTNAME}
-OPTIONSFILE?=	${PORT_DBDIR}/${LATEST_LINK}/options
-                
-.if exists(${OPTIONSFILE})
-.include "${OPTIONSFILE}"
-.endif
+
+.include <bsd.port.options.mk>
 
 ALL_OPTIONS=	A52 ASPELL BFD BZIP2 CAIRO CHM DBUS DTS FASTCGI FCL-ASYNC FCL-BASE \
 		FCL-DB FCL-FPCUNIT FCL-IMAGE FCL-JSON FCL-NET FCL-PASSRC FCL-PROCESS \
--- fpc-units.diff ends here ---

--- mico.diff begins here ---
Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/devel/mico/Makefile,v
retrieving revision 1.104
diff -u -u -r1.104 Makefile
--- Makefile	23 Sep 2011 22:22:09 -0000	1.104
+++ Makefile	22 Nov 2011 14:34:32 -0000
@@ -32,17 +32,7 @@
 		GTK "Build with GTK support" off \
 		DEBUG "Build debug version" off
 
-# need for OPTIONS work
-PORT_DBDIR?=	/var/db/ports
-
-OPTIONSFILE?=	${PORT_DBDIR}/${PORTNAME}/options
-.if exists(${OPTIONSFILE}) && !make(rmconfig)
-.include "${OPTIONSFILE}"
-.endif
-.if exists(${OPTIONSFILE}.local)
-.include "${OPTIONSFILE}.local"
-.endif
-# ================
+.include <bsd.port.options.mk>
 
 NOT_FOR_ARCHS=		sparc64
 
--- mico.diff ends here ---

--- nedi.diff begins here ---
Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/net-mgmt/nedi/Makefile,v
retrieving revision 1.6
diff -u -u -r1.6 Makefile
--- Makefile	22 Aug 2009 00:32:01 -0000	1.6
+++ Makefile	22 Nov 2011 14:39:30 -0000
@@ -24,19 +24,11 @@
 NO_BUILD=	yes
 USE_PERL5=	yes
 
-# The options part is copied from databases/phpmyadmin
-# and looks this way, because we have to USE_PHP
-# before pre.mk, however WITH_*, WITHOUT_* are set only
-# after pre.mk. The solution is to set them by ourselves.
 OPTIONS=	GD "Use GD" OFF
 
-PORT_DBDIR?=	/var/db/ports
 LATEST_LINK=	${PORTNAME}${PKGNAMESUFFIX}
-OPTIONSFILE?=	${PORT_DBDIR}/${LATEST_LINK}/options
 
-.if exists(${OPTIONSFILE})
-.include "${OPTIONSFILE}"
-.endif
+.include <bsd.port.options.mk>
 
 USE_PHP=	session snmp mysql
 WANT_PHP_WEB=	yes
--- nedi.diff ends here ---

--- netustad.diff begins here ---
Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/net-mgmt/netustad/Makefile,v
retrieving revision 1.12
diff -u -u -r1.12 Makefile
--- Makefile	31 May 2010 02:00:33 -0000	1.12
+++ Makefile	22 Nov 2011 14:36:17 -0000
@@ -22,13 +22,9 @@
 GNU_CONFIGURE=	yes
 OPTIONS=	SSL "Use netUstad with SSL support" on
 
-PORT_DBDIR?=	/var/db/ports
 LATEST_LINK=	${PORTNAME}${PKGNAMESUFFIX}
-OPTIONSFILE?=	${PORT_DBDIR}/${LATEST_LINK}/options
 
-.if exists(${OPTIONSFILE})
-.include "${OPTIONSFILE}"
-.endif
+.include <bsd.port.options.mk>
 
 .if !defined(WITHOUT_SSL)
 USE_OPENSSL=	yes
--- netustad.diff ends here ---

--- pear-Crypt_RSA.diff begins here ---
Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/security/pear-Crypt_RSA/Makefile,v
retrieving revision 1.7
diff -u -u -r1.7 Makefile
--- Makefile	1 Dec 2009 21:46:49 -0000	1.7
+++ Makefile	22 Nov 2011 14:45:32 -0000
@@ -13,18 +13,14 @@
 COMMENT=	PEAR class allows you to use two-key strong cryptography
 
 BUILD_DEPENDS=	${PEARDIR}/PEAR.php:${PORTSDIR}/devel/pear
-RUN_DEPENDS=	${BUILD_DEPENDS}
+RUN_DEPENDS:=	${BUILD_DEPENDS}
 
 OPTIONS=	BCMATH "PHP BCMath extension support" off \
 		GMP "PHP GMP extension support" off
 
-PORT_DBDIR?=	/var/db/ports
 LATEST_LINK=	pear-${PORTNAME}
-OPTIONSFILE?=	${PORT_DBDIR}/${LATEST_LINK}/options
 
-.if exists(${OPTIONSFILE})
-.include "${OPTIONSFILE}"
-.endif
+.include <bsd.port.options.mk>
 
 .for opt in BCMATH GMP
 .    if defined(WITH_${opt})
--- pear-Crypt_RSA.diff ends here ---

--- php4-extensions.diff begins here ---
Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/lang/php4-extensions/Makefile,v
retrieving revision 1.12
diff -u -u -r1.12 Makefile
--- Makefile	15 Jun 2009 09:21:34 -0000	1.12
+++ Makefile	22 Nov 2011 14:30:11 -0000
@@ -94,13 +94,9 @@
 		ZIP             "ZIP support" off \
 		ZLIB            "ZLIB support" on
 
-PORT_DBDIR?=	/var/db/ports
 LATEST_LINK=	${PORTNAME}${PKGNAMESUFFIX}
-OPTIONSFILE?=	${PORT_DBDIR}/${LATEST_LINK}/options
 
-.if exists(${OPTIONSFILE})
-.include "${OPTIONSFILE}"
-.endif
+.include <bsd.port.options.mk>
 
 ALL_OPTIONS=	BCMATH BZ2 CALENDAR CRACK CTYPE CURL DBA DBASE DBX DIO \
 		DOMXML EXIF FILEINFO FILEPRO FRIBIDI FTP GD GETTEXT \
--- php4-extensions.diff ends here ---

--- php5-extensions.diff begins here ---
Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/lang/php5-extensions/Makefile,v
retrieving revision 1.22
diff -u -u -r1.22 Makefile
--- Makefile	26 Apr 2011 12:05:57 -0000	1.22
+++ Makefile	22 Nov 2011 14:27:03 -0000
@@ -101,13 +101,9 @@
 		ZIP             "ZIP support" off \
 		ZLIB            "ZLIB support" off
 
-PORT_DBDIR?=	/var/db/ports
 LATEST_LINK=	${PORTNAME}${PKGNAMESUFFIX}
-OPTIONSFILE?=	${PORT_DBDIR}/${LATEST_LINK}/options
 
-.if exists(${OPTIONSFILE})
-.include "${OPTIONSFILE}"
-.endif
+.include <bsd.port.options.mk>
 
 ALL_OPTIONS=	BCMATH BZ2 CALENDAR CTYPE CURL DBA \
 		DOM EXIF FILEINFO FILTER FRIBIDI FTP GD GETTEXT \
--- php5-extensions.diff ends here ---

--- php52-extensions.diff begins here ---
Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/lang/php52-extensions/Makefile,v
retrieving revision 1.2
diff -u -u -r1.2 Makefile
--- Makefile	12 Sep 2010 03:44:43 -0000	1.2
+++ Makefile	22 Nov 2011 14:24:07 -0000
@@ -109,13 +109,9 @@
 		ZIP             "ZIP support" off \
 		ZLIB            "ZLIB support" off
 
-PORT_DBDIR?=	/var/db/ports
 LATEST_LINK=	${PORTNAME}${PKGNAMESUFFIX}
-OPTIONSFILE?=	${PORT_DBDIR}/${LATEST_LINK}/options
 
-.if exists(${OPTIONSFILE})
-.include "${OPTIONSFILE}"
-.endif
+.include <bsd.port.options.mk>
 
 ALL_OPTIONS=	BCMATH BZ2 CALENDAR CTYPE CURL DBA DBASE \
 		DOM EXIF FILEINFO FILTER FRIBIDI FTP GD GETTEXT \
--- php52-extensions.diff ends here ---

--- squirrelmail-shared_calendars-plugin.diff begins here ---
Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/mail/squirrelmail-shared_calendars-plugin/Makefile,v
retrieving revision 1.3
diff -u -u -r1.3 Makefile
--- Makefile	12 Apr 2009 15:52:35 -0000	1.3
+++ Makefile	22 Nov 2011 14:42:13 -0000
@@ -47,13 +47,9 @@
 
 OPTIONS=	SQL	 "use SQL backend" off
 
-PORT_DBDIR?=	/var/db/ports
 LATEST_LINK=	${PORTNAME}${PKGNAMESUFFIX}
-OPTIONSFILE?=	${PORT_DBDIR}/${LATEST_LINK}/options
 
-.if exists(${OPTIONSFILE})
-.include "${OPTIONSFILE}"
-.endif
+.include <bsd.port.options.mk>
 
 .if !defined(WITHOUT_SQL) || defined(WITH_SQL)
 RUN_DEPENDS+=		${SQUIRRELDIR}/plugins/calendar_sql_backend:${PORTSDIR}/mail/squirrelmail-calendar_sql_backend-plugin
--- squirrelmail-shared_calendars-plugin.diff ends here ---


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->wxs 
Responsible-Changed-By: wxs 
Responsible-Changed-When: Tue Nov 22 15:48:14 UTC 2011 
Responsible-Changed-Why:  
I'll take it. 

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

Date: Wed, 23 Nov 2011 10:22:39 +0100
From: Alex Dupre <ale@FreeBSD.org>
To: Matthew Seaman <m.seaman@infracaninophile.co.uk>
Subject: Re: [patch] Remove some redundancy in OPTIONS handling

 Matthew Seaman ha scritto:
 > As discussed in the thread starting with this message:
 >
 > http://lists.freebsd.org/pipermail/freebsd-ports/2011-November/071511.html
 >
 > a number of ports are redefining PORT_DBDIR already defined with the
 > same value in bsd.port.mk
 
 I've just read the thread, but the conclusions are not always correct: 
 once upon a time there wasn't the <bsd.port.options.mk> makefile, so to 
 load the options before including bsd.port.pre.mk you had to do the 
 trick implemented in phpX-extensions. Currently such trick is not 
 needed, so it's correct to remove it (I'm testing the patch).
 
 > there's a lot of ports that essentially set
 > LATEST_LINK to ${PKGNAMEPREFIX}${PORTNAME}${PKGNAMESUFFIX} -- and that
 > is actually the default value already.
 
 Not exaclty. As before, the setting order is important. Look at the 
 following code in bsd.port.mk:
 
 .if defined(LATEST_LINK)
 UNIQUENAME?=    ${LATEST_LINK}
 .else
 UNIQUENAME?=    ${PKGNAMEPREFIX}${PORTNAME}
 .endif
 OPTIONSFILE?=   ${PORT_DBDIR}/${UNIQUENAME}/options
 ...
 PKGBASE?=                       ${PKGNAMEPREFIX}${PORTNAME}${PKGNAMESUFFIX}
 LATEST_LINK?=           ${PKGBASE}
 
 Now it should be clear why LATEST_LINK is redefined.
 
 -- 
 Alex Dupre

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/162754: commit references a PR
Date: Wed, 23 Nov 2011 13:17:45 +0000 (UTC)

 ale         2011-11-23 13:17:31 UTC
 
   FreeBSD ports repository
 
   Modified files:
     lang/php4-extensions Makefile 
     lang/php5-extensions Makefile 
   Log:
   Convert to use bsd.port.options.mk makefile.
   
   PR:             ports/162754
   Submitted by:   Matthew Seaman <m.seaman@infracaninophile.co.uk>
   Feature safe:   yes
   
   Revision  Changes    Path
   1.13      +6 -11     ports/lang/php4-extensions/Makefile
   1.23      +6 -11     ports/lang/php5-extensions/Makefile
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/162754: commit references a PR
Date: Sun, 25 Dec 2011 19:23:13 +0000 (UTC)

 wxs         2011-12-25 19:22:59 UTC
 
   FreeBSD ports repository
 
   Modified files:
     lang/fpc-units       Makefile 
   Log:
   Switch to using bsd.port.options.mk and cleanup unnecessary assignments.
   
   PR:             ports/162754
   Submitted by:   Matthew Seaman <m.seaman@infracaninophile.co.uk>
   Approved by:    acm@ (maintainer timeout)
   
   Revision  Changes    Path
   1.26      +1 -5      ports/lang/fpc-units/Makefile
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/162754: commit references a PR
Date: Sun, 25 Dec 2011 19:25:25 +0000 (UTC)

 wxs         2011-12-25 19:25:13 UTC
 
   FreeBSD ports repository
 
   Modified files:
     devel/mico           Makefile 
   Log:
   Switch to using bsd.port.options.mk and cleanup unnecessary assignments.
   
   PR:             ports/162754
   Submitted by:   Matthew Seaman <m.seaman@infracaninophile.co.uk>
   
   Revision  Changes    Path
   1.105     +1 -11     ports/devel/mico/Makefile
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/162754: commit references a PR
Date: Sun, 25 Dec 2011 19:28:14 +0000 (UTC)

 wxs         2011-12-25 19:28:06 UTC
 
   FreeBSD ports repository
 
   Modified files:
     net-mgmt/nedi        Makefile 
   Log:
   Switch to using bsd.port.options.mk and remove unnecessary assignments.
   
   While here, don't use 'find | xargs rm', when 'find -delete' will do.
   
   PR:             ports/162754
   Submitted by:   Matthew Seaman <m.seaman@infracaninophile.co.uk>
   
   Revision  Changes    Path
   1.7       +2 -10     ports/net-mgmt/nedi/Makefile
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: open->closed 
State-Changed-By: wxs 
State-Changed-When: Sun Dec 25 19:37:19 UTC 2011 
State-Changed-Why:  
All of the patches have been committed. Thanks for your work and sorry 
for the delay! ;) 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/162754: commit references a PR
Date: Sun, 25 Dec 2011 19:30:31 +0000 (UTC)

 wxs         2011-12-25 19:30:17 UTC
 
   FreeBSD ports repository
 
   Modified files:
     net-mgmt/netustad    Makefile 
   Log:
   Switch to using bsd.port.options.mk and remove unnecessary assignments.
   
   PR:             ports/162754
   Submitted by:   Matthew Seaman <m.seaman@infracaninophile.co.uk>
   
   Revision  Changes    Path
   1.13      +1 -5      ports/net-mgmt/netustad/Makefile
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/162754: commit references a PR
Date: Sun, 25 Dec 2011 19:34:52 +0000 (UTC)

 wxs         2011-12-25 19:34:40 UTC
 
   FreeBSD ports repository
 
   Modified files:
     security/pear-Crypt_RSA Makefile 
   Log:
   Switch to using bsd.port.options.mk and remove unnecessary assignments.
   
   While here, be explicit with RUN_DEPENDS (pet pet portlint).
   
   PR:             ports/162754
   Submitted by:   Matthew Seaman <m.seaman@infracaninophile.co.uk>
   Approved by:    miwi@ (maintainer timeout)
   
   Revision  Changes    Path
   1.8       +2 -6      ports/security/pear-Crypt_RSA/Makefile
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/162754: commit references a PR
Date: Sun, 25 Dec 2011 19:36:53 +0000 (UTC)

 wxs         2011-12-25 19:36:46 UTC
 
   FreeBSD ports repository
 
   Modified files:
     mail/squirrelmail-shared_calendars-plugin Makefile 
   Log:
   Switch to using bsd.port.options.mk and remove unnecessary assignments.
   
   PR:             ports/162754
   Submitted by:   Matthew Seaman <m.seaman@infracaninophile.co.uk>
   
   Revision  Changes    Path
   1.4       +1 -5      ports/mail/squirrelmail-shared_calendars-plugin/Makefile
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
