From: Sandro Santilli Date: Tue, 15 Oct 2013 14:31:02 +0000 (+0000) Subject: More hard-coded version numbers reduction X-Git-Tag: 2.2.0rc1~1328 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=88f64c177762cf8b4290b3e10e2a110ae286d1bb;p=postgis More hard-coded version numbers reduction This commit fixes raster and postgis/raster extension. I noticed that the extension files have what looks like being an attempt to compute the "previous" version in another way, but haven't tried to use those variables. Also, I think it would be worth moving all the version strings into the Version.config file in top-level. Not done by this commit, but comments left git-svn-id: http://svn.osgeo.org/postgis/trunk@12036 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/extensions/postgis/Makefile.in b/extensions/postgis/Makefile.in index 1da246005..948348f36 100644 --- a/extensions/postgis/Makefile.in +++ b/extensions/postgis/Makefile.in @@ -27,6 +27,10 @@ PG91 = $(shell $(PG_CONFIG) --version | $(GREP) -qE " 8\.| 9\.0" && echo SQL_BITS = $(wildcard sql_bits/*.sql) EXTRA_CLEAN += ${SQL_BITS} sql/*.sql +# Update PREV_big manually on branching +# TODO: move this definition in ../../Version.config +PREV_big=21 +CURV_big=@POSTGIS_MAJOR_VERSION@@POSTGIS_MINOR_VERSION@ ifeq ($(PG91),yes) sql/$(EXTENSION).sql: sql_bits/postgis.sql sql_bits/postgis_comments.sql sql_bits/rtpostgis.sql sql_bits/mark_editable_objects.sql.in sql_bits/raster_comments.sql sql_bits/spatial_ref_sys.sql @@ -71,7 +75,7 @@ sql_bits/rtpostgis.sql: ../../raster/rt_pg/rtpostgis.sql # for casts that are being dropped we need to drop them # from extension only if they are in the existension so we use our postgis_extension_drop.. # so that it will silently fail if cast is not in extension -sql_bits/rtpostgis_upgrade_20_21.sql: ../../raster/rt_pg/rtpostgis_upgrade_20_21.sql +sql_bits/rtpostgis_upgrade_$(PREV_big)_$(CURV_big).sql: ../../raster/rt_pg/rtpostgis_upgrade_$(PREV_big)_$(CURV_big).sql sed -e 's/BEGIN;//g' -e 's/COMMIT;//g' \ -e 's/DROP FUNCTION _rename_raster_tables();/ALTER EXTENSION ${EXTENSION} DROP FUNCTION _rename_raster_tables();DROP FUNCTION _rename_raster_tables();/g' \ -e 's/DROP FUNCTION _drop_st_samealignment();/ALTER EXTENSION ${EXTENSION} DROP FUNCTION _drop_st_samealignment();DROP FUNCTION _drop_st_samealignment();/g' \ @@ -80,7 +84,7 @@ sql_bits/rtpostgis_upgrade_20_21.sql: ../../raster/rt_pg/rtpostgis_upgrade_20_21 #don't drop casts just yet since we don't have provision to remove from extension yet #need to also drop temporary functions from extenions since it gets auto-added -sql_bits/postgis_upgrade_20_21.sql: ../../postgis/postgis_upgrade_20_21.sql +sql_bits/postgis_upgrade_$(PREV_big)_$(CURV_big).sql: ../../postgis/postgis_upgrade_$(PREV_big)_$(CURV_big).sql sed -e 's/BEGIN;//g' -e 's/COMMIT;//g' \ -e '/^\(DROP\|CREATE\) \(CAST\).*;/d' \ -e '/^\(DROP\|CREATE\) \(CAST\)/,/\;/d' \ @@ -97,7 +101,7 @@ sql_bits/raster_comments.sql: ../../doc/raster_comments.sql #postgis_raster_upgrade_minor.sql is the one that contains both postgis AND raster #TODO: come up with a better name #TODO: what about postgis_drop_after.sql ? where does it fit ?? -sql_bits/postgis_raster_upgrade_minor.sql: ../postgis_extension_helper.sql sql_bits/remove_from_extension.sql.in sql_bits/postgis_upgrade_20_21.sql sql_bits/rtpostgis_upgrade_20_21.sql ../../doc/raster_comments.sql ../../doc/postgis_comments.sql ../postgis_extension_helper_uninstall.sql +sql_bits/postgis_raster_upgrade_minor.sql: ../postgis_extension_helper.sql sql_bits/remove_from_extension.sql.in sql_bits/postgis_upgrade_$(PREV_big)_$(CURV_big).sql sql_bits/rtpostgis_upgrade_$(PREV_big)_$(CURV_big).sql ../../doc/raster_comments.sql ../../doc/postgis_comments.sql ../postgis_extension_helper_uninstall.sql cat $^ > $@ # sql_bits/rtpostgis--unpackaged.sql: ../../raster/rt_pg/rtpostgis.sql diff --git a/postgis/Makefile.in b/postgis/Makefile.in index 456e7ebf0..7f7b75ba7 100644 --- a/postgis/Makefile.in +++ b/postgis/Makefile.in @@ -15,6 +15,7 @@ MODULE_big=postgis-@POSTGIS_MAJOR_VERSION@.@POSTGIS_MINOR_VERSION@ MODULEDIR=contrib/$(MODULE_big) # Update PREV_big manually on branching +# TODO: move this definition in ../../Version.config PREV_big=21 CURV_big=@POSTGIS_MAJOR_VERSION@@POSTGIS_MINOR_VERSION@ diff --git a/raster/rt_pg/Makefile.in b/raster/rt_pg/Makefile.in index 4c6291fe2..342a61940 100644 --- a/raster/rt_pg/Makefile.in +++ b/raster/rt_pg/Makefile.in @@ -1,4 +1,4 @@ -############################################################################# +############################################################################ # $Id$ # # Copyright (c) 2009-2011 Sandro Santilli @@ -13,8 +13,13 @@ POSTGIS_PGSQL_VERSION=@POSTGIS_PGSQL_VERSION@ MODULE_big=rtpostgis-@POSTGIS_MAJOR_VERSION@.@POSTGIS_MINOR_VERSION@ MODULEDIR=contrib/postgis-@POSTGIS_MAJOR_VERSION@.@POSTGIS_MINOR_VERSION@ +# Update PREV_big manually on branching +# TODO: move this definition in ../../Version.config +PREV_big=21 +CURV_big=@POSTGIS_MAJOR_VERSION@@POSTGIS_MINOR_VERSION@ + # Files to be copied to the contrib/ directory -DATA_built=rtpostgis.sql rtpostgis_upgrade_20_21.sql rtpostgis_upgrade_21_minor.sql uninstall_rtpostgis.sql rtpostgis_legacy.sql +DATA_built=rtpostgis.sql rtpostgis_upgrade_$(PREV_big)_$(CURV_big).sql rtpostgis_upgrade_$(CURV_big)_minor.sql uninstall_rtpostgis.sql rtpostgis_legacy.sql DATA= # SQL preprocessor @@ -116,11 +121,11 @@ $(SQL_OBJS): ../../postgis/sqldefines.h ../../postgis_svn_revision.h rtpostgis_upgrade.sql: rtpostgis.sql $(PERL) -0777 -ne 's/^(CREATE|ALTER) (CAST|OPERATOR|TYPE|TABLE|SCHEMA|DOMAIN|TRIGGER).*?;//msg;print;' $< > $@ -rtpostgis_upgrade_20_21.sql: rtpostgis_upgrade_cleanup.sql rtpostgis_drop.sql rtpostgis_upgrade.sql +rtpostgis_upgrade_$(PREV_big)_$(CURV_big).sql: rtpostgis_upgrade_cleanup.sql rtpostgis_drop.sql rtpostgis_upgrade.sql cat $^ > $@ -# same as 20_21 until 2.1.0 is released -rtpostgis_upgrade_21_minor.sql: rtpostgis_upgrade_cleanup.sql rtpostgis_drop.sql rtpostgis_upgrade.sql +# same as $(PREV_big)_$(CURV_big) until next .0 is released +rtpostgis_upgrade_$(CURV_big)_minor.sql: rtpostgis_upgrade_cleanup.sql rtpostgis_drop.sql rtpostgis_upgrade.sql cat $^ > $@ uninstall_rtpostgis.sql: rtpostgis.sql ../../utils/create_undef.pl