[postgis-tickets] r16253 - Refactor sfcgal extension script to use generic include

Sandro Santilli strk at kbt.io
Wed Jan 10 09:57:47 PST 2018


Author: strk
Date: 2018-01-10 21:57:47 -0800 (Wed, 10 Jan 2018)
New Revision: 16253

Modified:
   trunk/extensions/postgis_sfcgal/Makefile.in
   trunk/extensions/postgis_sfcgal/postgis_sfcgal.control.in
Log:
Refactor sfcgal extension script to use generic include

This is an attempt to fix upgrade test on Debbie, saying:
ERROR:  extension "postgis_sfcgal" does not exist

ref: https://debbie.postgis.net/job/PostGIS_Regress/8259/console

Modified: trunk/extensions/postgis_sfcgal/Makefile.in
===================================================================
--- trunk/extensions/postgis_sfcgal/Makefile.in	2018-01-11 05:57:38 UTC (rev 16252)
+++ trunk/extensions/postgis_sfcgal/Makefile.in	2018-01-11 05:57:47 UTC (rev 16253)
@@ -22,15 +22,28 @@
                         $(GREP) "[a-zA-Z]" | \
                         $(PERL) -pe 's/(\d+[a-zA-Z]+)\d*/\1/'
 
-DATA         = $(filter-out $(wildcard sql/*--*.sql),$(wildcard sql/*.sql))
+DATA_built = \
+	$(EXTENSION).control \
+	sql/$(EXTENSION)--$(EXTVERSION).sql \
+	sql/$(EXTENSION)--unpackaged--$(EXTVERSION).sql \
+	$(NULL)
 
+# Scripts making up the extension minor upgrade file
+# NOTE: order matters
+EXTENSION_UPGRADE_SCRIPTS = \
+	sql_bits/sfcgal_upgrade_minor.sql
+
 PG_CONFIG    =  @PG_CONFIG@
 
 SQL_BITS     = $(wildcard sql_bits/*.sql)
 EXTRA_CLEAN += sql/*.sql ${SQL_BITS}
 
+all: sql/$(EXTENSION)--$(EXTVERSION).sql sql/$(EXTENSION)--unpackaged--$(EXTVERSION).sql sql/$(EXTENSION)--ANY--$(EXTVERSION).sql
 
-all: sql/$(EXTENSION)--$(EXTVERSION).sql sql/$(EXTENSION)--unpackaged--$(EXTVERSION).sql sql/$(EXTENSION)--$(EXTVERSION)--$(EXTVERSION)next.sql sql/$(EXTENSION)--$(EXTVERSION)next--$(EXTVERSION).sql sql_minor_upgrade
+$(EXTENSION).control: $(EXTENSION).control.in Makefile
+	cat $< \
+		| sed -e 's|@EXTVERSION@|$(EXTVERSION)|g' \
+		> $@
 
 sql/$(EXTENSION)--$(EXTVERSION).sql: sql/$(EXTENSION).sql
 	mkdir -p sql
@@ -75,13 +88,10 @@
 	printf '\\echo Use "CREATE EXTENSION $(EXTENSION)" to load this file. \\quit\n' > $@
 	cat $^ >> $@
 
-sql_minor_upgrade: sql_bits/sfcgal_upgrade_minor.sql
-	for OLD_VERSION in $(UPGRADEABLE_VERSIONS); do \
-  	  cat $< > sql/$(EXTENSION)--$$OLD_VERSION--$(EXTVERSION).sql; \
-	done
+sql/$(EXTENSION)--ANY--$(EXTVERSION).sql: $(EXTENSION_UPGRADE_SCRIPTS)
+	cat $(EXTENSION_UPGRADE_SCRIPTS) > $@
 
-DATA = $(wildcard sql/*--*.sql)
-EXTRA_CLEAN += sql/$(EXTENSION)--$(EXTVERSION).sql sql/$(EXTENSION)--unpackaged--$(EXTVERSION).sql
+include ../upgrade-paths-rules.mk
 
 distclean: clean
 	rm Makefile

Modified: trunk/extensions/postgis_sfcgal/postgis_sfcgal.control.in
===================================================================
--- trunk/extensions/postgis_sfcgal/postgis_sfcgal.control.in	2018-01-11 05:57:38 UTC (rev 16252)
+++ trunk/extensions/postgis_sfcgal/postgis_sfcgal.control.in	2018-01-11 05:57:47 UTC (rev 16253)
@@ -1,5 +1,5 @@
 # postgis topology extension
 comment = 'PostGIS SFCGAL functions'
-default_version = '@POSTGIS_LIB_VERSION@'
+default_version = '@EXTVERSION@'
 relocatable = true
 requires = postgis



More information about the postgis-tickets mailing list