ports/165874: [PATCH] bsd.database.mk does not honour WITH_PGSQL_VER anymore

Guido Falsi mad at madpilot.net
Fri Mar 9 10:50:07 UTC 2012

>Number:         165874
>Category:       ports
>Synopsis:       [PATCH] bsd.database.mk does not honour WITH_PGSQL_VER anymore
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Mar 09 10:50:06 UTC 2012
>Originator:     Guido Falsi
>Release:        FreeBSD 9.0-STABLE amd64
System: FreeBSD megatron.madpilot.net 9.0-STABLE FreeBSD 9.0-STABLE #3 r232684: Thu Mar 8 11:40:10 CET 2012 root at megatron.madpilot.net:/usr/obj/usr/src/sys/MEGATRON amd64


After the last commit to bsd.databse.mk on march 6th the WITH_PGSQL_VER
variable in make.conf is not being honoured anymore.

The new version of the file is forcing PGSQL_VER == 90, this happens
because the sequence of if-elif-elses always ends up in the fallback

I tested this patch with the ports that were causing me problems,
and seems to fix it without any ill effects, but it needs to be
better reviewed before committing it.


With recent ports tree(Mk/bsd.database.mk version >= 1.67) do:

# cd /usr/ports/databases/libdbi-drivers && make -DWITH_PGSQL_VER=91 -V PGSQL_VER

if more testing is needed performing the build will try to install
postgresql90-client, which is wrong with that variabler defined.


--- Mk/bsd.database.mk.orig	2012-03-09 10:55:59.000000000 +0100
+++ Mk/bsd.database.mk	2012-03-09 11:28:39.000000000 +0100
@@ -204,34 +204,34 @@
 .      endfor
 .    endif
+.  endif
-.    if defined(WITH_PGSQL_VER) && !empty(_WANT_PGSQL_VER)
-.      for version in ${_WANT_PGSQL_VER}
-.        if ${WITH_PGSQL_VER} == ${version} 
+.  if defined(WITH_PGSQL_VER) && !empty(_WANT_PGSQL_VER)
+.    for version in ${_WANT_PGSQL_VER}
+.      if ${WITH_PGSQL_VER} == ${version} 
-.        endif
-.      endfor
+.      endif
+.    endfor
 # Take highest allowed version, but take default if allowed
-.    elif !empty(_WANT_PGSQL_VER)
-.      for ver in ${_WANT_PGSQL_VER}
-.        if ${DEFAULT_PGSQL_VER} == ${ver}
+.  elif !empty(_WANT_PGSQL_VER)
+.    for ver in ${_WANT_PGSQL_VER}
+.      if ${DEFAULT_PGSQL_VER} == ${ver}
 PGSQL_VER=	${ver}
-.        else
+.      else
-.        endif
-.      endfor
+.      endif
+.    endfor
-.    elif defined(WITH_PGSQL_VER)
+.  elif defined(WITH_PGSQL_VER)
 .  endif
-.  else
-.    if defined(_PGSQL_VER)
+.  if defined(_PGSQL_VER)
-.    else
-.    endif
-.  endif # WANT_PGSQL_VER
+.  else
+.  endif
 .      if empty(PGSQL_VER)
 IGNORE?=	cannot install: the port wants postgresql-client version ${WANT_PGSQL_VER} and you have set WITH_PGSQL_VER=${WITH_PGSQL_VER} in make.conf or have postgresql${WITH_PGSQL_VER}-client installed

More information about the freebsd-ports-bugs mailing list