]> granicus.if.org Git - postgis/commitdiff
Replace use of 'sed' with 'perl -pe' to avoid sed incompatibilities on BSD-flavoured...
authorPaul Ramsey <pramsey@cleverelephant.ca>
Thu, 3 Mar 2016 21:17:13 +0000 (21:17 +0000)
committerPaul Ramsey <pramsey@cleverelephant.ca>
Thu, 3 Mar 2016 21:17:13 +0000 (21:17 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@14743 b70326c6-7e19-0410-871a-916f4a2858ee

extensions/postgis/Makefile.in
extensions/upgradeable_versions.mk

index 05b9550cab461fc138f58b9cb1b81c7e446748d0..e7c93c512c565715a56d8cace2e5c586b397f185 100644 (file)
@@ -4,20 +4,23 @@ EXTENSION     = postgis
 EXTVERSION    = @POSTGIS_LIB_VERSION@
 MINORVERSION  = @POSTGIS_MAJOR_VERSION@.@POSTGIS_MINOR_VERSION@
 GREP = @GREP@
-PERL=@PERL@
+PERL = @PERL@
+
+MICRO_NUMBER  = $(shell echo $(EXTVERSION) | \
+                                               $(PERL) -pe 's/\d.\d.(\d+)[a-zA-Z]*\d*/$1/'
 
-MICRO_NUMBER  = $(shell echo $(EXTVERSION) | sed "s/[0-9]\.[0-9]\.\([0-9]*\)[a-zA-Z]*[0-9]*/\1/")
 PREREL_NUMBER = $(shell echo $(EXTVERSION) | \
-                        sed "s/[0-9]\.[0-9]\.\(.*\)/\1/" | \
+                        $(PERL) -pe 's/\d\.\d\.(.*)/\1/' | \
                         $(GREP) "[a-zA-Z]" | \
-                        sed "s/[0-9][a-zA-Z]\([0-9]*\)[a-zA-Z]*/\1/")
+                        $(PERL) -pe 's/\d+[a-zA-Z]+(\d+)/\1/'
+
 MICRO_PREV    = $(shell if test "$(MICRO_NUMBER)x" != "x"; then expr $(MICRO_NUMBER) - 1; fi)
 PREREL_PREV   = $(shell if test "$(PREREL_NUMBER)x" != "x"; then expr $(PREREL_NUMBER) - 1; fi)
 
 PREREL_PREFIX = $(shell echo $(EXTVERSION) | \
-                        sed "s/[0-9]\.[0-9]\.\(.*\)/\1/" | \
+                        $(PERL) -pe 's/\d\.\d\.(.*)/\1/' | \
                         $(GREP) "[a-zA-Z]" | \
-                        sed "s/\([0-9][a-zA-Z]*\)[0-9]*/\1/")
+                        $(PERL) -pe 's/(\d+[a-zA-Z]+)\d*/\1/'
 
 DATA         = $(filter-out $(wildcard sql/*--*.sql),$(wildcard sql/*.sql))
 
@@ -55,12 +58,12 @@ sql/$(EXTENSION)--$(EXTVERSION)next--$(EXTVERSION).sql: sql_bits/postgis_extensi
 
 #strip BEGIN/COMMIT since these are not allowed in extensions
 sql_bits/spatial_ref_sys.sql: ../../spatial_ref_sys.sql        
-       sed -e 's/BEGIN;//g' -e 's/COMMIT;//g'  $< > $@
+       $(PERL) -pe 's/BEGIN\;//g ; s/COMMIT\;//g' $< > $@
 
 #strip BEGIN/COMMIT since these are not allowed in extensions
 sql_bits/postgis.sql: ../../postgis/postgis.sql
        mkdir -p sql_bits/
-       sed -e 's/BEGIN;//g' -e 's/COMMIT;//g'  $< > $@
+       $(PERL) -pe 's/BEGIN\;//g ; s/COMMIT\;//g' $< > $@
 
 ../../doc/postgis_comments.sql:
        $(MAKE) -C ../../doc comments
@@ -70,20 +73,16 @@ sql_bits/postgis_comments.sql: ../../doc/postgis_comments.sql
 
 #strip BEGIN/COMMIT since these are not allowed in extensions
 sql_bits/rtpostgis.sql: ../../raster/rt_pg/rtpostgis.sql
-       sed -e 's/BEGIN;//g' -e 's/COMMIT;//g'  $< > $@
+       $(PERL) -pe 's/BEGIN\;//g ; s/COMMIT\;//g' $< > $@
 
 sql_bits/spatial_ref_sys_config_dump.sql: ../../spatial_ref_sys.sql ../../utils/create_spatial_ref_sys_config_dump.pl
        ../../utils/create_spatial_ref_sys_config_dump.pl $< > $@
 
 sql_bits/rtpostgis_upgrade.sql: ../../raster/rt_pg/rtpostgis_upgrade.sql
-       sed -e 's/BEGIN;//g' -e 's/COMMIT;//g' \
-                 -e "s/^\(DROP .*\);/SELECT postgis_extension_drop_if_exists('${EXTENSION}', '\1');\n\1;/" \
-       $< > $@
+       $(PERL) -pe "s/BEGIN\;//g ; s/COMMIT\;//g; s/^(DROP .*)\;/SELECT postgis_extension_drop_if_exists('$(EXTENSION)', '\1');\n\1\;/" $< > $@
 
 sql_bits/postgis_upgrade.sql: ../../postgis/postgis_upgrade.sql 
-                sed -e 's/BEGIN;//g' -e 's/COMMIT;//g' \
-                    -e "s/^\(DROP .*\);/SELECT postgis_extension_drop_if_exists('${EXTENSION}', '\1');\n\1;/" \
-                $< > $@
+       $(PERL) -pe "s/BEGIN\;//g ; s/COMMIT\;//g; s/^(DROP .*)\;/SELECT postgis_extension_drop_if_exists('$(EXTENSION)', '\1');\n\1\;/" $< > $@
 
 
 ../../doc/raster_comments.sql:
@@ -111,4 +110,4 @@ distclean: clean
 
 PGXS := $(shell $(PG_CONFIG) --pgxs)
 include $(PGXS)
-PERL=@PERL@
+PERL = @PERL@
index 94d87001c2bcd4a4c9e20c51c7c8698984bd9648..93c2eeac35fc933f563aecffac371038dccc43f3 100644 (file)
@@ -18,7 +18,8 @@ UPGRADEABLE_VERSIONS = \
        2.1.8 \
        2.1.9 \
        2.2.0 \
-       2.2.1
+       2.2.1 \
+       2.2.2
 
 # This is to avoid forcing "check-installed-upgrades" as a default
 # rule, see https://trac.osgeo.org/postgis/ticket/3420