]> granicus.if.org Git - postgis/commitdiff
Set script version to master version + svn revision (#1608)
authorSandro Santilli <strk@keybit.net>
Mon, 27 Feb 2012 11:22:12 +0000 (11:22 +0000)
committerSandro Santilli <strk@keybit.net>
Mon, 27 Feb 2012 11:22:12 +0000 (11:22 +0000)
Affects postgis_scripts_released() and posgis_scripts_installed().
Needs some wider testing of upgrade scripts and then will attach
the same version to raster and topology.

git-svn-id: http://svn.osgeo.org/postgis/trunk@9304 b70326c6-7e19-0410-871a-916f4a2858ee

configure.ac
postgis/lwgeom_functions_basic.c
postgis/postgis.sql.in.c
postgis/sqldefines.h.in

index ac9c499586c210c55224a0d957e852ced5ca177a..1e4d241df9ec5acf9b56208669a18c3fa6883c41 100644 (file)
@@ -757,8 +757,7 @@ fi
 
 POSTGIS_LIB_VERSION="$POSTGIS_MAJOR_VERSION.$POSTGIS_MINOR_VERSION.$POSTGIS_MICRO_VERSION"
 POSTGIS_BUILD_DATE=`date -u "+%Y-%m-%d %H:%M:%S"`
-POSTGIS_SCRIPTS_SVNREV=`perl utils/read_scripts_version.pl`
-POSTGIS_SCRIPTS_VERSION="$POSTGIS_MAJOR_VERSION.$POSTGIS_MINOR_VERSION r$POSTGIS_SCRIPTS_SVNREV"
+POSTGIS_SCRIPTS_VERSION="$POSTGIS_LIB_VERSION"
 
 AC_DEFINE_UNQUOTED([POSTGIS_VERSION], ["$POSTGIS_VERSION"], [PostGIS version])
 AC_DEFINE_UNQUOTED([POSTGIS_LIB_VERSION], ["$POSTGIS_LIB_VERSION"], [PostGIS library version])
index 75d16ccdc7e69540cfde0fbd09d0d672fc22653c..796675fc6cc089db77f2cb9a832692a2e8a0be58 100644 (file)
@@ -171,8 +171,13 @@ Datum postgis_lib_build_date(PG_FUNCTION_ARGS)
 PG_FUNCTION_INFO_V1(postgis_scripts_released);
 Datum postgis_scripts_released(PG_FUNCTION_ARGS)
 {
-       char *ver = POSTGIS_SCRIPTS_VERSION;
-       text *result = cstring2text(ver);
+       char ver[64];
+       text *result;
+
+       snprintf(ver, 64, "%s r%d", POSTGIS_LIB_VERSION, POSTGIS_SVN_REVISION);
+       ver[63] = '\0';
+
+       result = cstring2text(ver);
        PG_RETURN_TEXT_P(result);
 }
 
index d48dbf8a9c6341c858942ed3304d9e3a787a763a..9b8738093e89718ee1715ae62503d162ef6a57d2 100644 (file)
@@ -2318,7 +2318,8 @@ CREATE OR REPLACE FUNCTION postgis_lib_version() RETURNS text
        AS 'MODULE_PATHNAME'
        LANGUAGE 'C' IMMUTABLE; -- a new lib will require a new session
 
--- NOTE: starting at 1.1.0 this is the same of postgis_lib_version()
+-- NOTE: from 1.1.0 to 1.5.x this was the same of postgis_lib_version()
+-- NOTE: from 2.0.0 up it includes postgis_svn_revision()
 CREATE OR REPLACE FUNCTION postgis_scripts_released() RETURNS text
        AS 'MODULE_PATHNAME'
        LANGUAGE 'C' IMMUTABLE;
index a2bb56b595821e351c3850c3de3a2edf0268c9c2..491bcc602f907c7dc1821cea78ee72ea579bcc91 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef _LWPGIS_DEFINES
 #define _LWPGIS_DEFINES
 
+#include "../postgis_svn_revision.h"
+
 /*
  * Define just the version numbers; otherwise we get some strange substitutions in postgis.sql.in
  */
  */
 #define _POSTGIS_SQL_SELECT_POSTGIS_VERSION 'SELECT ''@POSTGIS_VERSION@''::text AS version'
 #define _POSTGIS_SQL_SELECT_POSTGIS_BUILD_DATE 'SELECT ''@POSTGIS_BUILD_DATE@''::text AS version'
-#define _POSTGIS_SQL_SELECT_POSTGIS_SCRIPTS_VERSION 'SELECT ''@POSTGIS_SCRIPTS_VERSION@''::text AS version'
+
+#if POSTGIS_SVN_REVISION
+# define _POSTGIS_SQL_SELECT_POSTGIS_SCRIPTS_VERSION $$ SELECT '@POSTGIS_SCRIPTS_VERSION@'::text || ' r' || POSTGIS_SVN_REVISION::text AS version $$
+#else
+# define _POSTGIS_SQL_SELECT_POSTGIS_SCRIPTS_VERSION $$ SELECT '@POSTGIS_SCRIPTS_VERSION@'::text AS version $$
+#endif
 
 #define SRID_USR_MAX @SRID_USR_MAX@