Skip site navigation (1)Skip section navigation (2)
Date:      Wed,  2 Feb 2005 03:40:14 +0100 (CET)
From:      Palle Girgensohn <girgen@FreeBSD.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/76988: WANT_PGSQL_VER ignored when postgresql version already installed
Message-ID:  <20050202024014.54B5E1CC22@palle.girgensohn.se>
Resent-Message-ID: <200502020250.j122o5NP060160@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         76988
>Category:       ports
>Synopsis:       WANT_PGSQL_VER ignored when postgresql version already installed
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Feb 02 02:50:05 GMT 2005
>Closed-Date:
>Last-Modified:
>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:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050202024014.54B5E1CC22>