aboutsummaryrefslogtreecommitdiffstats
path: root/Mk
diff options
context:
space:
mode:
authorcrees <crees@FreeBSD.org>2019-01-16 05:50:54 +0800
committercrees <crees@FreeBSD.org>2019-01-16 05:50:54 +0800
commit17205140684f816c3c32232fa70d01c891012774 (patch)
tree2ec401aa955141d913a825bb3c76594423cb282b /Mk
parent297139e230594b709157546b5c70752d212e0b4c (diff)
downloadfreebsd-ports-gnome-17205140684f816c3c32232fa70d01c891012774.tar.gz
freebsd-ports-gnome-17205140684f816c3c32232fa70d01c891012774.tar.zst
freebsd-ports-gnome-17205140684f816c3c32232fa70d01c891012774.zip
Add facility to give a range of allowable versions for postgresql
PR: ports/213038 PR: ports/234813 Submitted by: lbartoletti@tuxfamily.org Differential Revision: https://reviews.freebsd.org/D18818
Diffstat (limited to 'Mk')
-rw-r--r--Mk/Uses/pgsql.mk23
1 files changed, 21 insertions, 2 deletions
diff --git a/Mk/Uses/pgsql.mk b/Mk/Uses/pgsql.mk
index c920fffbe938..ee2f668259b8 100644
--- a/Mk/Uses/pgsql.mk
+++ b/Mk/Uses/pgsql.mk
@@ -5,8 +5,16 @@
# Feature: pgsql
# Usage: USES= pgsql[:version]
#
-# Maintainer can set version required. Minimum and maximum
-# versions can be specified; e.g. 9.0-, 9.2+
+# version Maintainer can set versions required. You can set this to
+# [min]-[max] or min+ or -max or as an explicit version
+# (eg. 9.3-9.6 for [min]-[max], 9.5+ or 9.6-
+# for min+ and max-, 9.4 for an explicit version). Example:
+#
+# USES=pgsql:9.4 # Only use PostgreSQL 9.4
+# USES=pgsql:9.3+ # Use PostgreSQL 9.3 or newer
+# USES=pgsql:9.3-9.6 # Use PostgreSQL between 9.3 & 9.6
+# USES=pgsql:9.6- # Use any PostgreSQL up to 9.6
+# USES=pgsql # Use the default PostgreSQL
#
# WANT_PGSQL= server[:fetch] plperl plpython pltcl
#
@@ -80,6 +88,17 @@ _WANT_PGSQL_VER+=${version}
_WANT_PGSQL_VER+=${version}
. endif
. endfor
+. elif ${pgsql_ARGS:M*-*}
+_MIN=${pgsql_ARGS:M?*-?*:C,-.*,,}
+_MAX=${pgsql_ARGS:M?*-?*:C,.*-,,}
+. if ${_MIN} > ${_MAX}
+IGNORE= The minimum version must be higher than the maximum version wanted
+. endif
+. for version in ${VALID_PGSQL_VER}
+. if ${_MIN} <= ${version} && ${_MAX} >= ${version}
+_WANT_PGSQL_VER+= ${version}
+. endif
+. endfor
. endif
_WANT_PGSQL_VER?= ${pgsql_ARGS}
. endif