[postgis-tickets] r16748 - Include upgrade in raster extension create from unpackaged
Sandro Santilli
strk at kbt.io
Tue Sep 11 02:20:04 PDT 2018
Author: strk
Date: 2018-09-11 02:20:04 -0700 (Tue, 11 Sep 2018)
New Revision: 16748
Removed:
trunk/extensions/postgis_raster/unpackaged_check.sql.in
Modified:
trunk/extensions/postgis/Makefile.in
trunk/extensions/postgis_raster/Makefile.in
Log:
Include upgrade in raster extension create from unpackaged
Modified: trunk/extensions/postgis/Makefile.in
===================================================================
--- trunk/extensions/postgis/Makefile.in 2018-09-11 09:19:58 UTC (rev 16747)
+++ trunk/extensions/postgis/Makefile.in 2018-09-11 09:20:04 UTC (rev 16748)
@@ -103,11 +103,6 @@
| $(PERL) ../../utils/create_unpackaged.pl postgis \
>> $@
-unpackaged_check.sql: unpackaged_check.sql.in Makefile
- cat $< \
- | sed -e 's|@EXTVERSION@|$(EXTVERSION)|g' \
- > $@
-
sql:
mkdir -p $@
Modified: trunk/extensions/postgis_raster/Makefile.in
===================================================================
--- trunk/extensions/postgis_raster/Makefile.in 2018-09-11 09:19:58 UTC (rev 16747)
+++ trunk/extensions/postgis_raster/Makefile.in 2018-09-11 09:20:04 UTC (rev 16748)
@@ -75,8 +75,9 @@
sql/$(EXTENSION)--$(EXTVERSION).sql: sql/$(EXTENSION).sql | sql
cp $< $@
-sql/$(EXTENSION)--unpackaged--$(EXTVERSION).sql: $(EXTENSION_UNPACKAGED_UPGRADE_SCRIPTS) ../../utils/create_unpackaged.pl unpackaged_check.sql Makefile | sql
- cat unpackaged_check.sql > $@
+sql/$(EXTENSION)--unpackaged--$(EXTVERSION).sql: $(EXTENSION_UNPACKAGED_UPGRADE_SCRIPTS) ../../utils/create_unpackaged.pl sql/$(EXTENSION)--ANY--$(EXTVERSION).sql Makefile | sql
+ # Ensure version is correct
+ cat sql/$(EXTENSION)--ANY--$(EXTVERSION).sql > $@
cat $(EXTENSION_UNPACKAGED_UPGRADE_SCRIPTS) | $(PERL) ../../utils/create_unpackaged.pl postgis_raster >> $@
unpackaged_check.sql: unpackaged_check.sql.in Makefile
@@ -97,9 +98,9 @@
sql/raster_comments.sql: ../../doc/raster_comments.sql | sql
cp $< $@
-sql/postgis_extension_upgrade_minor.sql: $(EXTENSION_UPGRADE_SCRIPTS) | sql
+sql/$(EXTENSION)--ANY--$(EXTVERSION).sql: $(EXTENSION_UPGRADE_SCRIPTS) | sql
printf '\\echo Use "CREATE EXTENSION $(EXTENSION)" to load this file. \\quit\n' > $@
- cat $^ >> $@
+ cat $(EXTENSION_UPGRADE_SCRIPTS) >> $@
EXTDIR=$(DESTDIR)$(datadir)/$(datamoduledir)
@@ -107,7 +108,7 @@
# The "next" lines are a cludge to allow upgrading between different
# revisions of the same version
-install-upgrade-paths: sql/postgis_extension_upgrade_minor.sql
+install-upgrade-paths:
tpl='$(EXTENSION)--ANY--$(EXTVERSION).sql'; \
$(INSTALL_DATA) $^ "$(EXTDIR)/$${tpl}"; \
ln -fs "$${tpl}" $(EXTDIR)/$(EXTENSION)--$(EXTVERSION)--$(EXTVERSION)next.sql; \
Deleted: trunk/extensions/postgis_raster/unpackaged_check.sql.in
===================================================================
--- trunk/extensions/postgis_raster/unpackaged_check.sql.in 2018-09-11 09:19:58 UTC (rev 16747)
+++ trunk/extensions/postgis_raster/unpackaged_check.sql.in 2018-09-11 09:20:04 UTC (rev 16748)
@@ -1,14 +0,0 @@
-DO $$
-DECLARE
- ver TEXT;
-BEGIN
- ver := split_part(postgis_raster_scripts_installed(), ' ', 1);
- IF ver != '@EXTVERSION@' THEN
- RAISE EXCEPTION 'Installed PostGIS Raster version is %', ver
- USING HINT = 'Try `CREATE EXTENSION postgis_raster VERSION '''
- || ver || ''' from unpackaged`,'
- ' or source rtpostgis_upgrade.sql`';
- END IF;
-END;
-$$ LANGUAGE 'plpgsql';
-
More information about the postgis-tickets
mailing list