One thing has annoyed me for years, and that is the ports tree refusing me to configure and download newer versions of PHP and PostgreSQL while an older one is installed.

Here’s a couple of unpolished patches that allows me to configure and download the next version of PHP and PostgreSQL.

diff --git a/Mk/Uses/php.mk b/Mk/Uses/php.mk
index 38dfccedc1a2..c5ae2d466a09 100644
--- a/Mk/Uses/php.mk
+++ b/Mk/Uses/php.mk
@@ -122,9 +122,11 @@ _INSTALLED_PHP_VER:=	${PHP_VER}
 # If we have an installed version of PHP, and this does not support it, set
 # IGNORE to fail early as you cannot install two different versions of PHP at
 # the same time anyway.
+.if !${.TARGETS:Mconfig} && !${.TARGETS:Mconfig-*} && !${.TARGETS:Mfetch*}
 .    if defined(IGNORE_WITH_PHP) && ${IGNORE_WITH_PHP:M${_INSTALLED_PHP_VER}}
 IGNORE=	does not work with PHP versions "${IGNORE_WITH_PHP}" and "${_INSTALLED_PHP_VER}" is installed.
 .    endif
+.endif
 
 .  else
 PHP_VER?=	${PHP_DEFAULT:S/.//}
@@ -226,6 +228,7 @@ PHP_PKGNAMEPREFIX=	php${PHP_VER}-
 PHP_PKGNAMESUFFIX=	-php${PHP_VER}
 PECL_PKGNAMEPREFIX=	php${PHP_VER}-pecl-
 
+.if !${.TARGETS:Mconfig} && !${.TARGETS:Mconfig-*} && !${.TARGETS:Mfetch*}
 .  if defined(IGNORE_WITH_PHP)
 .    for VER in ${IGNORE_WITH_PHP}
 .      if ${PHP_VER} == "${VER}"
@@ -235,6 +238,7 @@ IGNORE=		cannot be installed: doesn't work with lang/php${PHP_VER} port\
 .      endif
 .    endfor
 .  endif
+.endif
 
 .  if ${php_ARGS:Mweb}
 .    if ${php_ARGS:Mcgi} || ${php_ARGS:Mmod}
diff --git a/Mk/Uses/pgsql.mk b/Mk/Uses/pgsql.mk
index dc245d4f3cda..dc38b3f4c0bb 100644
--- a/Mk/Uses/pgsql.mk
+++ b/Mk/Uses/pgsql.mk
@@ -117,9 +117,11 @@ PGSQL_VER=	${_PGSQL_VER}
 .        endif
 .      endfor
 .    endif
+.if !${.TARGETS:Mconfig} && !${.TARGETS:Mconfig-*} && !${.TARGETS:Mfetch*}
 .    if defined(_PGSQL_VER) && ${_PGSQL_VER} != ${PGSQL_VER}
 IGNORE?=	cannot install: the port wants postgresql-client version ${_WANT_PGSQL_VER} and you have version ${_PGSQL_VER} installed
 .    endif
+.endif
 .  endif
 
 # OK, so the port is ambivalent, we'll just take what's on the system.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>