Clean up more unused variables in perl code
authorMichael Paquier <[email protected]>
Wed, 3 Jul 2024 03:43:57 +0000 (12:43 +0900)
committerMichael Paquier <[email protected]>
Wed, 3 Jul 2024 03:43:57 +0000 (12:43 +0900)
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/[email protected]

src/interfaces/libpq/t/005_negotiate_encryption.pl
src/tools/msvc_gendef.pl
src/tools/pgindent/pgindent

index c3f70d31bc8b217bd2e7d74642c4cd44b584f615..251c405926b1b58ec98242a38480fc2afcf63666 100644 (file)
@@ -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})
index 404076dbbc39f9e7aebbea6c643648ad5d14ea05..97346cc8929bf3fe5878126cde6b1f92f4959228 100644 (file)
@@ -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
 #
index 48d83bc434f836d1c5ca159146a909831d9bfbd7..77c8118e5d797d20f13f5993ff23cb7d9ab0f583 100755 (executable)
@@ -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;