ports/165245: exp-run request: Make postgresql90-client the default
Chris Rees
crees at FreeBSD.org
Fri Feb 17 18:20:13 UTC 2012
>Number: 165245
>Category: ports
>Synopsis: exp-run request: Make postgresql90-client the default
>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: Fri Feb 17 18:20:12 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator: Chris Rees
>Release: FreeBSD 9.0-RELEASE amd64
>Organization:
>Environment:
System: FreeBSD pegasus.bayofrum.net 9.0-RELEASE FreeBSD 9.0-RELEASE #0: Sat Jan 28 15:45:27 GMT 2012 root at pegasus.bayofrum.net:/usr/obj/usr/src/sys/PEGASUS amd64
>Description:
Set default pgsql version to 9.0-- discussed with upstream who suggested that 9.1 isn't quite yet ready.
Add ability to use WANT_PGSQL_VER=90+, 90- etc.
[indented the .if blocks to stop head exploding]
>How-To-Repeat:
>Fix:
--- patch.txt begins here ---
Index: bsd.database.mk
===================================================================
RCS file: /home/pcvs/ports/Mk/bsd.database.mk,v
retrieving revision 1.66
diff -u -r1.66 bsd.database.mk
--- bsd.database.mk 14 Oct 2011 22:30:35 -0000 1.66
+++ bsd.database.mk 17 Feb 2012 18:05:42 -0000
@@ -39,16 +39,14 @@
# If no version is given (by the maintainer via the port or
# by the user via defined variable), try to find the
# currently installed version. Fall back to default if
-# necessary (PostgreSQL-8.4 = 84).
+# necessary (PostgreSQL-9.0 = 90).
# DEFAULT_PGSQL_VER
# - PostgreSQL default version. Can be overridden within a
-# port. Default: 84.
+# port. Default: 90.
# WANT_PGSQL_VER
# - Maintainer can set an arbitrary version of PostgreSQL to
# always build this port with (overrides WITH_PGSQL_VER).
-# IGNORE_WITH_PGSQL
-# - This variable can be defined if the ports does not support
-# one or more versions of PostgreSQL.
+# Minimum and maximum versions can be set (e.g. 90+)
# WITH_PGSQL_VER
# - User defined variable to set PostgreSQL version.
# PGSQL_VER
@@ -173,7 +171,8 @@
.endif # USE_MYSQL
.if defined(USE_PGSQL)
-DEFAULT_PGSQL_VER?= 84
+VALID_PGSQL_VER= 82 83 84 90 91
+DEFAULT_PGSQL_VER?= 90
PGSQL82_LIBVER= 5
PGSQL83_LIBVER= 5
PGSQL84_LIBVER= 5
@@ -181,24 +180,56 @@
PGSQL91_LIBVER= 5
# Setting/finding PostgreSQL version we want.
-.if exists(${LOCALBASE}/bin/pg_config)
+. 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]*\)[^0-9].*/\1\2/p'
-.endif
+. endif
-.if defined(WANT_PGSQL_VER)
-.if defined(WITH_PGSQL_VER) && ${WITH_PGSQL_VER} != ${WANT_PGSQL_VER}
-IGNORE= cannot install: the port wants postgresql${WANT_PGSQL_VER}-client and you try to install postgresql${WITH_PGSQL_VER}-client
-.endif
-PGSQL_VER= ${WANT_PGSQL_VER}
-.elif defined(WITH_PGSQL_VER)
+. if defined(WANT_PGSQL_VER)
+. if ${WANT_PGSQL_VER:M*+}
+. for version in ${VALID_PGSQL_VER}
+. if ${WANT_PGSQL_VER:S/+//} <= ${version}
+_WANT_PGSQL_VER+=${version}
+. endif
+. endfor
+. elif ${WANT_PGSQL_VER:M*-}
+. for version in ${VALID_PGSQL_VER}
+. if ${WANT_PGSQL_VER:S/-//} >= ${version}
+_WANT_PGSQL_VER+=${version}
+. endif
+. endfor
+. endif
+_WANT_PGSQL_VER?= ${WANT_PGSQL_VER}
+
+. if defined(WITH_PGSQL_VER) && !empty(_WANT_PGSQL_VER)
+. for version in ${_WANT_PGSQL_VER}
+. if ${WITH_PGSQL_VER} == ${version}
PGSQL_VER= ${WITH_PGSQL_VER}
-.else
-.if defined(_PGSQL_VER)
+. endif
+. endfor
+
+. if !defined(PGSQL_VER)
+IGNORE= cannot install: the port wants postgresql-client version ${WANT_PGSQL_VER} and you have set postgresql${WITH_PGSQL_VER}-client in make.conf
+. endif
+
+# Take lowest allowed version, but take default if allowed
+. elif !empty(_WANT_PGSQL_VER)
+. for ver in ${_WANT_PGSQL_VER}
+. if ${DEFAULT_PGSQL_VER} == ${ver}
+PGSQL_VER= ${ver}
+. else
+PGSQL_VER?= ${ver}
+. endif
+. endfor
+. elif defined(WITH_PGSQL_VER)
+PGSQL_VER= ${WITH_PGSQL_VER}
+. endif
+. else
+. if defined(_PGSQL_VER)
PGSQL_VER= ${_PGSQL_VER}
-.else
+. else
PGSQL_VER= ${DEFAULT_PGSQL_VER}
-.endif
-.endif # WANT_PGSQL_VER
+. endif
+. endif # WANT_PGSQL_VER
.if defined(_PGSQL_VER) && ${PGSQL_VER} != ${_PGSQL_VER}
IGNORE= cannot install: the port wants postgresql${PGSQL_VER}-client but you have postgresql${_PGSQL_VER}-client installed
@@ -206,10 +237,6 @@
# And now we are checking if we can use it
.if defined(PGSQL${PGSQL_VER}_LIBVER)
-# compatibility shim
-.if defined(BROKEN_WITH_PGSQL)
-IGNORE_WITH_PGSQL=${BROKEN_WITH_PGSQL}
-.endif
.if defined(IGNORE_WITH_PGSQL)
. for VER in ${IGNORE_WITH_PGSQL}
. if (${PGSQL_VER} == "${VER}")
--- patch.txt ends here ---
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list