From girgen@palle.girgensohn.se  Wed Feb  2 02:40:16 2005
Return-Path: <girgen@palle.girgensohn.se>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id A7A7716A4D0
	for <FreeBSD-gnats-submit@freebsd.org>; Wed,  2 Feb 2005 02:40:16 +0000 (GMT)
Received: from palle.girgensohn.se (1-2-8-5a.asp.sth.bostream.se [82.182.157.66])
	by mx1.FreeBSD.org (Postfix) with ESMTP id CB62243D53
	for <FreeBSD-gnats-submit@freebsd.org>; Wed,  2 Feb 2005 02:40:15 +0000 (GMT)
	(envelope-from girgen@palle.girgensohn.se)
Received: from localhost (localhost.girgensohn.se [127.0.0.1])
	by palle.girgensohn.se (Postfix) with ESMTP id 91C201CC27
	for <FreeBSD-gnats-submit@freebsd.org>; Wed,  2 Feb 2005 03:40:14 +0100 (CET)
Received: from palle.girgensohn.se ([127.0.0.1])
 by localhost (palle.girgensohn.se [127.0.0.1]) (amavisd-new, port 10024)
 with LMTP id 58616-03 for <FreeBSD-gnats-submit@freebsd.org>;
 Wed,  2 Feb 2005 03:40:14 +0100 (CET)
Received: by palle.girgensohn.se (Postfix, from userid 1000)
	id 54B5E1CC22; Wed,  2 Feb 2005 03:40:14 +0100 (CET)
Message-Id: <20050202024014.54B5E1CC22@palle.girgensohn.se>
Date: Wed,  2 Feb 2005 03:40:14 +0100 (CET)
From: Palle Girgensohn <girgen@FreeBSD.org>
Reply-To: Palle Girgensohn <girgen@FreeBSD.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: WANT_PGSQL_VER ignored when postgresql version already installed
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         76988
>Category:       ports
>Synopsis:       WANT_PGSQL_VER ignored when postgresql version already installed
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    portmgr
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Feb 02 02:50:05 GMT 2005
>Closed-Date:    Mon Feb 07 11:28:23 GMT 2005
>Last-Modified:  Mon Feb 07 11:28:23 GMT 2005
>Originator:     Palle Girgensohn <girgen@FreeBSD.org>
>Release:        FreeBSD 5.3-RELEASE-p1 i386
>Organization:
Ping Pong AB
>Environment:
System: FreeBSD palle.girgensohn.se 5.3-RELEASE-p1 FreeBSD 5.3-RELEASE-p1 #16: Sat Nov 20 04:26:58 CET 2004 girgen@palle.girgensohn.se:/usr/obj/4/usr/5src/sys/PALLE i386


	
>Description:
WANT_PGSQL_VER is a newly comitted knob in Mk/bsd.ports.mk, intended
for ports that need a certain version of postgresql.

Problem: When a postgresql version is already installed, this knob has
no effect. Hence, wrong version of postgresql may be used, instead of
the port in question failing to build and warn the user about the
problem.

>How-To-Repeat:
	
>Fix:
Index: Mk/bsd.port.mk
===================================================================
RCS file: /home/ncvs/ports/Mk/bsd.port.mk,v
retrieving revision 1.506
diff -u -r1.506 bsd.port.mk
--- Mk/bsd.port.mk	31 Jan 2005 00:35:38 -0000	1.506
+++ Mk/bsd.port.mk	2 Feb 2005 01:24:57 -0000
@@ -1708,20 +1708,28 @@
 DEFAULT_PGSQL_VER?=	74
 
 # Setting/finding PostgreSQL version we want.
