From: Sandro Santilli Date: Fri, 16 Dec 2005 01:41:44 +0000 (+0000) Subject: Unified SCRIPTS, LIB and RELEASE versions for the sake of simplicity. X-Git-Tag: pgis_1_1_0~29 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6bb58497410eb764147721894231cef0ddd32310;p=postgis Unified SCRIPTS, LIB and RELEASE versions for the sake of simplicity. 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 --- diff --git a/CHANGES b/CHANGES index 092a30c95..cd4424d16 100644 --- 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 diff --git a/Version.config b/Version.config index d5d29dcff..3ca8d28ee 100644 --- a/Version.config +++ b/Version.config @@ -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 diff --git a/lwgeom/Makefile b/lwgeom/Makefile index b0c53b62f..ba888d7d0 100644 --- a/lwgeom/Makefile +++ b/lwgeom/Makefile @@ -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) #--------------------------------------------------------------- diff --git a/lwgeom/lwpostgis.sql.in b/lwgeom/lwpostgis.sql.in index 453f700e9..9e7a203c9 100644 --- a/lwgeom/lwpostgis.sql.in +++ b/lwgeom/lwpostgis.sql.in @@ -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)\'; diff --git a/utils/postgis_proc_upgrade.pl b/utils/postgis_proc_upgrade.pl index 077fb440c..43509e92c 100755 --- a/utils/postgis_proc_upgrade.pl +++ b/utils/postgis_proc_upgrade.pl @@ -6,7 +6,7 @@ eval "exec perl -w $0 $@" use strict; ($#ARGV == 0) || -die "Usage: perl postgis_funxupgrade.pl []\nCreates a new SQL script to upgrade all of the PostGIS functions.\n" +die "Usage: perl postgis_proc_upgrade.pl []\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() { + # + # Since 1.1.0 scripts/lib/release versions are the same + # if (m/^create or replace function postgis_scripts_installed()/i) { while() { - 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();