From eikemeier@fillmore-labs.com  Thu Oct  2 06:43:20 2003
Return-Path: <eikemeier@fillmore-labs.com>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 5980316A4B3
	for <FreeBSD-gnats-submit@FreeBSD.org>; Thu,  2 Oct 2003 06:43:20 -0700 (PDT)
Received: from mx2.fillmore-labs.com (lima.fillmore-labs.com [62.138.193.83])
	by mx1.FreeBSD.org (Postfix) with ESMTP id C657143FF3
	for <FreeBSD-gnats-submit@FreeBSD.org>; Thu,  2 Oct 2003 06:43:18 -0700 (PDT)
	(envelope-from eikemeier@fillmore-labs.com)
Received: from pd958a54a.dip.t-dialin.net
	([217.88.165.74] helo=fillmore-labs.com ident=s5yqundonkqfr44q)
	by mx2.fillmore-labs.com with asmtp (TLSv1:AES256-SHA:256)
	(Exim 4.24; FreeBSD 4.9)
	id 1A53jh-0004tg-7D
	for FreeBSD-gnats-submit@FreeBSD.org; Thu, 02 Oct 2003 15:43:17 +0200
Message-Id: <3F7C2B72.6080407@fillmore-labs.com>
Date: Thu, 02 Oct 2003 15:43:14 +0200
From: Oliver Eikemeier <eikemeier@fillmore-labs.com>
To: FreeBSD-gnats-submit@FreeBSD.org
Subject: [PATCH] bsd.port.mk: check for USE_* used to late

>Number:         57496
>Category:       ports
>Synopsis:       [PATCH] bsd.port.mk: check for USE_* used to late
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    portmgr
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Thu Oct 02 06:50:15 PDT 2003
>Closed-Date:    Sun Nov 09 09:47:48 PST 2003
>Last-Modified:  Sun Nov 09 09:47:48 PST 2003
>Originator:     Oliver Eikemeier
>Release:        FreeBSD 4.8-STABLE i386
>Organization:
Fillmore Labs - http://www.fillmore-labs.com
>Environment:
System: FreeBSD nuuk.fillmore-labs.com 4.8-STABLE

>Description:

Multiple ports are having problems with defining USE_OPENLDAP or USE_OPENSSL
after they included bsd.port.pre.mk, which results in that that directive
being ignored. This patch checks if a USE_* variable is defined too late, and
if it is the port is marked as broken.

More bugs are fixed in PR 56600, and PR 56960 is an improvement, too...

>How-To-Repeat:

The latest one is PR 57491, there are a lot of others. This patch is expected
to break some ports ;-)

>Fix:

--- bsd.port.mk.patch begins here ---
--- bsd.port.mk.orig	3 Sep 2003 19:50:24 -0000
+++ bsd.port.mk	2 Oct 2003 13:41:10 -0000
@@ -988,6 +988,10 @@
 SCRIPTDIR?=		${MASTERDIR}/scripts
 PKGDIR?=		${MASTERDIR}
 
+_PRE_MAKE_DEFINES=	EMACS_PORT_NAME USE_GNUSTEP USE_IMAKE USE_JAVA USE_KDEBASE_VER USE_KDELIBS_VER \
+			USE_LIBRUBY USE_LINUX_PREFIX USE_OPENLDAP USE_OPENLDAP_VER USE_OPENSSL \
+			USE_PYTHON USE_QT USE_QT2 USE_QT_VER USE_RUBY USE_X_PREFIX
+
 .if defined(USE_IMAKE) && !defined(USE_X_PREFIX)
 USE_X_PREFIX=	yes
 .endif
@@ -1082,6 +1086,12 @@
 # Location of mounted CDROM(s) to search for files
 CD_MOUNTPTS?=	/cdrom ${CD_MOUNTPT}
 
+.for var in ${_PRE_MAKE_DEFINES}
+.ifndef ${var}
+_PRE_MAKE_UNDEFINED+=	${var}
+.endif
+.endfor
+
 .endif
 # End of pre-makefile section.
 
