changeset 12564:c73c23bbe9ce octave-forge

Check postgresql version at configure time. Fixes bug #44345.
author i7tiol
date Tue, 24 Feb 2015 10:12:25 +0000
parents 2e6bd8aa7df8
children f22c1e4bc9c5
files main/database/DESCRIPTION main/database/NEWS main/database/src/configure.ac
diffstat 3 files changed, 16 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/main/database/DESCRIPTION	Sun Feb 22 20:00:47 2015 +0000
+++ b/main/database/DESCRIPTION	Tue Feb 24 10:12:25 2015 +0000
@@ -1,6 +1,6 @@
 Name: database
 Version: 2.3.1
-Date: 2015-01-26
+Date: 2015-02-24
 Author: Olaf Till <i7tiol@t-online.de>
 Maintainer: Olaf Till <i7tiol@t-online.de>
 Title: Database.
--- a/main/database/NEWS	Sun Feb 22 20:00:47 2015 +0000
+++ b/main/database/NEWS	Tue Feb 24 10:12:25 2015 +0000
@@ -1,3 +1,6 @@
+ ** Incompatible versions of postgresql (< 8.3) are rejected at
+    configure time.
+
 database 2.3.1
 --------------
 
--- a/main/database/src/configure.ac	Sun Feb 22 20:00:47 2015 +0000
+++ b/main/database/src/configure.ac	Tue Feb 24 10:12:25 2015 +0000
@@ -26,5 +26,17 @@
 # Checks for library functions.
 AC_FUNC_ERROR_AT_LINE
 
+# Check for PostgreSQL version. (Octave is 'abused' here for string
+# and version handling, only because I'm more familiar with it than
+# with other tools. Should not interfer with cross-compiling as long
+# as you have any Octave installed locally.)
+AC_MSG_CHECKING([whether PostgreSQL version is >= 8.3])
+if $OCTAVE -q --eval ["[~, vs] = system ('$PG_CONFIG --version'); if (compare_versions (regexp (vs, '(\\d+\\.\\d+\\.\\d+)', 'tokens'){1}{:}, '8.3', '>=')) exit (1); else exit (0); endif"]; then
+   AC_MSG_RESULT(no)
+  AC_MSG_ERROR([package \"database\" does not work with PostgreSQL version < 8.3], 1);
+else
+   AC_MSG_RESULT(yes)
+fi
+
 AC_CONFIG_FILES([Makefile])
 AC_OUTPUT