From: Sandro Santilli Date: Mon, 24 Feb 2014 18:31:00 +0000 (+0000) Subject: Output single upgrade script for postgis: postgis_upgrade.sql X-Git-Tag: 2.2.0rc1~1226 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=95c185ad722db5e2aea0ebd7cb99b1fb653eaf2d;p=postgis Output single upgrade script for postgis: postgis_upgrade.sql git-svn-id: http://svn.osgeo.org/postgis/trunk@12274 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/extensions/postgis/Makefile.in b/extensions/postgis/Makefile.in index d1fa8fdc6..4f84ddfec 100644 --- a/extensions/postgis/Makefile.in +++ b/extensions/postgis/Makefile.in @@ -85,7 +85,7 @@ sql_bits/rtpostgis_upgrade_$(PREV_big)_$(CURV_big).sql: ../../raster/rt_pg/rtpos #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_$(PREV_big)_$(CURV_big).sql: ../../postgis/postgis_upgrade_$(PREV_big)_$(CURV_big).sql +sql_bits/postgis_upgrade.sql: ../../postgis/postgis_upgrade.sql sed -e 's/BEGIN;//g' -e 's/COMMIT;//g' \ -e '/^\(DROP\|CREATE\) \(CAST\).*;/d' \ -e '/^\(DROP\|CREATE\) \(CAST\)/,/\;/d' \ @@ -102,7 +102,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/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 +sql_bits/postgis_raster_upgrade_minor.sql: ../postgis_extension_helper.sql sql_bits/postgis_upgrade.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_minor_upgrade: sql_bits/postgis_raster_upgrade_minor.sql diff --git a/postgis/Makefile.in b/postgis/Makefile.in index 95fd6384b..1b1fa7d8c 100644 --- a/postgis/Makefile.in +++ b/postgis/Makefile.in @@ -14,15 +14,8 @@ POSTGIS_PGSQL_VERSION=@POSTGIS_PGSQL_VERSION@ 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_dot=2.1 -PREV_big=21 -CURV_big_dot=@POSTGIS_MAJOR_VERSION@.@POSTGIS_MINOR_VERSION@ -CURV_big=@POSTGIS_MAJOR_VERSION@@POSTGIS_MINOR_VERSION@ - # Files to be copied to the contrib/ directory -SQL_built=postgis.sql uninstall_postgis.sql postgis_upgrade_$(PREV_big)_$(CURV_big).sql postgis_upgrade_$(CURV_big)_minor.sql legacy.sql uninstall_legacy.sql legacy_minimal.sql legacy_gist.sql uninstall_sfcgal.sql +SQL_built=postgis.sql uninstall_postgis.sql postgis_upgrade.sql legacy.sql uninstall_legacy.sql legacy_minimal.sql legacy_gist.sql uninstall_sfcgal.sql DATA=../spatial_ref_sys.sql # SQL objects (files requiring pre-processing) @@ -110,9 +103,8 @@ EXTRA_CLEAN=$(SQL_OBJS) \ uninstall_postgis.sql \ uninstall_legacy.sql \ uninstall_sfcgal.sql \ - postgis_upgrade_$(PREV_big)_$(CURV_big).sql.in \ - postgis_upgrade_$(PREV_big)_$(CURV_big).sql \ - postgis_upgrade_$(CURV_big)_minor.sql + postgis_upgrade.sql.in \ + postgis_upgrade.sql # PGXS information PG_CONFIG = @PG_CONFIG@ @@ -171,19 +163,11 @@ $(PG_OBJS): ../liblwgeom/.libs/liblwgeom.a ../libpgcommon/libpgcommon.a ../postg $(SQLPP) -I../libpgcommon $< | grep -v '^#' | \ $(PERL) -lpe "s'MODULE_PATHNAME'\$$libdir/postgis-@POSTGIS_MAJOR_VERSION@.@POSTGIS_MINOR_VERSION@'g" > $@ -postgis_upgrade_$(PREV_big)_$(CURV_big).sql.in: postgis_drop_before.sql postgis.sql postgis_drop_after.sql - cat $^ > $@ -postgis_upgrade_$(PREV_big)_$(CURV_big).sql: postgis_upgrade_$(PREV_big)_$(CURV_big).sql.in ../utils/postgis_proc_upgrade.pl - $(PERL) ../utils/postgis_proc_upgrade.pl $< $(PREV_big_dot) > $@ - -postgis_upgrade_$(CURV_big)_minor.sql.in: postgis_drop_before.sql postgis.sql postgis_drop_after.sql - cat $^ > $@ -postgis_upgrade_$(CURV_big)_minor.sql: postgis_upgrade_$(CURV_big)_minor.sql.in ../utils/postgis_proc_upgrade.pl - $(PERL) ../utils/postgis_proc_upgrade.pl $< $(CURV_big_dot) > $@ +postgis_upgrade.sql.in: postgis.sql ../utils/postgis_proc_upgrade.pl + $(PERL) ../utils/postgis_proc_upgrade.pl $< UNUSED > $@ -# Generate any .sql.in files from .sql.in.c files by running them through the SQL pre-processor -#$(SQL_OBJS): %.in: %.in.c -# $(SQLPP) -I../libpgcommon $< | grep -v '^#' > $@ +postgis_upgrade.sql: postgis_drop_before.sql postgis_upgrade.sql.in postgis_drop_after.sql + cat $^ > $@ # SQL objects are also dependent on postgis_config.h for PostgreSQL version $(SQL_OBJS): ../postgis_config.h ../postgis_svn_revision.h diff --git a/regress/run_test.pl b/regress/run_test.pl index cf19ddedc..6af8b08af 100755 --- a/regress/run_test.pl +++ b/regress/run_test.pl @@ -1162,7 +1162,7 @@ sub upgrade_spatial { print "Upgrading PostGIS in '${DB}' \n" ; - my $script = `ls ${STAGED_SCRIPTS_DIR}/postgis_upgrade_*_minor.sql`; + my $script = `ls ${STAGED_SCRIPTS_DIR}/postgis_upgrade.sql`; chomp($script); if ( -e $script )