[postgis-tickets] r15048 - Accept dot-less output from pg_config --version

Sandro Santilli strk at kbt.io
Sun Aug 28 10:05:38 PDT 2016


Author: strk
Date: 2016-08-28 10:05:38 -0700 (Sun, 28 Aug 2016)
New Revision: 15048

Modified:
   trunk/configure.ac
Log:
Accept dot-less output from pg_config --version

Hopefully fixes #3614

Modified: trunk/configure.ac
===================================================================
--- trunk/configure.ac	2016-08-28 16:47:59 UTC (rev 15047)
+++ trunk/configure.ac	2016-08-28 17:05:38 UTC (rev 15048)
@@ -429,9 +429,10 @@
   dnl Extract the version information from pg_config
   dnl Note: we extract the major & minor separately, ensure they are numeric, and then combine to give
   dnl the final version. This is to guard against user error...
-  PGSQL_MAJOR_VERSION=`$PG_CONFIG --version | sed 's/[[^0-9]]*\([[0-9]]\)\.\([[0-9]]\).*/\1/'`
-  PGSQL_MINOR_VERSION=`$PG_CONFIG --version | sed 's/[[^0-9]]*\([[0-9]]\)\.\([[0-9]]\).*/\2/'`
   PGSQL_FULL_VERSION=`$PG_CONFIG --version`
+  PGSQL_MAJOR_VERSION=`echo $PGSQL_FULL_VERSION | sed 's/[[^0-9]]*\([[0-9]]*\).*/\1/'`
+  PGSQL_MINOR_VERSION=`echo $PGSQL_FULL_VERSION | sed 's/[[^\.]]*\.\([[0-9]]*\).*/\1/'`
+  PGSQL_MINOR_VERSION=`echo $PGSQL_MINOR_VERSION | sed 's/.*develop.*/0/'`
   POSTGIS_PGSQL_VERSION="$PGSQL_MAJOR_VERSION$PGSQL_MINOR_VERSION"
 
   PGSQL_PKGLIBDIR=`$PG_CONFIG --pkglibdir`



More information about the postgis-tickets mailing list