[postgis-tickets] [SCM] PostGIS branch master updated. 3.3.0rc2-1067-gdc5503e59

git at osgeo.org git at osgeo.org
Thu Jun 29 04:43:04 PDT 2023


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "PostGIS".

The branch, master has been updated
       via  dc5503e59a8bfdb37ce80fae3a958fb2d0d474de (commit)
      from  a95900d1d576b8bf2568cda12c415f04398f4f42 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit dc5503e59a8bfdb37ce80fae3a958fb2d0d474de
Author: Sandro Santilli <strk at kbt.io>
Date:   Thu Jun 29 12:10:27 2023 +0200

    Fix skip signature of function with out and inout parameters
    
    Fixes restore of PostGIS dumps from 3.4.0 (ST_LargestEmptyCircle).
    Removes needlessly hardcoded signatures in postgis_restore.pl.in.
    Adds postgis_restore.pl code duplication check and clean targets.
    
    Closes #5415

diff --git a/.gitignore b/.gitignore
index 577e36542..17f90ed10 100644
--- a/.gitignore
+++ b/.gitignore
@@ -189,8 +189,7 @@ libpgcommon/Makefile
 libpgcommon/cunit/Makefile
 utils/Makefile
 utils/postgis_restore.pl
-utils/postgis_restore_data.generated
-utils/postgis_restore_data.hardcoded
+utils/postgis_restore_data.*
 doc/sfcgal_comments.sql
 postgis/sfcgal.sql
 postgis/uninstall_sfcgal.sql
diff --git a/utils/Makefile.in b/utils/Makefile.in
index 774724402..4e72d51b4 100644
--- a/utils/Makefile.in
+++ b/utils/Makefile.in
@@ -88,14 +88,33 @@ postgis_restore.pl: postgis_restore.pl.in postgis_restore_data.hardcoded postgis
 		| sort -u >> postgis_restore.pl
 	chmod +x $@
 
+postgis_restore_data.needlessly-hardcoded: postgis_restore_data.hardcoded postgis_restore_data.generated
+	comm -12 postgis_restore_data.hardcoded postgis_restore_data.generated > $@
+
+postgis_restore-check: postgis_restore_data.needlessly-hardcoded
+	@if test -s $<; then { \
+		echo "Needlessly hardcoded signatures found postgis_restore.pl.in:"; \
+		sed 's/^/  /' $<; \
+		echo "Use 'make postgis_restore-clean' to fix that"; \
+	} >&2 && false; fi
+
+
+postgis_restore-clean: postgis_restore_data.needlessly-hardcoded
+	mv $(srcdir)/postgis_restore.pl.in $(srcdir)/postgis_restore.pl.in~
+	grep -Fxvf $< $(srcdir)/postgis_restore.pl.in~ > $(srcdir)/postgis_restore.pl.in
+
 clean:
-	rm -f $(SCRIPTS_built) postgis_restore_data.generated postgis_restore_data.hardcoded
+	rm -f $(SCRIPTS_built) postgis_restore_data.*
 
 distclean: clean
 	rm -f Makefile
 
-# And there's nothing to check
-check check-unit check-regress:
+# There's nothing to check for regress
+check-regress:
+
+check: check-unit
+
+check-unit: postgis_restore-check
 
 installdir:
 	@mkdir -p $(DESTDIR)$(bindir)
diff --git a/utils/create_skip_signatures.pl b/utils/create_skip_signatures.pl
index 576a85c1b..81696964e 100644
--- a/utils/create_skip_signatures.pl
+++ b/utils/create_skip_signatures.pl
@@ -34,6 +34,35 @@ my %reserved_sql_word = (
 	'character' => 1
 );
 
+# Example:
+#  INPUT: inout first double precision, second integer, OUT third text, fourth bool
+# OUTPUT: first double precision, second integer, fourth bool
+sub clean_inout_arguments {
+	my @args = @_;
+	my @out;
+	#print "XXX to strip: " . join(',', @args) . "\n";
+	foreach ( @args )
+	{
+		my $a = $_;
+
+		#print "  XXX arg: [$a]\n";
+		# If the arg is composed by multiple words
+		# check for out and inout indicators
+		if ( $a =~ m/([^ ]*) (.*)/ )
+		{
+			# Skip this arg if out only
+			next if $1 eq 'out';
+
+			# Hide the inout indicator
+			$a = $2 if $1 eq 'inout';
+		}
+		#print "  XXX arg became: $a\n";
+		push @out, $a;
+	}
+	#print "XXX striped: " . join(',', @out) . "\n";
+	return @out;
+}
+
 # Example:
 #  INPUT: int,named double precision,named text
 # OUTPUT: int,double precision,text
@@ -143,9 +172,17 @@ while (<>)
 
 		print "COMMENT FUNCTION $name(" . join(', ', @args) .")\n";
 
-		# For *function* signature we are supposed to strip
-		# also argument names, which aint easy
-		my @unnamed_args = strip_argument_names(@args);
+		# Example manifest line for comments on function with inout params:
+		# 4247; 0 0 COMMENT public FUNCTION testinoutmix(INOUT "inout" double precision, second integer, OUT thirdout integer, fourth integer) strk
+
+		# Example manifest line for function with inout params:
+		# 955; 1255 27730785 FUNCTION public testinoutmix(double precision, integer, integer) strk
+
+		# No inout indicator or out parameters for function signatures
+		my @inonly_args = clean_inout_arguments(@args);
+
+		# For *function* signature we are supposed to strip argument names
+		my @unnamed_args = strip_argument_names(@inonly_args);
 
 		print "FUNCTION $name(" . join(', ', @unnamed_args) . ")\n";
 	}
