Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 Jan 2019 21:50:55 +0000 (UTC)
From:      Chris Rees <crees@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r490431 - head/Mk/Uses
Message-ID:  <201901152150.x0FLotR1046405@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: crees
Date: Tue Jan 15 21:50:54 2019
New Revision: 490431
URL: https://svnweb.freebsd.org/changeset/ports/490431

Log:
  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

Modified:
  head/Mk/Uses/pgsql.mk

Modified: head/Mk/Uses/pgsql.mk
==============================================================================
--- head/Mk/Uses/pgsql.mk	Tue Jan 15 21:30:15 2019	(r490430)
+++ head/Mk/Uses/pgsql.mk	Tue Jan 15 21:50:54 2019	(r490431)
@@ -5,9 +5,17 @@
 # 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
 #
 #		Add PostgreSQL component dependency, using
@@ -78,6 +86,17 @@ _WANT_PGSQL_VER+=${version}
 .      for version in ${VALID_PGSQL_VER}
 .        if ${pgsql_ARGS:S/-//} >= ${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 to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201901152150.x0FLotR1046405>