]> granicus.if.org Git - postgis/commitdiff
Unified SCRIPTS, LIB and RELEASE versions for the sake of simplicity.
authorSandro Santilli <strk@keybit.net>
Fri, 16 Dec 2005 01:41:44 +0000 (01:41 +0000)
committerSandro Santilli <strk@keybit.net>
Fri, 16 Dec 2005 01:41:44 +0000 (01:41 +0000)
postgis_scripts_released() will return the same as postgis_lib_version()
postgis_scripts_installed() return still the same numbers but as written
in the database at the time of lwpostgis.sql sourcing.

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

CHANGES
Version.config
lwgeom/Makefile
lwgeom/lwpostgis.sql.in
utils/postgis_proc_upgrade.pl

diff --git a/CHANGES b/CHANGES
index 092a30c9589c51044b704b192a300d76a962f903..cd4424d169009dadd108a262009b5cdd2b04d2e6 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -50,6 +50,8 @@ PostGIS 1.1.0CVS
                - postgis_version() made a C function
                - produced lwpostgis_upgrade.sql as part of the build process
                - old jdbc code removed from release
+               - obsoleted direct use of postgis_proc_upgrade.pl
+               - scripts version unified with release version
 
 PostGIS 1.0.6
 2005/12/06
index d5d29dcffd7213e2d140ae36af82c52fc90bc641..3ca8d28eeb7d5df4f9dc153916464b034425035e 100644 (file)
@@ -6,11 +6,6 @@ SO_MAJOR_VERSION=1
 SO_MINOR_VERSION=1
 SO_MICRO_VERSION=0CVS
 
-# sql scripts version
-SCRIPTS_MAJOR_VERSION=0
-SCRIPTS_MINOR_VERSION=3
-SCRIPTS_MICRO_VERSION=1
-
 # JDBC code version
 JDBC_MAJOR_VERSION=1
 JDBC_MINOR_VERSION=1
index b0c53b62f5c5bb3cfa0d7fde03c190195e1ff7c9..ba888d7d0dee61b7fa148116acbcecc59289516a 100644 (file)
@@ -22,7 +22,7 @@ SHLIB_LINK    = $(DLFLAGS)
 POSTGIS_VERSION = $(SO_MAJOR_VERSION).$(SO_MINOR_VERSION) USE_GEOS=$(USE_GEOS) USE_PROJ=$(USE_PROJ) USE_STATS=$(USE_STATS)
 POSTGIS_LIB_VERSION = $(SO_MAJOR_VERSION).$(SO_MINOR_VERSION).$(SO_MICRO_VERSION)
 POSTGIS_BUILD_DATE := $(shell date -u "+%Y-%m-%d %H:%M:%S")
-SCRIPTS_VERSION=$(SCRIPTS_MAJOR_VERSION).$(SCRIPTS_MINOR_VERSION).$(SCRIPTS_MICRO_VERSION)
+SCRIPTS_VERSION=$(POSTGIS_LIB_VERSION)
 
 
 #---------------------------------------------------------------
index 453f700e99c18bb339131bfde4c405bd798a417c..9e7a203c9d69dd4cb3a28d1385f9a8c9cf7cfd9c 100644 (file)
@@ -2553,6 +2553,12 @@ CREATEFUNCTION postgis_proj_version() RETURNS text
        AS '@MODULE_FILENAME@'
        LANGUAGE 'C' _IMMUTABLE;
 
+--
+-- IMPORTANT:
+-- Starting at 1.1.0 this function is used by postgis_proc_upgrade.pl
+-- to extract version of postgis being installed.
+-- Do not modify this w/out also changing postgis_proc_upgrade.pl
+--
 CREATEFUNCTION postgis_scripts_installed() RETURNS text
         AS 'SELECT \'@POSTGIS_SCRIPTS_VERSION@\'::text AS version'
         LANGUAGE 'sql' _IMMUTABLE;
@@ -2561,6 +2567,7 @@ CREATEFUNCTION postgis_lib_version() RETURNS text
        AS '@MODULE_FILENAME@'
        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()
 CREATEFUNCTION postgis_scripts_released() RETURNS text
        AS '@MODULE_FILENAME@'
        LANGUAGE 'C' _IMMUTABLE;
@@ -2625,8 +2632,8 @@ BEGIN
                fullver = fullver || \' USE_STATS\';
        END IF;
 
-       fullver = fullver || \' DBPROC="\' || dbproc || \'"\';
-       fullver = fullver || \' RELPROC="\' || relproc || \'"\';
+       -- fullver = fullver || \' DBPROC="\' || dbproc || \'"\';
+       -- fullver = fullver || \' RELPROC="\' || relproc || \'"\';
 
        IF dbproc != relproc THEN
                fullver = fullver || \' (needs proc upgrade)\';
index 077fb440cad29f576a1fda0dfe6a63eea9c1e1d5..43509e92cd6f5b76d5f0953eab4ff889bb002559 100755 (executable)
@@ -6,7 +6,7 @@ eval "exec perl -w $0 $@"
 use strict;
 
 ($#ARGV == 0) ||
-die "Usage: perl postgis_funxupgrade.pl <postgis.sql> [<schema>]\nCreates a new SQL script to upgrade all of the PostGIS functions.\n"
+die "Usage: perl postgis_proc_upgrade.pl <postgis.sql> [<schema>]\nCreates a new SQL script to upgrade all of the PostGIS functions.\n"
        if ( @ARGV < 1 || @ARGV > 2 );
 
 my $NEWVERSION = "UNDEF";
@@ -20,11 +20,14 @@ open( INPUT, $ARGV[0] ) || die "Couldn't open file: $ARGV[0]\n";
 FUNC:
 while(<INPUT>)
 {
+       #
+       # Since 1.1.0 scripts/lib/release versions are the same
+       #
        if (m/^create or replace function postgis_scripts_installed()/i)
        {
                while(<INPUT>)
                {
-                       if ( m/SELECT .'(\d\.\d\.\d).'::text/i )
+                       if ( m/SELECT .'(\d\.\d\..*).'::text/i )
                        {
                                $NEWVERSION = $1;
                                last FUNC;
@@ -88,7 +91,7 @@ print "COMMIT;\n";
 
 __END__
 
-CREATE OR REPLACE FUNCTION postgis_script_version_check()
+CREATE OR REPLACE FUNCTION postgis_major_version_check()
 RETURNS text
 AS '
 DECLARE
@@ -97,7 +100,7 @@ DECLARE
        old_majmin text;
        new_majmin text;
 BEGIN
-       SELECT into old_scripts postgis_scripts_installed();
+       SELECT into old_scripts postgis_lib_version();
        SELECT into new_scripts ''NEWVERSION'';
        SELECT into old_majmin substring(old_scripts from 1 for 4);
        SELECT into new_majmin substring(new_scripts from 1 for 4);
@@ -111,6 +114,6 @@ END
 '
 LANGUAGE 'plpgsql';
 
-SELECT postgis_script_version_check();
+SELECT postgis_major_version_check();
 
-DROP FUNCTION postgis_script_version_check();
+DROP FUNCTION postgis_major_version_check();