[postgis-tickets] r15928 - Use variables more (generic cleanup)

Sandro Santilli strk at kbt.io
Sat Oct 7 06:39:31 PDT 2017


Author: strk
Date: 2017-10-07 06:39:31 -0700 (Sat, 07 Oct 2017)
New Revision: 15928

Modified:
   trunk/extensions/postgis/Makefile.in
Log:
Use variables more (generic cleanup)

Modified: trunk/extensions/postgis/Makefile.in
===================================================================
--- trunk/extensions/postgis/Makefile.in	2017-10-06 22:00:40 UTC (rev 15927)
+++ trunk/extensions/postgis/Makefile.in	2017-10-07 13:39:31 UTC (rev 15928)
@@ -29,8 +29,32 @@
 	sql/$(EXTENSION)--unpackaged--$(EXTVERSION).sql \
 	$(NULL)
 
-UPGRADE_SCRIPTS = $(wildcard sql/*--*.sql)
+# Scripts making up the extension file
+# NOTE: order matters
+EXTENSION_SCRIPTS = \
+	sql_bits/postgis.sql \
+	sql_bits/postgis_comments.sql \
+	sql_bits/rtpostgis.sql \
+	sql_bits/spatial_ref_sys_config_dump.sql \
+	sql_bits/raster_comments.sql \
+	sql_bits/spatial_ref_sys.sql
 
+# Scripts making up the extension minor upgrade file
+# NOTE: order matters
+EXTENSION_UPGRADE_SCRIPTS = \
+	../postgis_extension_helper.sql \
+	sql_bits/postgis_upgrade.sql \
+	sql_bits/rtpostgis_upgrade.sql \
+	../../doc/raster_comments.sql \
+	../../doc/postgis_comments.sql \
+	../postgis_extension_helper_uninstall.sql
+
+# Scripts making up the extension upgrade-from-unpackaged file
+# NOTE: order matters
+EXTENSION_UNPACKAGED_UPGRADE_SCRIPTS = \
+	sql_bits/postgis.sql \
+	sql_bits/rtpostgis.sql
+
 #DOCS         = $(wildcard ../../doc/html/*.html)
 PG_CONFIG    = @PG_CONFIG@
 
@@ -41,7 +65,7 @@
 
 all: sql/$(EXTENSION)--$(EXTVERSION).sql sql/$(EXTENSION)--unpackaged--$(EXTVERSION).sql
 
-sql/$(EXTENSION).sql: sql_bits/postgis.sql sql_bits/postgis_comments.sql sql_bits/rtpostgis.sql sql_bits/spatial_ref_sys_config_dump.sql sql_bits/raster_comments.sql sql_bits/spatial_ref_sys.sql
+sql/$(EXTENSION).sql: $(EXTENSION_SCRIPTS)
 	mkdir -p sql
 	printf '\\echo Use "CREATE EXTENSION $(EXTENSION)" to load this file. \\quit\n' > $@
 	cat $^ >> $@
@@ -57,9 +81,9 @@
 	mkdir -p sql
 	cp $< $@
 
-sql/$(EXTENSION)--unpackaged--$(EXTVERSION).sql: sql_bits/postgis.sql sql_bits/rtpostgis.sql ../../utils/create_unpackaged.pl
+sql/$(EXTENSION)--unpackaged--$(EXTVERSION).sql: $(EXTENSION_UNPACKAGED_UPGRADE_SCRIPTS) ../../utils/create_unpackaged.pl
 	mkdir -p sql
-	cat ../../postgis/postgis.sql ../../raster/rt_pg/rtpostgis.sql | $(PERL) ../../utils/create_unpackaged.pl postgis > $@
+	cat $(EXTENSION_UNPACKAGED_UPGRADE_SCRIPTS) | $(PERL) ../../utils/create_unpackaged.pl postgis > $@
 
 #strip BEGIN/COMMIT since these are not allowed in extensions
 sql_bits/spatial_ref_sys.sql: ../../spatial_ref_sys.sql
@@ -98,7 +122,7 @@
 	cp $< $@
 
 #postgis_extension_upgrade_minor.sql is the one that contains both postgis AND raster
-sql_bits/postgis_extension_upgrade_minor.sql: ../postgis_extension_helper.sql sql_bits/postgis_upgrade.sql sql_bits/rtpostgis_upgrade.sql ../../doc/raster_comments.sql ../../doc/postgis_comments.sql ../postgis_extension_helper_uninstall.sql
+sql_bits/postgis_extension_upgrade_minor.sql: $(EXTENSION_UPGRADE_SCRIPTS)
 	printf '\\echo Use "CREATE EXTENSION $(EXTENSION)" to load this file. \\quit\n' > $@
 	cat $^ >> $@
 



More information about the postgis-tickets mailing list