[postgis-tickets] r15342 - Avoid a few bashisms resulting in invalid SQL files

Sandro Santilli strk at kbt.io
Fri Mar 24 13:51:33 PDT 2017


Author: strk
Date: 2017-03-24 13:51:33 -0700 (Fri, 24 Mar 2017)
New Revision: 15342

Modified:
   trunk/extensions/postgis/Makefile.in
   trunk/extensions/postgis_sfcgal/Makefile.in
Log:
Avoid a few bashisms resulting in invalid SQL files

An echo that's supposed to output a backslash works with bash, but not
in dash. Use printf, instead.

Patch by: Markus Wanner <markus at bluegap.ch>

Modified: trunk/extensions/postgis/Makefile.in
===================================================================
--- trunk/extensions/postgis/Makefile.in	2017-03-20 15:59:16 UTC (rev 15341)
+++ trunk/extensions/postgis/Makefile.in	2017-03-24 20:51:33 UTC (rev 15342)
@@ -39,7 +39,7 @@
 
 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
 	mkdir -p sql
-	echo '\echo Use "CREATE EXTENSION $(EXTENSION)" to load this file. \quit' > $@
+	printf '\\echo Use "CREATE EXTENSION $(EXTENSION)" to load this file. \\quit\n' > $@
 	cat $^ >> $@
 
 sql/$(EXTENSION)--$(EXTVERSION).sql: sql/$(EXTENSION).sql
@@ -94,7 +94,7 @@
 
 #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
-	echo '\echo Use "CREATE EXTENSION $(EXTENSION)" to load this file. \quit' > $@
+	printf '\\echo Use "CREATE EXTENSION $(EXTENSION)" to load this file. \\quit\n' > $@
 	cat $^ >> $@
 
 sql_minor_upgrade: sql_bits/postgis_extension_upgrade_minor.sql

Modified: trunk/extensions/postgis_sfcgal/Makefile.in
===================================================================
--- trunk/extensions/postgis_sfcgal/Makefile.in	2017-03-20 15:59:16 UTC (rev 15341)
+++ trunk/extensions/postgis_sfcgal/Makefile.in	2017-03-24 20:51:33 UTC (rev 15342)
@@ -74,7 +74,7 @@
 
 sql_bits/sfcgal_upgrade_minor.sql: ../postgis_extension_helper.sql sql_bits/sfcgal_upgrade.sql ../../doc/sfcgal_comments.sql ../postgis_extension_helper_uninstall.sql
 	mkdir -p sql_bits
-	echo '\echo Use "CREATE EXTENSION $(EXTENSION)" to load this file. \quit' > $@
+	printf '\\echo Use "CREATE EXTENSION $(EXTENSION)" to load this file. \\quit\n' > $@
 	cat $^ >> $@
 
 sql_minor_upgrade: sql_bits/sfcgal_upgrade_minor.sql



More information about the postgis-tickets mailing list