-.if defined(WANT_PGSQL_VER)
+.if exists(${LOCALBASE}/bin/pg_config)
+_PGSQL_VER!=	${LOCALBASE}/bin/pg_config --version | ${SED} -n 's/PostgreSQL[^0-9]*\([0-9][0-9]*\)\.\([0-9][0-9]*\)\..*/\1\2/p'
+.endif
+
+.if defined(WANT_PGSQL_VER) && defined(_PGSQL_VER) && ${WANT_PGSQL_VER} != ${_PGSQL_VER}
+BROKEN=		The port wants postgresql${WANT_PGSQL_VER}-client but you have postgresql${_PGSQL_VER}-client installed
+.endif
+
+.if defined(_PGSQL_VER)
+PGSQL_VER=	${_PGSQL_VER}
+.elif defined(WANT_PGSQL_VER)
 PGSQL_VER=	${WANT_PGSQL_VER}
-.elif exists(${LOCALBASE}/bin/pg_config)
-PGSQL_VER!=	${LOCALBASE}/bin/pg_config --version | ${SED} -n 's/PostgreSQL[^0-9]*\([0-9][0-9]*\)\.\([0-9][0-9]*\)\..*/\1\2/p'
 .else
 PGSQL_VER=	${DEFAULT_PGSQL_VER}
-.endif # WANT_PGSQL_VER
+.endif
 
 # And now we are checking if we can use it
 .if exists(${PORTSDIR}/databases/postgresql${PGSQL_VER}-client)
 .if defined(BROKEN_WITH_PGSQL)
 .	for VER in ${BROKEN_WITH_PGSQL}
 .		if (${PGSQL_VER} == "${VER}")
-BROKEN=		"Doesn't work with PostgreSQL version : ${PGSQL_VER} (Doesn't support PostgresSQL ${BROKEN_WITH_PGSQL})"
+IGNORE=		"Does not work with postgresql${PGSQL_VER}-client PostgresSQL \(${BROKEN_WITH_PGSQL} not supported\)"
 .		endif
 .	endfor
 .endif # BROKEN_WITH_PGSQL
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->portmgr 
Responsible-Changed-By: girgen 
Responsible-Changed-When: Wed Feb 2 02:51:35 GMT 2005 
Responsible-Changed-Why:  
Mk/bsd.port.mk, over to portmgr for approval 

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

From: Mark Linimon <linimon@lonesome.com>
To: Palle Girgensohn <girgen@FreeBSD.org>
Cc: FreeBSD-gnats-submit@FreeBSD.org,
	<freebsd-ports-bugs@FreeBSD.org>
Subject: Re: ports/76988: WANT_PGSQL_VER ignored when postgresql version
 already installed
Date: Tue, 1 Feb 2005 21:49:29 -0600 (CST)

 I belive both cases of BROKEN should be IGNORE.  The fact that
 there are BROKEN things set by the MySQL knobs is IMHO a bug;
 one that I tried to fix but failed.
 
 I'd like to see the bad usage not propogated, however.
 
 mcl
 
 

From: Palle Girgensohn <girgen@FreeBSD.org>
To: Mark Linimon <linimon@lonesome.com>
Cc: FreeBSD-gnats-submit@FreeBSD.org, freebsd-ports-bugs@FreeBSD.org
Subject: Re: ports/76988: WANT_PGSQL_VER ignored when postgresql version
 already installed
Date: Wed, 02 Feb 2005 10:30:02 +0100

 --On tisdag, februari 01, 2005 21.49.29 -0600 Mark Linimon 
 <linimon@lonesome.com> wrote:
 
 > I belive both cases of BROKEN should be IGNORE.  The fact that
 > there are BROKEN things set by the MySQL knobs is IMHO a bug;
 > one that I tried to fix but failed.
 
 Yeah, I agree.
 
 > I'd like to see the bad usage not propogated, however.
 
 Seems reasonable.
 
 Palle
 
 

From: Palle Girgensohn <girgen@pingpong.net>
To: freebsd-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: ports/76988: WANT_PGSQL_VER ignored when postgresql version
 already installed