@@ -1095,6 +1105,12 @@
 .endif
 
 _POSTMKINCLUDED=	yes
+
+.for var in ${_PRE_MAKE_UNDEFINED}
+.ifdef ${var}
+BROKEN=			"${var} defined after including bsd.port.pre.mk"
+.endif
+.endfor
 
 WRKDIR?=		${WRKDIRPREFIX}${.CURDIR}/work
 .if defined(NO_WRKSUBDIR)
--- bsd.port.mk.patch ends here ---

bsd.gnome.mk (no patch provided) should include

_PRE_MAKE_DEFINES+=	USE_GNOME USE_GTK

they belong there because this is the place where they are tested.



>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->portmgr  
Responsible-Changed-By: krion 
Responsible-Changed-When: Thu Oct 2 06:52:55 PDT 2003 
Responsible-Changed-Why:  
Over to maintainer 

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

From: Oliver Eikemeier <eikemeier@fillmore-labs.com>
To: FreeBSD-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: ports/57496: [PATCH] bsd.port.mk: check for USE_* used to late
Date: Thu, 02 Oct 2003 15:57:24 +0200

 Oliver Eikemeier wrote:
 >>How-To-Repeat:
 > 
 > The latest one is PR 57491, ...
 
 Not true, the latest is the PR before this one: PR 57495 ;-)
 

From: Oliver Eikemeier <eikemeier@fillmore-labs.com>
To: freebsd-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: ports/57496: [PATCH] bsd.port.mk: check for USE_* used to late
Date: Thu, 02 Oct 2003 19:06:55 +0200

 a (not complete) list of ports that will be broken is in PR 57502
 
 

From: Joe Marcus Clarke <marcus@marcuscom.com>
To: freebsd-gnats-submit@FreeBSD.org, eikemeier@fillmore-labs.com
Cc:  
Subject: Re: ports/57496: [PATCH] bsd.port.mk: check for USE_* used to late
Date: Thu, 02 Oct 2003 15:15:29 -0400

 --=-gkf/6IeWg7N8MBNsjDtE
 Content-Type: text/plain
 Content-Transfer-Encoding: quoted-printable
 
 I'm not sure I completely understand the reasoning behind this.  First
 of all, if I take libgda2, for example, and set WITH_LDAP, the port
 works as expected even with USE_OPENLDAP after bsd.port.pre.mk.  Also,
 the GNOME infrasturcture checks USE_GNOME before and after
 bsd.port.pre.mk.  Why would I want to handicap that?
 
 Joe
 
 --=20
 PGP Key : http://www.marcuscom.com/pgp.asc
 
 
 
 --=-gkf/6IeWg7N8MBNsjDtE
 Content-Type: application/pgp-signature; name=signature.asc
 Content-Description: This is a digitally signed message part
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.2.3 (FreeBSD)
 
 iD8DBQA/fHlRb2iPiv4Uz4cRAlVrAKCj9tL6i0BT1EDYkPgjU1IKYJnyggCfYigS
 +vQtZDEs+wIcZ7p+A/0/eIc=
 =qKzO
 -----END PGP SIGNATURE-----
 
 --=-gkf/6IeWg7N8MBNsjDtE--
 

