Permalink
Browse files

Accept dot-less output from pg_config --version

Hopefully fixes #3614

git-svn-id: http://svn.osgeo.org/postgis/trunk@15048 b70326c6-7e19-0410-871a-916f4a2858ee
  • Loading branch information...
1 parent 8a1e9cb commit d7e9c4bd845d1d5de78f9f5e31b254babc01f1d0 @strk strk committed Aug 28, 2016
Showing with 3 additions and 2 deletions.
  1. +3 −2 configure.ac
View
@@ -429,9 +429,10 @@ if test "x$LIBLWGEOM_ONLY" = "xno"; then
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/'`
@laurenz
laurenz Aug 31, 2016

Shouldn't that be sed 's/.*devel.*/0/'?

Current PostgreSQL HEAD gives me

$ /pg_config --version
PostgreSQL 10devel
@strk
strk Aug 31, 2016 Member

Good catch, fixed with r15050 = 810db38 (refs/remotes/trunk)

POSTGIS_PGSQL_VERSION="$PGSQL_MAJOR_VERSION$PGSQL_MINOR_VERSION"
PGSQL_PKGLIBDIR=`$PG_CONFIG --pkglibdir`

0 comments on commit d7e9c4b

Please sign in to comment.