[postgis-tickets] [SCM] PostGIS branch master updated. 3.4.0rc1-690-gd9a7a30ed

git at osgeo.org git at osgeo.org
Tue Oct 17 09:13:29 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  d9a7a30ed20ba0b747805b9fd95e0f2ace838b2b (commit)
      from  20a22b1a63fdd2ed062872cfceda23ca6bc339c3 (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 d9a7a30ed20ba0b747805b9fd95e0f2ace838b2b
Author: Sandro Santilli <strk at kbt.io>
Date:   Tue Oct 17 17:55:31 2023 +0200

    Handle deprecated functions in create_skip_signature
    
    References #5574 #5575 in master branch (3.5.0dev)

diff --git a/utils/create_skip_signatures.pl b/utils/create_skip_signatures.pl
index 81696964e..231ddae71 100644
--- a/utils/create_skip_signatures.pl
+++ b/utils/create_skip_signatures.pl
@@ -109,6 +109,39 @@ sub canonicalize_args {
 	return @out;
 }
 
+sub handle_function_signature {
+	my $line = shift;
+
+	$line = lc($line);
+	$line =~ s/topology\.//g;
+
+	$line =~ m/ *([^\( ]*) *\((.*)\)/ or die "Unexpected FUNCTION signature: $line";
+
+	my $name = $1;
+	my $args = $2;
+	$args =~ s/\s*$//; # trim trailing blanks
+	$args =~ s/^\s*//; # trim leading blanks
+
+	my @args = split('\s*,\s*', $args);
+	@args = canonicalize_args(@args);
+
+	print "COMMENT FUNCTION $name(" . join(', ', @args) .")\n";
+
+	# 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";
+}
+
 while (<>)
 {
 	#print "XXX 0 $_";
@@ -157,33 +190,31 @@ while (<>)
 		# at some point
 		$line =~ s/ *--.*//;
 
-		$line = lc($line);
-		$line =~ s/topology\.//g;
+		handle_function_signature($line);
+	}
 
-		$line =~ m/ *([^\( ]*) *\((.*)\)/ or die "Unexpected DROP FUNCTION syntax: $origline";
+	# Deprecated function signature
+	# EXAMPLE: ALTER FUNCTION _st_concavehull( geometry ) RENAME TO _st_concavehull_deprecated_by_postgis_303;
+	elsif ( /ALTER FUNCTION .* RENAME TO .*_deprecated_by_postgis_/ )
+	{
+		my $origline = $_;
+		my $line = $origline;
 
-		my $name = $1;
-		my $args = $2;
-		$args =~ s/\s*$//; # trim trailing blanks
-		$args =~ s/^\s*//; # trim leading blanks
+		$line =~ s/ *ALTER FUNCTION (.*) RENAME TO .*_deprecated_by_postgis_.*/\1/;
 
-		my @args = split('\s*,\s*', $args);
-		@args = canonicalize_args(@args);
+		handle_function_signature($line);
+	}
 
-		print "COMMENT FUNCTION $name(" . join(', ', @args) .")\n";
+	# Deprecated function signature using
+	# _postgis_drop_function_by_signature
+	# EXAMPLE: SELECT _postgis_drop_function_by_signature('pgis_geometry_union_finalfn(internal)');
+	elsif ( /SELECT _postgis_drop_function_by_signature\('[^']*'\);/ )
+	{
+		my $origline = $_;
+		my $line = $origline;
 
-		# 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
+		$line =~ s/SELECT _postgis_drop_function_by_signature\('([^']*)'\);/\1/;
 
-		# 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";
+		handle_function_signature($line);
 	}
 }

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

Summary of changes:
 utils/create_skip_signatures.pl | 75 +++++++++++++++++++++++++++++------------
 1 file changed, 53 insertions(+), 22 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list