From: Oliver Eikemeier <eikemeier@fillmore-labs.com>
To: Joe Marcus Clarke <marcus@marcuscom.com>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: ports/57496: [PATCH] bsd.port.mk: check for USE_* used to late
Date: Thu, 02 Oct 2003 21:35:50 +0200

 Joe Marcus Clarke wrote:
 
 > I'm not sure I completely understand the reasoning behind this.  First
 > of all, if I take libgda2, for example, and set WITH_LDAP, the port
 > works as expected even with USE_OPENLDAP after bsd.port.pre.mk.
 
 Do you get the right dependencies? Try:
   make WITH_LDAP=yes -VLIB_DEPENDS
 or try to build libgda2 on a machine without libldap installed.
 
 > Also,
 > the GNOME infrasturcture checks USE_GNOME before and after
 > bsd.port.pre.mk.  Why would I want to handicap that?
 
 Sorry, I didn't check thoroughly. I haven't seen that bsd.gnome.mk was
 included twice and the part that checked for USE_GNOME was in the
 _POSTMKINCLUDED section. It checks only after bsd.port.pre.mk, so my
 comment about bsd.gnome.mk does not apply.
 
 Everthing else should be correct, though. I suppose PR 57504 is the next
 on the list :(
 
 

From: Joe Marcus Clarke <marcus@marcuscom.com>
To: Oliver Eikemeier <eikemeier@fillmore-labs.com>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: ports/57496: [PATCH] bsd.port.mk: check for USE_* used to late
Date: Thu, 02 Oct 2003 15:40:48 -0400

 --=-DaXsp7I09+SOU2vJAgsY
 Content-Type: text/plain
 Content-Transfer-Encoding: quoted-printable
 
 On Thu, 2003-10-02 at 15:35, Oliver Eikemeier wrote:
 > Joe Marcus Clarke wrote:
 >=20
 > > I'm not sure I completely understand the reasoning behind this.  First
 > > of all, if I take libgda2, for example, and set WITH_LDAP, the port
 > > works as expected even with USE_OPENLDAP after bsd.port.pre.mk.
 >=20
 > Do you get the right dependencies? Try:
 >   make WITH_LDAP=3Dyes -VLIB_DEPENDS
 > or try to build libgda2 on a machine without libldap installed.
 
 It looks okay to me:
 
 popt.0:/d/home/marcus/src/ports/devel/popt
 ldap.2:/d/home/marcus/src/ports/net/openldap20-client
 X11.6:/d/home/marcus/src/ports/x11/XFree86-4-libraries   =20
 glib-2.0.200:/d/home/marcus/src/ports/devel/glib20
 xml2.5:/d/home/marcus/src/ports/textproc/libxml2
 xslt.1:/d/home/marcus/src/ports/textproc/libxslt
 
 This is on freefall where I know OpenLDAP is not installed.
 
 It seems to me limiting this macros to PRE severely limits
 functionality.  I like to be able to do things like I do in libgda2 in
 order to detect components, and activate subsystems as necessary.
 
 Joe
 
 >=20
 > > Also,
 > > the GNOME infrasturcture checks USE_GNOME before and after
 > > bsd.port.pre.mk.  Why would I want to handicap that?
 >=20
 > Sorry, I didn't check thoroughly. I haven't seen that bsd.gnome.mk was
 > included twice and the part that checked for USE_GNOME was in the
 > _POSTMKINCLUDED section. It checks only after bsd.port.pre.mk, so my
 > comment about bsd.gnome.mk does not apply.
 >=20
 > Everthing else should be correct, though. I suppose PR 57504 is the next
 > on the list :(
 >=20
 --=20
 PGP Key : http://www.marcuscom.com/pgp.asc
 
 
 
 --=-DaXsp7I09+SOU2vJAgsY
 Content-Type: application/pgp-signature; name=signature.asc
 Content-Description: This is a digitally signed message part
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.2.3 (FreeBSD)
 
 iD8DBQA/fH9Ab2iPiv4Uz4cRAum/AKCFmTUIf1d8VwIRdGaZY+Nl2ZtAogCfb0Ns
 QNEcEUVVDJSDqac/y93U9qQ=
 =sM9x
 -----END PGP SIGNATURE-----
 
 --=-DaXsp7I09+SOU2vJAgsY--
 

From: Oliver Eikemeier <eikemeier@fillmore-labs.com>
To: Joe Marcus Clarke <marcus@marcuscom.com>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: ports/57496: [PATCH] bsd.port.mk: check for USE_* used to late
Date: Fri, 03 Oct 2003 01:16:00 +0200

 Joe Marcus Clarke wrote:
 
 > On Thu, 2003-10-02 at 15:35, Oliver Eikemeier wrote:
 > 
 >>Joe Marcus Clarke wrote:
 >>
 >>
 >>>I'm not sure I completely understand the reasoning behind this.  First
 >>>of all, if I take libgda2, for example, and set WITH_LDAP, the port
 >>>works as expected even with USE_OPENLDAP after bsd.port.pre.mk.
 >>
 >>Do you get the right dependencies? Try:
 >>  make WITH_LDAP=yes -VLIB_DEPENDS
 >>or try to build libgda2 on a machine without libldap installed.
 > 
 > It looks okay to me:
 > 
 > popt.0:/d/home/marcus/src/ports/devel/popt
 > ldap.2:/d/home/marcus/src/ports/net/openldap20-client
 > X11.6:/d/home/marcus/src/ports/x11/XFree86-4-libraries    
 > glib-2.0.200:/d/home/marcus/src/ports/devel/glib20
 > xml2.5:/d/home/marcus/src/ports/textproc/libxml2
 > xslt.1:/d/home/marcus/src/ports/textproc/libxslt
 > 
 > This is on freefall where I know OpenLDAP is not installed.
 
 I get
 # cd /usr/ports/databases/libgda2
 # make WITH_LDAP=yes
 
 [...]
 
 Configuration summary
   Installation prefix = /usr/X11R6
   Providers
      XML = yes
      [...]
      LDAP = no
 
 [...]
 
 # ldd /usr/X11R6/lib/libgda-2.so.2
 /usr/X11R6/lib/libgda-2.so.2:
         libgobject-2.0.so.200 => /usr/local/lib/libgobject-2.0.so.200 (0x28185000)
         libgthread-2.0.so.200 => /usr/local/lib/libgthread-2.0.so.200 (0x281b8000)
         libc_r.so.5 => /usr/lib/libc_r.so.5 (0x281bd000)
         libgmodule-2.0.so.200 => /usr/local/lib/libgmodule-2.0.so.200 (0x281e1000)
         libglib-2.0.so.200 => /usr/local/lib/libglib-2.0.so.200 (0x281e5000)
         libxslt.so.1 => /usr/local/lib/libxslt.so.1 (0x2824d000)
         libxml2.so.5 => /usr/local/lib/libxml2.so.5 (0x28279000)
         libz.so.2 => /lib/libz.so.2 (0x2836a000)
         libiconv.so.3 => /usr/local/lib/libiconv.so.3 (0x28378000)
         libm.so.2 => /lib/libm.so.2 (0x28466000)
         libgdasql.so.0 => /usr/X11R6/lib/libgdasql.so.0 (0x2847f000)
         libintl.so.5 => /usr/local/lib/libintl.so.5 (0x28489000)
 
 # pkg_info -g libgda2-1.0.0
 Information for libgda2-1.0.0:
 
 Mismatched Checksums:
 pkg_info: /usr/X11R6/lib/libgda/providers/libgda-ldap.so doesn't exist
 
 in a recent -CURRENT jail
 
 > It seems to me limiting this macros to PRE severely limits
 > functionality.  I like to be able to do things like I do in libgda2 in
 > order to detect components, and activate subsystems as necessary.
 
 I more or less agree to this, but this isn't the way things currently work.
 I just try to make configuration errors visible, and still state that if
 USE_OPENLDAP is used after including bsd.port.pre.mk it will be silently
 ignored. More often than not, things will still work for various reasons,
 but this is just pure luck. Please try building libgda2 on a clean machine.
 
 Regards
     Oliver
 
 

From: Oliver Eikemeier <eikemeier@fillmore-labs.com>
To: Joe Marcus Clarke <marcus@marcuscom.com>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: ports/57496: [PATCH] bsd.port.mk: check for USE_* used to late
Date: Fri, 03 Oct 2003 03:08:08 +0200

 Oliver Eikemeier wrote:
 
 > Joe Marcus Clarke wrote:
 > 
 >> It seems to me limiting this macros to PRE severely limits
 >> functionality.  I like to be able to do things like I do in libgda2 in
 >> order to detect components, and activate subsystems as necessary.
 > 
 > I more or less agree to this, but this isn't the way things currently work.
 
 Ok, thinking a little more about this I understand what the different
 points of view are.
 
 My point was that currently the USE_* variables are used in a way that does
 not work (even though this isn't documented anywhere), and now especially
 with USE_OPENLDAP and USE_OPENSSL bug reports come trickling in that are
 hard to track, so I wanted to make them more visible.
 
 You point, as I understand it, is that this may be, but it's not the ports
 that show errant behaviour, it is bsd.port.pre.mk. Is this assumption
 correct?
 
 Perhaps we should discuss off-PR what the best patch for bsd.port.mk can be.
 The current solution is driven by the paradigm that you define USE_*
 *before* bsd.port.pre.mk and have some information available *after*
 bsd.port.pre.mk that you can check for or use otherwise. For example
 
 USE_PYTHON=	yes
 .include <bsd.port.pre.mk>
 .if ${PYTHON_REL} < 200
 BROKEN=		"python >= 2.0 required to build"
 .endif
 
 or
 
 EMACS_PORT_NAME=xemacs21
 .include <bsd.port.pre.mk>
 .if exists(${LOCALBASE}/${EMACS_VERSION_SITE_LISPDIR}/w3m/shimbun.el)
 ...
 
 Currently I can only see two applications: version checking and testing
 for files during build time. So probably we should think about what has
 to be available after bsd.port.pre.mk and what hasn't, and then design
 the Makefile so that it doesn't matter *where* USE_* is defined. This is
 surely the better solution. On the other hand we squash existing bugs
 with this patch *now*, because it makes deficiencies of bsd.port.pre.mk
 visible.
 
 Comments?
 
 

From: Joe Marcus Clarke <marcus@marcuscom.com>
To: Oliver Eikemeier <eikemeier@fillmore-labs.com>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: ports/57496: [PATCH] bsd.port.mk: check for USE_* used to late
Date: Thu, 02 Oct 2003 22:18:18 -0400

 --=-xXH93GGYjH4gy7lL5ZQS
 Content-Type: text/plain
 Content-Transfer-Encoding: quoted-printable
 
 On Thu, 2003-10-02 at 21:08, Oliver Eikemeier wrote:
 > Oliver Eikemeier wrote:
 >=20
 > > Joe Marcus Clarke wrote:
 > >=20
 > >> It seems to me limiting this macros to PRE severely limits
 > >> functionality.  I like to be able to do things like I do in libgda2 in
 > >> order to detect components, and activate subsystems as necessary.
 > >=20
 > > I more or less agree to this, but this isn't the way things currently w=
 ork.
 >=20
 > Ok, thinking a little more about this I understand what the different
 > points of view are.
 >=20
 > My point was that currently the USE_* variables are used in a way that do=
 es
 > not work (even though this isn't documented anywhere), and now especially
 > with USE_OPENLDAP and USE_OPENSSL bug reports come trickling in that are
 > hard to track, so I wanted to make them more visible.
 >=20
 > You point, as I understand it, is that this may be, but it's not the port=
 s
 > that show errant behaviour, it is bsd.port.pre.mk. Is this assumption
 > correct?
 >=20
 > Perhaps we should discuss off-PR what the best patch for bsd.port.mk can =
 be.
 > The current solution is driven by the paradigm that you define USE_*
 > *before* bsd.port.pre.mk and have some information available *after*
 > bsd.port.pre.mk that you can check for or use otherwise. For example
 >=20
 > USE_PYTHON=3D	yes
 > .include <bsd.port.pre.mk>
 > .if ${PYTHON_REL} < 200
 > BROKEN=3D		"python >=3D 2.0 required to build"
 > .endif
 >=20
 > or
 >=20
 > EMACS_PORT_NAME=3Dxemacs21
 > .include <bsd.port.pre.mk>
 > .if exists(${LOCALBASE}/${EMACS_VERSION_SITE_LISPDIR}/w3m/shimbun.el)
 > ...
 >=20
 > Currently I can only see two applications: version checking and testing
 > for files during build time. So probably we should think about what has
 > to be available after bsd.port.pre.mk and what hasn't, and then design
 > the Makefile so that it doesn't matter *where* USE_* is defined. This is
 > surely the better solution. On the other hand we squash existing bugs
 > with this patch *now*, because it makes deficiencies of bsd.port.pre.mk
 > visible.
 >=20
 > Comments?
 
 I guess what I'm after is more WANT_* functionality.  Take a look at the
 way GNOME does it.  You can add static components to the USE_GNOME macro
 before PRE, then set WANT_GNOME if you want to test for additional
 components.  Then, after PRE, you do the test, and append to USE_GNOME
 as needed.
 
 Perhaps we need to implement a WANT_OPENSSL, WANT_OPENLDAP, etc.
 
 Joe
 
 >=20
 --=20
 PGP Key : http://www.marcuscom.com/pgp.asc
 
 --=-xXH93GGYjH4gy7lL5ZQS
 Content-Type: application/pgp-signature; name=signature.asc
 Content-Description: This is a digitally signed message part
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.2.3 (FreeBSD)
 
 iD8DBQA/fNxqb2iPiv4Uz4cRAqa/AKCHL+Ep8B6rJj/N5hM+i2oF0UbuHQCgntns
 QzQ2cS0Fl2tY+lrXZHWQHUM=
 =QTJ1
 -----END PGP SIGNATURE-----
 
 --=-xXH93GGYjH4gy7lL5ZQS--
 

From: Oliver Eikemeier <eikemeier@fillmore-labs.com>
To: Joe Marcus Clarke <marcus@marcuscom.com>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: ports/57496: [PATCH] bsd.port.mk: check for USE_* used to late
Date: Fri, 03 Oct 2003 04:37:55 +0200

 Joe Marcus Clarke wrote:
 
 > It looks okay to me:
 > 
 > [...]
 > ldap.2:/d/home/marcus/src/ports/net/openldap20-client
 > [...]
 > 
 > This is on freefall where I know OpenLDAP is not installed.
 
 If you just use USE_OPENLDAP=yes you are supposed to get
 OpenLDAP 2.1. Does freefall have a pre-2003/09/25 ports
 tree?
 
 > It seems to me limiting this macros to PRE severely limits
 > functionality.  I like to be able to do things like I do in libgda2 in
 > order to detect components, and activate subsystems as necessary.
 
 As stated above: you are right. This patch does not generate this behaviour,
 it just make it visible (instead of silently ignoring the directive).
 
 > I guess what I'm after is more WANT_* functionality.  Take a look at the
 > way GNOME does it.  You can add static components to the USE_GNOME macro
 > before PRE, then set WANT_GNOME if you want to test for additional
 > components.  Then, after PRE, you do the test, and append to USE_GNOME
 > as needed.
 > 
 > Perhaps we need to implement a WANT_OPENSSL, WANT_OPENLDAP, etc.
 
 That is a good concept, and fits in the project of general option handling
 I'm playing around with. I sure like to discuss this further. On the other
 hand this goes far beyond the scope of this humble PR. We have an errant
 behaviour in bsd.port.pre.mk and either we can try to shift tests after
 PRE, or we can tell the ports: Sorry, it's our fault, but what you are
 trying to do won't work.
 

From: dirk.meyer@dinoex.sub.org (Dirk Meyer)
To: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer)
Cc:  
Subject: Re: ports/57496: [PATCH] bsd.port.mk: check for USE_*
	used to late
Date: Fri, 03 Oct 2003 04:40:18 +0200

 Oliver Eikemeier wrote:
  
 > Multiple ports are having problems with defining USE_OPENLDAP or USE_OPENSSL
 > after they included bsd.port.pre.mk, which results in that that directive
 > being ignored. This patch checks if a USE_* variable is defined too late, and
 > if it is the port is marked as broken.
 
 I would love to see this check in portlint,
 so we won't need to slow down each make.
 But having if for 3 month in the Makefile wont hurt ...
 
 kind regards Dirk
 
 - Dirk Meyer, Im Grund 4, 34317 Habichtswald, Germany
 - [dirk.meyer@dinoex.sub.org],[dirk.meyer@guug.de],[dinoex@FreeBSD.org]

From: Oliver Eikemeier <eikemeier@fillmore-labs.com>
To: Joe Marcus Clarke <marcus@marcuscom.com>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: ports/57496: [PATCH] bsd.port.mk: check for USE_* used to late
Date: Fri, 03 Oct 2003 14:56:29 +0200

 Oliver Eikemeier wrote:
 
 > [...] we can try to shift tests after PRE, [...]
 
 a patch that shifts the test for USE_OPENLDAP after PRE
 is in PR 57529.
 

From: Oliver Eikemeier <eikemeier@fillmore-labs.com>
To: Joe Marcus Clarke <marcus@marcuscom.com>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: ports/57496: [PATCH] bsd.port.mk: check for USE_* used to late
Date: Sat, 08 Nov 2003 16:13:36 +0100

 Plan B, test cases are in PR 57502:
 
 --- portlint-2.4.7.patch ends here ---
 --- devel/portlint/Makefile.orig	1 Nov 2003 22:46:25 -0000
 +++ devel/portlint/Makefile	8 Nov 2003 15:02:37 -0000
 @@ -8,7 +8,7 @@
  #
  
  PORTNAME=	portlint
 -PORTVERSION=	2.4.6
 +PORTVERSION=	2.4.7
  CATEGORIES=	devel
  MASTER_SITES=	# none
  DISTFILES=	# none
 --- devel/portlint/src/portlint.pl.orig	1 Nov 2003 22:46:25 -0000
 +++ devel/portlint/src/portlint.pl	8 Nov 2003 15:02:17 -0000
 @@ -65,6 +65,7 @@
  my $localbase = '/usr/local';
  
  my %lang_pref = qw(
 +	arabic		ar
  	chinese		zh
  	french		fr
  	german		de
 @@ -855,6 +856,39 @@
  		if ($whole =~ /\$\([\w\d]+\)/) {
  			&perror("WARN: use \${VARIABLE}, instead of ".
  				"\$(VARIABLE).");
 +		}
 +	}
 +
 +	#
 +	# whole file: USE_* used too late 
 +	#
 +	pos($whole) = 0;
 +	if ($whole =~ /^\.include\s+<bsd\.port\.pre\.mk>$/gm) {
 +		print "OK: checking for USE_* used too late.\n" if ($verbose);
 +		my @use_early = qw(
 +			APACHE
 +			GNUSTEP
 +			IMAKE
 +			JAVA
 +			KDE(?:BASE|LIBS)_VER
 +			LIBRUBY
 +			LINUX_PREFIX
 +			OPENSSL
 +			PYTHON
 +			QT2?
 +			QT_VER
 +			RUBY
 +			X_PREFIX
 +		);
 +
 +		my @other_early = qw(
 +			EMACS_PORT_NAME
 +		);
 +
 +		my $earlypattern = join('|', 'USE_(?:'.join('|', @use_early).')', @other_early);
 +
 +		while ($whole =~ /^($earlypattern)[+?:!]?=/gmo) {
 +			&perror("FATAL: $1 used after including bsd.port.pre.mk.");
  		}
  	}
  
 --- portlint-2.4.7.patch ends here ---
 
State-Changed-From-To: open->closed 
State-Changed-By: marcus 
State-Changed-When: Sun Nov 9 09:47:27 PST 2003 
State-Changed-Why:  
This has been committed to portlint, and can now be closed. 

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