[postgis-tickets] r16345 - Include minor upgrade in sfcgal unpackaged upgrade

Sandro Santilli strk at kbt.io
Sat Jan 20 01:20:45 PST 2018


Author: strk
Date: 2018-01-20 01:20:44 -0800 (Sat, 20 Jan 2018)
New Revision: 16345

Modified:
   trunk/extensions/postgis_sfcgal/Makefile.in
Log:
Include minor upgrade in sfcgal unpackaged upgrade

Closes #3913 again (for sfcgal) and hopefully fixes #4000

Modified: trunk/extensions/postgis_sfcgal/Makefile.in
===================================================================
--- trunk/extensions/postgis_sfcgal/Makefile.in	2018-01-20 08:32:44 UTC (rev 16344)
+++ trunk/extensions/postgis_sfcgal/Makefile.in	2018-01-20 09:20:44 UTC (rev 16345)
@@ -33,6 +33,12 @@
 EXTENSION_UPGRADE_SCRIPTS = \
 	sql_bits/sfcgal_upgrade_minor.sql
 
+# Scripts making up the extension upgrade-from-unpackaged file
+# NOTE: order matters
+EXTENSION_UNPACKAGED_UPGRADE_SCRIPTS = \
+	sql_bits/sfcgal.sql \
+	../../utils/create_unpackaged.pl
+
 PG_CONFIG    =  @PG_CONFIG@
 
 SQL_BITS     = $(wildcard sql_bits/*.sql)
@@ -40,6 +46,9 @@
 
 all: sql/$(EXTENSION)--$(EXTVERSION).sql sql/$(EXTENSION)--unpackaged--$(EXTVERSION).sql sql/$(EXTENSION)--ANY--$(EXTVERSION).sql
 
+sql:
+	mkdir -p $@
+
 $(EXTENSION).control: $(EXTENSION).control.in Makefile
 	cat $< \
 		| sed -e 's|@EXTVERSION@|$(EXTVERSION)|g' \
@@ -75,9 +84,12 @@
 #grep all lines that start with CREATE OR REPLACE FUNCTION, TRIGGER...
 #then replace CREATE OR REPLACE .. with ALTER EXTENSION..;
 #then remove default values and extra junk
-sql/$(EXTENSION)--unpackaged--$(EXTVERSION).sql: sql_bits/sfcgal.sql ../../utils/create_unpackaged.pl
-	mkdir -p sql
-	cat $< |  $(PERL) ../../utils/create_unpackaged.pl ${EXTENSION} > $@
+sql/$(EXTENSION)--unpackaged--$(EXTVERSION).sql: $(EXTENSION_UNPACKAGED_UPGRADE_SCRIPTS) sql/$(EXTENSION)--ANY--$(EXTVERSION).sql ../../utils/create_unpackaged.pl Makefile | sql
+	# Ensure version is correct
+	cat sql/$(EXTENSION)--ANY--$(EXTVERSION).sql > $@
+	cat $(EXTENSION_UNPACKAGED_UPGRADE_SCRIPTS) \
+		| $(PERL) ../../utils/create_unpackaged.pl ${EXTENSION} \
+		>> $@
 
 sql_bits/sfcgal_upgrade.sql : ../../postgis/sfcgal_upgrade.sql
 	mkdir -p sql_bits



More information about the postgis-tickets mailing list