diff --git a/utils/postgis_restore.pl.in b/utils/postgis_restore.pl.in
index cef63213e..c6e23ba48 100644
--- a/utils/postgis_restore.pl.in
+++ b/utils/postgis_restore.pl.in
@@ -642,10 +642,7 @@ FUNCTION jsonb(geometry)
 FUNCTION json(geometry)
 FUNCTION lockrow(text, text, text, text, timestamp without time zone)
 FUNCTION lockrow(text, text, text, timestamp without time zone)
-FUNCTION _overview_constraint_info(name, name, name)
 FUNCTION postgis_extensions_upgrade()
-FUNCTION st_asgeojson(record, text, integer, boolean)
-FUNCTION st_asmvtgeom(geometry, box2d, integer, integer, boolean)
 FUNCTION _st_aspect4ma(double precision[], integer[], text[])
 FUNCTION st_clusterkmeans(geometry, integer)
 FUNCTION st_concavehull(geometry, double precision, boolean)
@@ -657,9 +654,7 @@ FUNCTION st_force3d(geometry)
 FUNCTION st_force3dm(geometry)
 FUNCTION st_force3dz(geometry)
 FUNCTION st_force4d(geometry)
-FUNCTION st_geotransform(raster)
 FUNCTION _st_grayscale4ma(double precision[], integer[], text[])
-FUNCTION st_hexagongrid(double precision, geometry)
 FUNCTION _st_hillshade4ma(double precision[], integer[], text[])
 FUNCTION st_intersection(geometry, geometry)
 FUNCTION st_invdistweight4ma(double precision[], integer[], text[])
@@ -671,17 +666,13 @@ FUNCTION st_mapalgebra(raster, integer, regprocedure, text, text, raster, intege
 FUNCTION st_mapalgebra(raster, integer[], regprocedure, text, text, raster, integer, integer, text[])
 FUNCTION st_max4ma(double precision[], integer[], text[])
 FUNCTION st_max4ma(double precision[], text, text[])
-FUNCTION st_maximuminscribedcircle(geometry)
 FUNCTION st_mean4ma(double precision[], integer[], text[])
 FUNCTION st_mean4ma(double precision[], text, text[])
-FUNCTION st_metadata(raster)
 FUNCTION st_min4ma(double precision[], integer[], text[])
 FUNCTION st_min4ma(double precision[], text, text[])
 FUNCTION st_mindist4ma(double precision[], integer[], text[])
-FUNCTION st_minimumboundingradius(geometry)
 FUNCTION st_range4ma(double precision[], integer[], text[])
 FUNCTION st_range4ma(double precision[], text, text[])
-FUNCTION _st_rastertoworldcoord(raster, integer, integer)
 FUNCTION st_rastertoworldcoord(raster, integer, integer)
 FUNCTION _st_reclass(raster, reclassarg[])
 FUNCTION st_reclass(raster, reclassarg[])
@@ -690,7 +681,6 @@ FUNCTION st_setvalues(raster, integer, integer, integer, double precision[], boo
 FUNCTION _st_setvalues(raster, integer, integer, integer, double precision[], boolean[], boolean, double precision, boolean)
 FUNCTION st_setvalues(raster, integer, integer, integer, double precision[], double precision, boolean)
 FUNCTION _st_slope4ma(double precision[], integer[], text[])
-FUNCTION st_squaregrid(double precision, geometry)
 FUNCTION st_stddev4ma(double precision[], integer[], text[])
 FUNCTION st_stddev4ma(double precision[], text, text[])
 FUNCTION st_subdivide(geometry, integer)
@@ -701,15 +691,6 @@ FUNCTION st_tileenvelope(integer, integer, integer, geometry)
 FUNCTION _st_tpi4ma(double precision[], integer[], text[])
 FUNCTION _st_tri4ma(double precision[], integer[], text[])
 FUNCTION st_unaryunion(geometry)
-FUNCTION st_valuepercent(raster, double precision[], double precision)
-FUNCTION st_valuepercent(raster, integer, boolean, double precision[], double precision)
-FUNCTION st_valuepercent(raster, integer, double precision[], double precision)
-FUNCTION st_valuepercent(text, text, double precision[], double precision)
-FUNCTION st_valuepercent(text, text, integer, boolean, double precision[], double precision)
-FUNCTION st_valuepercent(text, text, integer, double precision[], double precision)
-FUNCTION _st_worldtorastercoord(raster, double precision, double precision)
-FUNCTION st_worldtorastercoord(raster, double precision, double precision)
-FUNCTION st_worldtorastercoord(raster, geometry)
 OPERATOR &&
 OPERATOR &&&
 OPERATOR &/&

-----------------------------------------------------------------------

Summary of changes:
 .gitignore                      |  3 +--
 utils/Makefile.in               | 25 +++++++++++++++++++++---
 utils/create_skip_signatures.pl | 43 ++++++++++++++++++++++++++++++++++++++---
 utils/postgis_restore.pl.in     | 19 ------------------
 4 files changed, 63 insertions(+), 27 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list