From dd569214aa7d057a9676c49ddbf2da74ad9924e3 Mon Sep 17 00:00:00 2001 From: Michael Paquier Date: Wed, 3 Jul 2024 12:43:57 +0900 Subject: [PATCH] Clean up more unused variables in perl code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a continuation of 0c1aca461481, with some cleanup in: - msvc_gendef.pl - pgindent - 005_negotiate_encryption.pl, as of an oversight of d39a49c1e459 that has removed %params in test_matrix(), making also $server_config useless. Author: Dagfinn Ilmari Mannsåker Discussion: https://postgr.es/m/87wmm4dkci.fsf@wibble.ilmari.org --- .../libpq/t/005_negotiate_encryption.pl | 24 +++++-------------- src/tools/msvc_gendef.pl | 2 -- src/tools/pgindent/pgindent | 3 +-- 3 files changed, 7 insertions(+), 22 deletions(-) diff --git a/src/interfaces/libpq/t/005_negotiate_encryption.pl b/src/interfaces/libpq/t/005_negotiate_encryption.pl index c3f70d31bc..251c405926 100644 --- a/src/interfaces/libpq/t/005_negotiate_encryption.pl +++ b/src/interfaces/libpq/t/005_negotiate_encryption.pl @@ -215,11 +215,6 @@ my @all_gssencmodes = ('disable', 'prefer', 'require'); my @all_sslmodes = ('disable', 'allow', 'prefer', 'require'); my @all_sslnegotiations = ('postgres', 'direct'); -my $server_config = { - server_ssl => 0, - server_gss => 0, -}; - ### ### Run tests with GSS and SSL disabled in the server ### @@ -272,7 +267,7 @@ testuser require * * - -> fail }; note("Running tests with SSL and GSS disabled in the server"); -test_matrix($node, $server_config, +test_matrix($node, ['testuser'], \@all_gssencmodes, \@all_sslmodes, \@all_sslnegotiations, parse_table($test_table)); @@ -311,19 +306,15 @@ nossluser . disable postgres connect, authok # Enable SSL in the server $node->adjust_conf('postgresql.conf', 'ssl', 'on'); $node->reload; - $server_config->{server_ssl} = 1; note("Running tests with SSL enabled in server"); - test_matrix( - $node, $server_config, - [ 'testuser', 'ssluser', 'nossluser' ], ['disable'], - \@all_sslmodes, \@all_sslnegotiations, + test_matrix($node, [ 'testuser', 'ssluser', 'nossluser' ], + ['disable'], \@all_sslmodes, \@all_sslnegotiations, parse_table($test_table)); # Disable SSL again $node->adjust_conf('postgresql.conf', 'ssl', 'off'); $node->reload; - $server_config->{server_ssl} = 0; } ### @@ -336,7 +327,6 @@ SKIP: $krb->create_principal('gssuser', $gssuser_password); $krb->create_ticket('gssuser', $gssuser_password); - $server_config->{server_gss} = 1; $test_table = q{ # USER GSSENCMODE SSLMODE SSLNEGOTIATION EVENTS -> OUTCOME @@ -400,7 +390,7 @@ nogssuser disable disable postgres connect, authok } note("Running tests with GSS enabled in server"); - test_matrix($node, $server_config, [ 'testuser', 'gssuser', 'nogssuser' ], + test_matrix($node, [ 'testuser', 'gssuser', 'nogssuser' ], \@all_gssencmodes, $sslmodes, $sslnegotiations, parse_table($test_table)); } @@ -423,7 +413,6 @@ SKIP: # Enable SSL $node->adjust_conf('postgresql.conf', 'ssl', 'on'); $node->reload; - $server_config->{server_ssl} = 1; $test_table = q{ # USER GSSENCMODE SSLMODE SSLNEGOTIATION EVENTS -> OUTCOME @@ -510,7 +499,6 @@ nossluser disable disable postgres connect, authok note("Running tests with both GSS and SSL enabled in server"); test_matrix( $node, - $server_config, [ 'testuser', 'gssuser', 'ssluser', 'nogssuser', 'nossluser' ], \@all_gssencmodes, \@all_sslmodes, @@ -546,8 +534,8 @@ sub test_matrix { local $Test::Builder::Level = $Test::Builder::Level + 1; - my ($pg_node, $node_conf, - $test_users, $gssencmodes, $sslmodes, $sslnegotiations, %expected) + my ($pg_node, $test_users, $gssencmodes, $sslmodes, $sslnegotiations, + %expected) = @_; foreach my $test_user (@{$test_users}) diff --git a/src/tools/msvc_gendef.pl b/src/tools/msvc_gendef.pl index 404076dbbc..97346cc892 100644 --- a/src/tools/msvc_gendef.pl +++ b/src/tools/msvc_gendef.pl @@ -6,8 +6,6 @@ use warnings FATAL => 'all'; use List::Util qw(min); use Getopt::Long; -my @def; - # # Script that generates a .DEF file for all objects in a directory # diff --git a/src/tools/pgindent/pgindent b/src/tools/pgindent/pgindent index 48d83bc434..77c8118e5d 100755 --- a/src/tools/pgindent/pgindent +++ b/src/tools/pgindent/pgindent @@ -21,8 +21,7 @@ my $indent_opts = my $devnull = File::Spec->devnull; -my ($typedefs_file, $typedef_str, @excludes, - $indent, $build, $diff, +my ($typedefs_file, $typedef_str, @excludes, $indent, $diff, $check, $help, @commits,); $help = 0;