Date: Thu, 03 Feb 2005 10:59:43 +0100

 --==========FDE9F5A79733FAC58F91==========
 Content-Type: text/plain; charset=us-ascii; format=flowed
 Content-Transfer-Encoding: 7bit
 Content-Disposition: inline
 
 As suggested by linimon, exchange BROKEN for IGNORE.
 --==========FDE9F5A79733FAC58F91==========
 Content-Type: text/plain; charset=iso-8859-1; name="mk.diff"
 Content-Transfer-Encoding: quoted-printable
 Content-Disposition: attachment; filename="mk.diff"; size=1645
 
 Index: Mk/bsd.port.mk
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
 RCS file: /home/ncvs/ports/Mk/bsd.port.mk,v
 retrieving revision 1.507
 diff -u -r1.507 bsd.port.mk
 --- Mk/bsd.port.mk	2 Feb 2005 09:34:04 -0000	1.507
 +++ Mk/bsd.port.mk	3 Feb 2005 09:57:53 -0000
 @@ -1708,20 +1708,28 @@
  DEFAULT_PGSQL_VER?=3D	74
 =20
  # Setting/finding PostgreSQL version we want.
 -.if defined(WANT_PGSQL_VER)
 +.if exists(${LOCALBASE}/bin/pg_config)
 +_PGSQL_VER!=3D	${LOCALBASE}/bin/pg_config --version | ${SED} -n =
 's/PostgreSQL[^0-9]*\([0-9][0-9]*\)\.\([0-9][0-9]*\)\..*/\1\2/p'
 +.endif
 +
 +.if defined(WANT_PGSQL_VER) && defined(_PGSQL_VER) && ${WANT_PGSQL_VER} =
 !=3D ${_PGSQL_VER}
 +IGNORE=3D		"The port wants postgresql${WANT_PGSQL_VER}-client but you have =
 postgresql${_PGSQL_VER}-client installed"
 +.endif
 +
 +.if defined(_PGSQL_VER)
 +PGSQL_VER=3D	${_PGSQL_VER}
 +.elif defined(WANT_PGSQL_VER)
  PGSQL_VER=3D	${WANT_PGSQL_VER}
 -.elif exists(${LOCALBASE}/bin/pg_config)
 -PGSQL_VER!=3D	${LOCALBASE}/bin/pg_config --version | ${SED} -n =
 's/PostgreSQL[^0-9]*\([0-9][0-9]*\)\.\([0-9][0-9]*\)\..*/\1\2/p'
  .else
  PGSQL_VER=3D	${DEFAULT_PGSQL_VER}
 -.endif # WANT_PGSQL_VER
 +.endif
 =20
  # And now we are checking if we can use it
  .if exists(${PORTSDIR}/databases/postgresql${PGSQL_VER}-client)
  .if defined(BROKEN_WITH_PGSQL)
  .	for VER in ${BROKEN_WITH_PGSQL}
  .		if (${PGSQL_VER} =3D=3D "${VER}")
 -BROKEN=3D		"Doesn't work with PostgreSQL version : ${PGSQL_VER} (Doesn't =
 support PostgresSQL ${BROKEN_WITH_PGSQL})"
 +IGNORE=3D		"Does not work with postgresql${PGSQL_VER}-client PostgresSQL =
 \(${BROKEN_WITH_PGSQL} not supported\)"
  .		endif
  .	endfor
  .endif # BROKEN_WITH_PGSQL
 
 --==========FDE9F5A79733FAC58F91==========--
 

From: Palle Girgensohn <girgen@pingpong.net>
To: freebsd-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: ports/76988: WANT_PGSQL_VER ignored when postgresql version
 already installed
Date: Thu, 03 Feb 2005 11:06:50 +0100

 if the latest patch got mangled, there's a copy on freefall: 
 <http://people.freebsd.org/~girgen/mk.diff>
State-Changed-From-To: open->closed 
State-Changed-By: krion 
State-Changed-When: Mon Feb 7 11:28:17 GMT 2005 
State-Changed-Why:  
Committed, thanks! 

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