Don't fall off the end of perl functions

This complies with the perlcritic policy
Subroutines::RequireFinalReturn, which is a severity 4 policy. Since we
only currently check at severity level 5, the policy is raised to that
level until we move to level 4 or lower, so that any new infringements
will be caught.

A small cosmetic piece of tidying of the pgperlcritic script is
included.

Mike Blackwell

Discussion: https://postgr.es/m/CAESHdJpfFm_9wQnQ3koY3c91FoRQsO-fh02za9R3OEMndOn84A@mail.gmail.com
This commit is contained in:
Andrew Dunstan 2018-05-27 09:08:42 -04:00
parent 8a56ff4848
commit 3a7cc727c7
47 changed files with 208 additions and 4 deletions

View File

@ -36,6 +36,7 @@ SELECT * FROM tst WHERE i = 7 AND t = 'e';
my $standby_result = $node_standby->safe_psql("postgres", $queries); my $standby_result = $node_standby->safe_psql("postgres", $queries);
is($master_result, $standby_result, "$test_name: query result matches"); is($master_result, $standby_result, "$test_name: query result matches");
return;
} }
# Initialize master node # Initialize master node

View File

@ -83,4 +83,5 @@ sub copytable
while (<$fff>) { print; } while (<$fff>) { print; }
close $fff; close $fff;
print "\\.\n"; print "\\.\n";
return;
} }

View File

@ -367,6 +367,7 @@ sub RenameTempFile
{ {
rename($temp_name, $final_name) || die "rename: $temp_name: $!"; rename($temp_name, $final_name) || die "rename: $temp_name: $!";
} }
return;
} }
# Find a symbol defined in a particular header file and extract the value. # Find a symbol defined in a particular header file and extract the value.

View File

@ -649,6 +649,7 @@ sub gen_pg_attribute
} }
} }
} }
return;
} }
# Given $pgattr_schema (the pg_attribute schema for a catalog sufficient for # Given $pgattr_schema (the pg_attribute schema for a catalog sufficient for
@ -706,6 +707,7 @@ sub morph_row_for_pgattr
} }
Catalog::AddDefaultValues($row, $pgattr_schema, 'pg_attribute'); Catalog::AddDefaultValues($row, $pgattr_schema, 'pg_attribute');
return;
} }
# Write an entry to postgres.bki. # Write an entry to postgres.bki.
@ -744,6 +746,7 @@ sub print_bki_insert
push @bki_values, $bki_value; push @bki_values, $bki_value;
} }
printf $bki "insert %s( %s )\n", $oid, join(' ', @bki_values); printf $bki "insert %s( %s )\n", $oid, join(' ', @bki_values);
return;
} }
# Given a row reference, modify it so that it becomes a valid entry for # Given a row reference, modify it so that it becomes a valid entry for
@ -786,6 +789,7 @@ sub morph_row_for_schemapg
# Only the fixed-size portions of the descriptors are ever used. # Only the fixed-size portions of the descriptors are ever used.
delete $row->{$attname} if $column->{is_varlen}; delete $row->{$attname} if $column->{is_varlen};
} }
return;
} }
# Perform OID lookups on an array of OID names. # Perform OID lookups on an array of OID names.

View File

@ -18,6 +18,7 @@ sub error
{ {
print STDERR @_; print STDERR @_;
$errors = 1; $errors = 1;
return;
} }
$, = ' '; # set output field separator $, = ' '; # set output field separator

View File

@ -99,6 +99,7 @@ sub print_conversion_tables
$charset); $charset);
print_conversion_tables_direction($this_script, $csname, TO_UNICODE, print_conversion_tables_direction($this_script, $csname, TO_UNICODE,
$charset); $charset);
return;
} }
############################################################################# #############################################################################
@ -160,6 +161,7 @@ sub print_conversion_tables_direction
} }
close($out); close($out);
return;
} }
sub print_from_utf8_combined_map sub print_from_utf8_combined_map
@ -194,6 +196,7 @@ sub print_from_utf8_combined_map
} }
print $out "\t/* $last_comment */" if ($verbose && $last_comment ne ""); print $out "\t/* $last_comment */" if ($verbose && $last_comment ne "");
print $out "\n};\n"; print $out "\n};\n";
return;
} }
sub print_to_utf8_combined_map sub print_to_utf8_combined_map
@ -230,6 +233,7 @@ sub print_to_utf8_combined_map
} }
print $out "\t/* $last_comment */" if ($verbose && $last_comment ne ""); print $out "\t/* $last_comment */" if ($verbose && $last_comment ne "");
print $out "\n};\n"; print $out "\n};\n";
return;
} }
####################################################################### #######################################################################
@ -625,6 +629,7 @@ sub print_radix_table
if ($off != $tblsize) { die "table size didn't match!"; } if ($off != $tblsize) { die "table size didn't match!"; }
print $out "};\n"; print $out "};\n";
return;
} }
### ###

View File

@ -130,6 +130,8 @@ swapfunc(SortTuple *a, SortTuple *b, size_t n)
#define vecswap(a, b, n) if ((n) > 0) swapfunc(a, b, n) #define vecswap(a, b, n) if ((n) > 0) swapfunc(a, b, n)
EOM EOM
return;
} }
sub emit_qsort_implementation sub emit_qsort_implementation
@ -263,4 +265,6 @@ loop:
} }
} }
EOM EOM
return;
} }

View File

@ -21,6 +21,7 @@ sub create_files
print $file 'CONTENT'; print $file 'CONTENT';
close $file; close $file;
} }
return;
} }
create_files(); create_files();
@ -89,6 +90,7 @@ sub run_check
"$test_name: newer WAL file was not cleaned up"); "$test_name: newer WAL file was not cleaned up");
ok(-f "$tempdir/unrelated_file", ok(-f "$tempdir/unrelated_file",
"$test_name: unrelated file was not cleaned up"); "$test_name: unrelated file was not cleaned up");
return;
} }
run_check('', 'pg_archivecleanup'); run_check('', 'pg_archivecleanup');

View File

@ -71,6 +71,7 @@ sub master_psql
system_or_bail 'psql', '-q', '--no-psqlrc', '-d', system_or_bail 'psql', '-q', '--no-psqlrc', '-d',
$node_master->connstr('postgres'), '-c', "$cmd"; $node_master->connstr('postgres'), '-c', "$cmd";
return;
} }
sub standby_psql sub standby_psql
@ -79,6 +80,7 @@ sub standby_psql
system_or_bail 'psql', '-q', '--no-psqlrc', '-d', system_or_bail 'psql', '-q', '--no-psqlrc', '-d',
$node_standby->connstr('postgres'), '-c', "$cmd"; $node_standby->connstr('postgres'), '-c', "$cmd";
return;
} }
# Run a query against the master, and check that the output matches what's # Run a query against the master, and check that the output matches what's
@ -112,6 +114,7 @@ sub check_query
$stdout =~ s/\r//g if $Config{osname} eq 'msys'; $stdout =~ s/\r//g if $Config{osname} eq 'msys';
is($stdout, $expected_stdout, "$test_name: query result matches"); is($stdout, $expected_stdout, "$test_name: query result matches");
} }
return;
} }
sub setup_cluster sub setup_cluster
@ -130,6 +133,7 @@ sub setup_cluster
'postgresql.conf', qq( 'postgresql.conf', qq(
wal_keep_segments = 20 wal_keep_segments = 20
)); ));
return;
} }
sub start_master sub start_master
@ -138,6 +142,8 @@ sub start_master
#### Now run the test-specific parts to initialize the master before setting #### Now run the test-specific parts to initialize the master before setting
# up standby # up standby
return;
} }
sub create_standby sub create_standby
@ -162,6 +168,8 @@ recovery_target_timeline='latest'
# The standby may have WAL to apply before it matches the primary. That # The standby may have WAL to apply before it matches the primary. That
# is fine, because no test examines the standby before promotion. # is fine, because no test examines the standby before promotion.
return;
} }
sub promote_standby sub promote_standby
@ -183,6 +191,8 @@ sub promote_standby
# after promotion so quickly that when pg_rewind runs, the standby has not # after promotion so quickly that when pg_rewind runs, the standby has not
# performed a checkpoint after promotion yet. # performed a checkpoint after promotion yet.
standby_psql("checkpoint"); standby_psql("checkpoint");
return;
} }
sub run_pg_rewind sub run_pg_rewind
@ -266,6 +276,8 @@ recovery_target_timeline='latest'
$node_master->start; $node_master->start;
#### Now run the test-specific parts to check the result #### Now run the test-specific parts to check the result
return;
} }
# Clean up after the test. Stop both servers, if they're still running. # Clean up after the test. Stop both servers, if they're still running.
@ -273,6 +285,7 @@ sub clean_rewind_test
{ {
$node_master->teardown_node if defined $node_master; $node_master->teardown_node if defined $node_master;
$node_standby->teardown_node if defined $node_standby; $node_standby->teardown_node if defined $node_standby;
return;
} }
1; 1;

View File

@ -97,6 +97,7 @@ in master, before promotion
} }
RewindTest::clean_rewind_test(); RewindTest::clean_rewind_test();
return;
} }
# Run the test in both modes # Run the test in both modes

View File

@ -53,6 +53,7 @@ template1
} }
RewindTest::clean_rewind_test(); RewindTest::clean_rewind_test();
return;
} }
# Run the test in both modes. # Run the test in both modes.

View File

@ -81,6 +81,7 @@ sub run_test
"file lists match"); "file lists match");
RewindTest::clean_rewind_test(); RewindTest::clean_rewind_test();
return;
} }
# Run the test in both modes. # Run the test in both modes.

View File

@ -72,6 +72,7 @@ in standby, after promotion
'table content'); 'table content');
RewindTest::clean_rewind_test(); RewindTest::clean_rewind_test();
return;
} }
# Run the test in both modes # Run the test in both modes

View File

@ -42,6 +42,8 @@ sub pgbench
# cleanup? # cleanup?
#unlink @filenames or die "cannot unlink files (@filenames): $!"; #unlink @filenames or die "cannot unlink files (@filenames): $!";
return;
} }
# Test concurrent insertion into table with UNIQUE oid column. DDL expects # Test concurrent insertion into table with UNIQUE oid column. DDL expects
@ -817,6 +819,7 @@ sub check_pgbench_logs
}; };
} }
ok(unlink(@logs), "remove log files"); ok(unlink(@logs), "remove log files");
return;
} }
my $bdir = $node->basedir; my $bdir = $node->basedir;

View File

@ -24,6 +24,7 @@ sub pgbench
print STDERR "opts=$opts, stat=$stat, out=$out, err=$err, name=$name"; print STDERR "opts=$opts, stat=$stat, out=$out, err=$err, name=$name";
command_checks_all([ 'pgbench', split(/\s+/, $opts) ], command_checks_all([ 'pgbench', split(/\s+/, $opts) ],
$stat, $out, $err, $name); $stat, $out, $err, $name);
return;
} }
# invoke pgbench with scripts # invoke pgbench with scripts
@ -48,6 +49,7 @@ sub pgbench_scripts
} }
} }
command_checks_all(\@cmd, $stat, $out, $err, $name); command_checks_all(\@cmd, $stat, $out, $err, $name);
return;
} }
# #

View File

@ -207,6 +207,7 @@ sub strip_default_values
{ {
delete $row->{pronargs} if defined $row->{proargtypes}; delete $row->{pronargs} if defined $row->{proargtypes};
} }
return;
} }
# Format the individual elements of a Perl hash into a valid string # Format the individual elements of a Perl hash into a valid string

View File

@ -415,6 +415,7 @@ sub main
} }
} }
} }
return;
} }
@ -431,6 +432,7 @@ sub include_file
add_to_buffer($buffer, $_); add_to_buffer($buffer, $_);
} }
close($fh); close($fh);
return;
} }
sub include_addon sub include_addon
@ -472,6 +474,7 @@ sub include_addon
sub add_to_buffer sub add_to_buffer
{ {
push(@{ $buff{ $_[0] } }, "$_[1]\n"); push(@{ $buff{ $_[0] } }, "$_[1]\n");
return;
} }
sub dump_buffer sub dump_buffer
@ -480,6 +483,7 @@ sub dump_buffer
print '/* ', $buffer, ' */', "\n"; print '/* ', $buffer, ' */', "\n";
my $ref = $buff{$buffer}; my $ref = $buff{$buffer};
print @$ref; print @$ref;
return;
} }
sub dump_fields sub dump_fields
@ -582,6 +586,7 @@ sub dump_fields
add_to_buffer('rules', ' { $$ = NULL; }'); add_to_buffer('rules', ' { $$ = NULL; }');
} }
} }
return;
} }
@ -673,4 +678,5 @@ sub preload_addons
push(@{ $x->{lines} }, @code); push(@{ $x->{lines} }, @code);
} }
} }
return;
} }

View File

@ -62,6 +62,7 @@ sub ::encode_array_constructor
(my $msg = shift) =~ s/\(eval \d+\) //g; (my $msg = shift) =~ s/\(eval \d+\) //g;
chomp $msg; chomp $msg;
&::elog(&::WARNING, $msg); &::elog(&::WARNING, $msg);
return;
} }
$SIG{__WARN__} = \&plperl_warn; $SIG{__WARN__} = \&plperl_warn;

View File

@ -99,4 +99,5 @@ sub selftest
warn "Test string: $string\n"; warn "Test string: $string\n";
warn "Result : $result"; warn "Result : $result";
die "Failed!" if $result ne "$string\n"; die "Failed!" if $result ne "$string\n";
return;
} }

View File

@ -31,6 +31,7 @@ sub reset_pg_hba
unlink($node->data_dir . '/pg_hba.conf'); unlink($node->data_dir . '/pg_hba.conf');
$node->append_conf('pg_hba.conf', "local all all $hba_method"); $node->append_conf('pg_hba.conf', "local all all $hba_method");
$node->reload; $node->reload;
return;
} }
# Test access for a single role, useful to wrap all tests into one. # Test access for a single role, useful to wrap all tests into one.
@ -47,6 +48,7 @@ sub test_role
my $res = $node->psql('postgres', undef, extra_params => [ '-U', $role ]); my $res = $node->psql('postgres', undef, extra_params => [ '-U', $role ]);
is($res, $expected_res, is($res, $expected_res,
"authentication $status_string for method $method, role $role"); "authentication $status_string for method $method, role $role");
return;
} }
# Initialize master node # Initialize master node

View File

@ -27,6 +27,7 @@ sub reset_pg_hba
unlink($node->data_dir . '/pg_hba.conf'); unlink($node->data_dir . '/pg_hba.conf');
$node->append_conf('pg_hba.conf', "local all all $hba_method"); $node->append_conf('pg_hba.conf', "local all all $hba_method");
$node->reload; $node->reload;
return;
} }
# Test access for a single role, useful to wrap all tests into one. # Test access for a single role, useful to wrap all tests into one.
@ -45,6 +46,7 @@ sub test_login
is($res, $expected_res, is($res, $expected_res,
"authentication $status_string for role $role with password $password" "authentication $status_string for role $role with password $password"
); );
return;
} }
# Initialize master node. Force UTF-8 encoding, so that we can use non-ASCII # Initialize master node. Force UTF-8 encoding, so that we can use non-ASCII

View File

@ -164,6 +164,7 @@ sub test_access
'-U', $role '-U', $role
]); ]);
is($res, $expected_res, $test_name); is($res, $expected_res, $test_name);
return;
} }
unlink($node->data_dir . '/pg_hba.conf'); unlink($node->data_dir . '/pg_hba.conf');

View File

@ -144,6 +144,7 @@ sub test_access
my $res = my $res =
$node->psql('postgres', 'SELECT 1', extra_params => [ '-U', $role ]); $node->psql('postgres', 'SELECT 1', extra_params => [ '-U', $role ]);
is($res, $expected_res, $test_name); is($res, $expected_res, $test_name);
return;
} }
note "simple bind"; note "simple bind";

View File

@ -372,6 +372,7 @@ sub dump_info
{ {
my ($self) = @_; my ($self) = @_;
print $self->info; print $self->info;
return;
} }
@ -393,6 +394,7 @@ sub set_replication_conf
"host replication all $test_localhost/32 sspi include_realm=1 map=regress\n"; "host replication all $test_localhost/32 sspi include_realm=1 map=regress\n";
} }
close $hba; close $hba;
return;
} }
=pod =pod
@ -487,6 +489,7 @@ sub init
$self->set_replication_conf if $params{allows_streaming}; $self->set_replication_conf if $params{allows_streaming};
$self->enable_archiving if $params{has_archiving}; $self->enable_archiving if $params{has_archiving};
return;
} }
=pod =pod
@ -512,6 +515,8 @@ sub append_conf
chmod($self->group_access() ? 0640 : 0600, $conffile) chmod($self->group_access() ? 0640 : 0600, $conffile)
or die("unable to set permissions for $conffile"); or die("unable to set permissions for $conffile");
return;
} }
=pod =pod
@ -538,6 +543,7 @@ sub backup
TestLib::system_or_bail('pg_basebackup', '-D', $backup_path, '-p', $port, TestLib::system_or_bail('pg_basebackup', '-D', $backup_path, '-p', $port,
'--no-sync'); '--no-sync');
print "# Backup finished\n"; print "# Backup finished\n";
return;
} }
=item $node->backup_fs_hot(backup_name) =item $node->backup_fs_hot(backup_name)
@ -556,6 +562,7 @@ sub backup_fs_hot
{ {
my ($self, $backup_name) = @_; my ($self, $backup_name) = @_;
$self->_backup_fs($backup_name, 1); $self->_backup_fs($backup_name, 1);
return;
} }
=item $node->backup_fs_cold(backup_name) =item $node->backup_fs_cold(backup_name)
@ -572,6 +579,7 @@ sub backup_fs_cold
{ {
my ($self, $backup_name) = @_; my ($self, $backup_name) = @_;
$self->_backup_fs($backup_name, 0); $self->_backup_fs($backup_name, 0);
return;
} }
@ -612,6 +620,7 @@ sub _backup_fs
} }
print "# Backup finished\n"; print "# Backup finished\n";
return;
} }
@ -672,6 +681,7 @@ port = $port
)); ));
$self->enable_streaming($root_node) if $params{has_streaming}; $self->enable_streaming($root_node) if $params{has_streaming};
$self->enable_restoring($root_node) if $params{has_restoring}; $self->enable_restoring($root_node) if $params{has_restoring};
return;
} }
=pod =pod
@ -703,6 +713,7 @@ sub start
} }
$self->_update_pid(1); $self->_update_pid(1);
return;
} }
=pod =pod
@ -728,6 +739,7 @@ sub stop
print "### Stopping node \"$name\" using mode $mode\n"; print "### Stopping node \"$name\" using mode $mode\n";
TestLib::system_or_bail('pg_ctl', '-D', $pgdata, '-m', $mode, 'stop'); TestLib::system_or_bail('pg_ctl', '-D', $pgdata, '-m', $mode, 'stop');
$self->_update_pid(0); $self->_update_pid(0);
return;
} }
=pod =pod
@ -746,6 +758,7 @@ sub reload
my $name = $self->name; my $name = $self->name;
print "### Reloading node \"$name\"\n"; print "### Reloading node \"$name\"\n";
TestLib::system_or_bail('pg_ctl', '-D', $pgdata, 'reload'); TestLib::system_or_bail('pg_ctl', '-D', $pgdata, 'reload');
return;
} }
=pod =pod
@ -767,6 +780,7 @@ sub restart
TestLib::system_or_bail('pg_ctl', '-D', $pgdata, '-l', $logfile, TestLib::system_or_bail('pg_ctl', '-D', $pgdata, '-l', $logfile,
'restart'); 'restart');
$self->_update_pid(1); $self->_update_pid(1);
return;
} }
=pod =pod
@ -787,6 +801,7 @@ sub promote
print "### Promoting node \"$name\"\n"; print "### Promoting node \"$name\"\n";
TestLib::system_or_bail('pg_ctl', '-D', $pgdata, '-l', $logfile, TestLib::system_or_bail('pg_ctl', '-D', $pgdata, '-l', $logfile,
'promote'); 'promote');
return;
} }
# Internal routine to enable streaming replication on a standby node. # Internal routine to enable streaming replication on a standby node.
@ -802,6 +817,7 @@ sub enable_streaming
primary_conninfo='$root_connstr application_name=$name' primary_conninfo='$root_connstr application_name=$name'
standby_mode=on standby_mode=on
)); ));
return;
} }
# Internal routine to enable archive recovery command on a standby node # Internal routine to enable archive recovery command on a standby node
@ -830,6 +846,7 @@ sub enable_restoring
restore_command = '$copy_command' restore_command = '$copy_command'
standby_mode = on standby_mode = on
)); ));
return;
} }
# Internal routine to enable archiving # Internal routine to enable archiving
@ -859,6 +876,7 @@ sub enable_archiving
archive_mode = on archive_mode = on
archive_command = '$copy_command' archive_command = '$copy_command'
)); ));
return;
} }
# Internal method # Internal method
@ -885,6 +903,7 @@ sub _update_pid
# Complain if we expected to find a pidfile. # Complain if we expected to find a pidfile.
BAIL_OUT("postmaster.pid unexpectedly not present") if $is_running; BAIL_OUT("postmaster.pid unexpectedly not present") if $is_running;
return;
} }
=pod =pod
@ -1014,7 +1033,7 @@ sub teardown_node
my $self = shift; my $self = shift;
$self->stop('immediate'); $self->stop('immediate');
return;
} }
=pod =pod
@ -1030,6 +1049,7 @@ sub clean_node
my $self = shift; my $self = shift;
rmtree $self->{_basedir} unless defined $self->{_pid}; rmtree $self->{_basedir} unless defined $self->{_pid};
return;
} }
=pod =pod
@ -1351,6 +1371,7 @@ sub command_ok
local $ENV{PGPORT} = $self->port; local $ENV{PGPORT} = $self->port;
TestLib::command_ok(@_); TestLib::command_ok(@_);
return;
} }
=pod =pod
@ -1368,6 +1389,7 @@ sub command_fails
local $ENV{PGPORT} = $self->port; local $ENV{PGPORT} = $self->port;
TestLib::command_fails(@_); TestLib::command_fails(@_);
return;
} }
=pod =pod
@ -1385,6 +1407,7 @@ sub command_like
local $ENV{PGPORT} = $self->port; local $ENV{PGPORT} = $self->port;
TestLib::command_like(@_); TestLib::command_like(@_);
return;
} }
=pod =pod
@ -1402,6 +1425,7 @@ sub command_checks_all
local $ENV{PGPORT} = $self->port; local $ENV{PGPORT} = $self->port;
TestLib::command_checks_all(@_); TestLib::command_checks_all(@_);
return;
} }
=pod =pod
@ -1427,6 +1451,7 @@ sub issues_sql_like
ok($result, "@$cmd exit code 0"); ok($result, "@$cmd exit code 0");
my $log = TestLib::slurp_file($self->logfile); my $log = TestLib::slurp_file($self->logfile);
like($log, $expected_sql, "$test_name: SQL found in server log"); like($log, $expected_sql, "$test_name: SQL found in server log");
return;
} }
=pod =pod
@ -1445,6 +1470,7 @@ sub run_log
local $ENV{PGPORT} = $self->port; local $ENV{PGPORT} = $self->port;
TestLib::run_log(@_); TestLib::run_log(@_);
return;
} }
=pod =pod
@ -1548,6 +1574,7 @@ sub wait_for_catchup
$self->poll_query_until('postgres', $query) $self->poll_query_until('postgres', $query)
or croak "timed out waiting for catchup"; or croak "timed out waiting for catchup";
print "done\n"; print "done\n";
return;
} }
=pod =pod
@ -1590,6 +1617,7 @@ sub wait_for_slot_catchup
$self->poll_query_until('postgres', $query) $self->poll_query_until('postgres', $query)
or croak "timed out waiting for catchup"; or croak "timed out waiting for catchup";
print "done\n"; print "done\n";
return;
} }
=pod =pod

View File

@ -13,7 +13,7 @@ use strict;
sub TIEHANDLE sub TIEHANDLE
{ {
my $self = shift; my $self = shift;
bless \@_, $self; return bless \@_, $self;
} }
sub PRINT sub PRINT

View File

@ -194,6 +194,7 @@ sub system_or_bail
{ {
BAIL_OUT("system $_[0] failed"); BAIL_OUT("system $_[0] failed");
} }
return;
} }
sub run_log sub run_log
@ -244,6 +245,7 @@ sub append_to_file
or die "could not write \"$filename\": $!"; or die "could not write \"$filename\": $!";
print $fh $str; print $fh $str;
close $fh; close $fh;
return;
} }
# Check that all file/dir modes in a directory match the expected values, # Check that all file/dir modes in a directory match the expected values,
@ -338,6 +340,7 @@ sub chmod_recursive
} }
}, },
$dir); $dir);
return;
} }
# Check presence of a given regexp within pg_config.h for the installation # Check presence of a given regexp within pg_config.h for the installation
@ -366,6 +369,7 @@ sub command_ok
my ($cmd, $test_name) = @_; my ($cmd, $test_name) = @_;
my $result = run_log($cmd); my $result = run_log($cmd);
ok($result, $test_name); ok($result, $test_name);
return;
} }
sub command_fails sub command_fails
@ -373,6 +377,7 @@ sub command_fails
my ($cmd, $test_name) = @_; my ($cmd, $test_name) = @_;
my $result = run_log($cmd); my $result = run_log($cmd);
ok(!$result, $test_name); ok(!$result, $test_name);
return;
} }
sub command_exit_is sub command_exit_is
@ -394,6 +399,7 @@ sub command_exit_is
? ($h->full_results)[0] ? ($h->full_results)[0]
: $h->result(0); : $h->result(0);
is($result, $expected, $test_name); is($result, $expected, $test_name);
return;
} }
sub program_help_ok sub program_help_ok
@ -406,6 +412,7 @@ sub program_help_ok
ok($result, "$cmd --help exit code 0"); ok($result, "$cmd --help exit code 0");
isnt($stdout, '', "$cmd --help goes to stdout"); isnt($stdout, '', "$cmd --help goes to stdout");
is($stderr, '', "$cmd --help nothing to stderr"); is($stderr, '', "$cmd --help nothing to stderr");
return;
} }
sub program_version_ok sub program_version_ok
@ -418,6 +425,7 @@ sub program_version_ok
ok($result, "$cmd --version exit code 0"); ok($result, "$cmd --version exit code 0");
isnt($stdout, '', "$cmd --version goes to stdout"); isnt($stdout, '', "$cmd --version goes to stdout");
is($stderr, '', "$cmd --version nothing to stderr"); is($stderr, '', "$cmd --version nothing to stderr");
return;
} }
sub program_options_handling_ok sub program_options_handling_ok
@ -430,6 +438,7 @@ sub program_options_handling_ok
'2>', \$stderr; '2>', \$stderr;
ok(!$result, "$cmd with invalid option nonzero exit code"); ok(!$result, "$cmd with invalid option nonzero exit code");
isnt($stderr, '', "$cmd with invalid option prints error message"); isnt($stderr, '', "$cmd with invalid option prints error message");
return;
} }
sub command_like sub command_like
@ -441,6 +450,7 @@ sub command_like
ok($result, "$test_name: exit code 0"); ok($result, "$test_name: exit code 0");
is($stderr, '', "$test_name: no stderr"); is($stderr, '', "$test_name: no stderr");
like($stdout, $expected_stdout, "$test_name: matches"); like($stdout, $expected_stdout, "$test_name: matches");
return;
} }
sub command_like_safe sub command_like_safe
@ -460,6 +470,7 @@ sub command_like_safe
ok($result, "$test_name: exit code 0"); ok($result, "$test_name: exit code 0");
is($stderr, '', "$test_name: no stderr"); is($stderr, '', "$test_name: no stderr");
like($stdout, $expected_stdout, "$test_name: matches"); like($stdout, $expected_stdout, "$test_name: matches");
return;
} }
sub command_fails_like sub command_fails_like
@ -470,6 +481,7 @@ sub command_fails_like
my $result = IPC::Run::run $cmd, '>', \$stdout, '2>', \$stderr; my $result = IPC::Run::run $cmd, '>', \$stdout, '2>', \$stderr;
ok(!$result, "$test_name: exit code not 0"); ok(!$result, "$test_name: exit code not 0");
like($stderr, $expected_stderr, "$test_name: matches"); like($stderr, $expected_stderr, "$test_name: matches");
return;
} }
# Run a command and check its status and outputs. # Run a command and check its status and outputs.
@ -509,6 +521,8 @@ sub command_checks_all
{ {
like($stderr, $re, "$test_name stderr /$re/"); like($stderr, $re, "$test_name stderr /$re/");
} }
return;
} }
1; 1;

View File

@ -97,6 +97,8 @@ sub test_target_session_attrs
1, 1,
"connect to node $target_name if mode \"$mode\" and $node1_name,$node2_name listed" "connect to node $target_name if mode \"$mode\" and $node1_name,$node2_name listed"
); );
return;
} }
# Connect to master in "read-write" mode with master,standby1 list. # Connect to master in "read-write" mode with master,standby1 list.
@ -195,6 +197,7 @@ sub replay_check
$node_standby_2->safe_psql('postgres', $node_standby_2->safe_psql('postgres',
qq[SELECT 1 FROM replayed WHERE val = $newval]) qq[SELECT 1 FROM replayed WHERE val = $newval])
or die "standby_2 didn't replay standby_1 value $newval"; or die "standby_2 didn't replay standby_1 value $newval";
return;
} }
replay_check(); replay_check();

View File

@ -41,6 +41,8 @@ sub test_recovery_standby
# Stop standby node # Stop standby node
$node_standby->teardown_node; $node_standby->teardown_node;
return;
} }
# Initialize master node # Initialize master node

View File

@ -24,6 +24,7 @@ sub test_sync_state
} }
ok($self->poll_query_until('postgres', $check_sql, $expected), $msg); ok($self->poll_query_until('postgres', $check_sql, $expected), $msg);
return;
} }
# Initialize master node # Initialize master node

View File

@ -20,6 +20,7 @@ sub configure_and_reload
)); ));
$node->psql('postgres', "SELECT pg_reload_conf()", stdout => \$psql_out); $node->psql('postgres', "SELECT pg_reload_conf()", stdout => \$psql_out);
is($psql_out, 't', "reload node $name with $parameter"); is($psql_out, 't', "reload node $name with $parameter");
return;
} }
# Set up two nodes, which will alternately be master and replication standby. # Set up two nodes, which will alternately be master and replication standby.

View File

@ -47,6 +47,7 @@ sub test_connect_ok
]; ];
command_ok($cmd, $test_name); command_ok($cmd, $test_name);
return;
} }
sub test_connect_fails sub test_connect_fails
@ -60,6 +61,7 @@ sub test_connect_fails
]; ];
command_fails_like($cmd, $expected_stderr, $test_name); command_fails_like($cmd, $expected_stderr, $test_name);
return;
} }
# Copy a set of files, taking into account wildcards # Copy a set of files, taking into account wildcards
@ -75,6 +77,7 @@ sub copy_files
copy($orig_file, "$dest/$base_file") copy($orig_file, "$dest/$base_file")
or die "Could not copy $orig_file to $dest"; or die "Could not copy $orig_file to $dest";
} }
return;
} }
sub configure_test_server_for_ssl sub configure_test_server_for_ssl
@ -130,6 +133,8 @@ sub configure_test_server_for_ssl
# Change pg_hba after restart because hostssl requires ssl=on # Change pg_hba after restart because hostssl requires ssl=on
configure_hba_for_ssl($node, $serverhost, $authmethod); configure_hba_for_ssl($node, $serverhost, $authmethod);
return;
} }
# Change the configuration to use given server cert file, and reload # Change the configuration to use given server cert file, and reload
@ -150,6 +155,7 @@ sub switch_server_cert
close $sslconf; close $sslconf;
$node->restart; $node->restart;
return;
} }
sub configure_hba_for_ssl sub configure_hba_for_ssl
@ -173,4 +179,7 @@ sub configure_hba_for_ssl
print $hba print $hba
"hostssl certdb all ::1/128 cert\n"; "hostssl certdb all ::1/128 cert\n";
close $hba; close $hba;
return;
} }
1;

View File

@ -62,6 +62,7 @@ sub wanted
$line =~ s/$cc (\d{4}), $pgdg/$ccliteral $1-$year, $pgdg/i; $line =~ s/$cc (\d{4}), $pgdg/$ccliteral $1-$year, $pgdg/i;
} }
untie @lines; untie @lines;
return;
} }
print "Manually update:\n"; print "Manually update:\n";

View File

@ -333,6 +333,7 @@ sub push_commit
push @{ $all_commits_by_branch{ $c->{'branch'} } }, $cc; push @{ $all_commits_by_branch{ $c->{'branch'} } }, $cc;
$cc->{'branch_position'}{ $c->{'branch'} } = $cc->{'branch_position'}{ $c->{'branch'} } =
-1 + @{ $all_commits_by_branch{ $c->{'branch'} } }; -1 + @{ $all_commits_by_branch{ $c->{'branch'} } };
return;
} }
sub hash_commit sub hash_commit
@ -355,6 +356,7 @@ sub parse_datetime
sub output_str sub output_str
{ {
($oldest_first) ? ($output_line .= sprintf(shift, @_)) : printf(@_); ($oldest_first) ? ($output_line .= sprintf(shift, @_)) : printf(@_);
return;
} }
sub output_details sub output_details
@ -395,6 +397,7 @@ sub output_details
} }
} }
output_str("\n"); output_str("\n");
return;
} }
sub usage sub usage

View File

@ -40,6 +40,7 @@ sub lcopy
copy($src, $target) copy($src, $target)
|| confess "Could not copy $src to $target\n"; || confess "Could not copy $src to $target\n";
return;
} }
sub Install sub Install
@ -173,6 +174,7 @@ sub Install
GenerateNLSFiles($target, $config->{nls}, $majorver) if ($config->{nls}); GenerateNLSFiles($target, $config->{nls}, $majorver) if ($config->{nls});
print "Installation complete.\n"; print "Installation complete.\n";
return;
} }
sub EnsureDirectories sub EnsureDirectories
@ -183,6 +185,7 @@ sub EnsureDirectories
{ {
mkdir $target . '/' . $d unless -d ($target . '/' . $d); mkdir $target . '/' . $d unless -d ($target . '/' . $d);
} }
return;
} }
sub CopyFiles sub CopyFiles
@ -200,6 +203,7 @@ sub CopyFiles
lcopy($f, $target . basename($f)); lcopy($f, $target . basename($f));
} }
print "\n"; print "\n";
return;
} }
sub CopySetOfFiles sub CopySetOfFiles
@ -215,6 +219,7 @@ sub CopySetOfFiles
lcopy($_, $tgt) || croak "Could not copy $_: $!\n"; lcopy($_, $tgt) || croak "Could not copy $_: $!\n";
} }
print "\n"; print "\n";
return;
} }
sub CopySolutionOutput sub CopySolutionOutput
@ -340,6 +345,7 @@ sub CopySolutionOutput
print "."; print ".";
} }
print "\n"; print "\n";
return;
} }
sub GenerateConversionScript sub GenerateConversionScript
@ -377,6 +383,7 @@ sub GenerateConversionScript
print $F $sql; print $F $sql;
close($F); close($F);
print "\n"; print "\n";
return;
} }
sub GenerateTimezoneFiles sub GenerateTimezoneFiles
@ -408,6 +415,7 @@ sub GenerateTimezoneFiles
system(@args); system(@args);
print "\n"; print "\n";
return;
} }
sub GenerateTsearchFiles sub GenerateTsearchFiles
@ -449,6 +457,7 @@ sub GenerateTsearchFiles
} }
close($F); close($F);
print "\n"; print "\n";
return;
} }
sub CopyContribFiles sub CopyContribFiles
@ -475,6 +484,7 @@ sub CopyContribFiles
} }
} }
print "\n"; print "\n";
return;
} }
sub CopySubdirFiles sub CopySubdirFiles
@ -561,6 +571,7 @@ sub CopySubdirFiles
print '.'; print '.';
} }
} }
return;
} }
sub ParseAndCleanRule sub ParseAndCleanRule
@ -676,6 +687,7 @@ sub CopyIncludeFiles
$target . '/include/informix/esql/', $target . '/include/informix/esql/',
'src/interfaces/ecpg/include/', 'src/interfaces/ecpg/include/',
split /\s+/, $1); split /\s+/, $1);
return;
} }
sub GenerateNLSFiles sub GenerateNLSFiles
@ -719,6 +731,7 @@ sub GenerateNLSFiles
} }
} }
print "\n"; print "\n";
return;
} }
sub DetermineMajorVersion sub DetermineMajorVersion

View File

@ -80,6 +80,7 @@ EOF
strpool => 'true', strpool => 'true',
runtime => 'MultiThreadedDLL' runtime => 'MultiThreadedDLL'
}); });
return;
} }
sub AddDefine sub AddDefine
@ -87,6 +88,7 @@ sub AddDefine
my ($self, $def) = @_; my ($self, $def) = @_;
$self->{defines} .= $def . ';'; $self->{defines} .= $def . ';';
return;
} }
sub WriteReferences sub WriteReferences
@ -112,6 +114,7 @@ EOF
</ItemGroup> </ItemGroup>
EOF EOF
} }
return;
} }
sub WriteFiles sub WriteFiles
@ -223,6 +226,7 @@ EOF
</ItemGroup> </ItemGroup>
EOF EOF
} }
return;
} }
sub WriteConfigurationHeader sub WriteConfigurationHeader
@ -234,6 +238,7 @@ sub WriteConfigurationHeader
<Platform>$self->{platform}</Platform> <Platform>$self->{platform}</Platform>
</ProjectConfiguration> </ProjectConfiguration>
EOF EOF
return;
} }
sub WriteConfigurationPropertyGroup sub WriteConfigurationPropertyGroup
@ -252,6 +257,7 @@ sub WriteConfigurationPropertyGroup
<WholeProgramOptimization>$p->{wholeopt}</WholeProgramOptimization> <WholeProgramOptimization>$p->{wholeopt}</WholeProgramOptimization>
</PropertyGroup> </PropertyGroup>
EOF EOF
return;
} }
sub WritePropertySheetsPropertyGroup sub WritePropertySheetsPropertyGroup
@ -262,6 +268,7 @@ sub WritePropertySheetsPropertyGroup
<Import Project="\$(UserRootDir)\\Microsoft.Cpp.\$(Platform).user.props" Condition="exists('\$(UserRootDir)\\Microsoft.Cpp.\$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="\$(UserRootDir)\\Microsoft.Cpp.\$(Platform).user.props" Condition="exists('\$(UserRootDir)\\Microsoft.Cpp.\$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup> </ImportGroup>
EOF EOF
return;
} }
sub WriteAdditionalProperties sub WriteAdditionalProperties
@ -272,6 +279,7 @@ sub WriteAdditionalProperties
<IntDir Condition="'\$(Configuration)|\$(Platform)'=='$cfgname|$self->{platform}'">.\\$cfgname\\$self->{name}\\</IntDir> <IntDir Condition="'\$(Configuration)|\$(Platform)'=='$cfgname|$self->{platform}'">.\\$cfgname\\$self->{name}\\</IntDir>
<LinkIncremental Condition="'\$(Configuration)|\$(Platform)'=='$cfgname|$self->{platform}'">false</LinkIncremental> <LinkIncremental Condition="'\$(Configuration)|\$(Platform)'=='$cfgname|$self->{platform}'">false</LinkIncremental>
EOF EOF
return;
} }
sub WriteItemDefinitionGroup sub WriteItemDefinitionGroup
@ -364,6 +372,7 @@ EOF
print $f <<EOF; print $f <<EOF;
</ItemDefinitionGroup> </ItemDefinitionGroup>
EOF EOF
return;
} }
sub Footer sub Footer
@ -377,6 +386,7 @@ sub Footer
</ImportGroup> </ImportGroup>
</Project> </Project>
EOF EOF
return;
} }
package VC2010Project; package VC2010Project;
@ -441,6 +451,7 @@ sub WriteConfigurationPropertyGroup
<PlatformToolset>$self->{PlatformToolset}</PlatformToolset> <PlatformToolset>$self->{PlatformToolset}</PlatformToolset>
</PropertyGroup> </PropertyGroup>
EOF EOF
return;
} }
package VC2013Project; package VC2013Project;

View File

@ -964,6 +964,7 @@ sub AddContrib
# Are there any output data files to build? # Are there any output data files to build?
GenerateContribSqlFiles($n, $mf); GenerateContribSqlFiles($n, $mf);
return;
} }
sub GenerateContribSqlFiles sub GenerateContribSqlFiles
@ -1010,6 +1011,7 @@ sub GenerateContribSqlFiles
} }
} }
} }
return;
} }
sub AdjustContribProj sub AdjustContribProj
@ -1020,6 +1022,7 @@ sub AdjustContribProj
\@contrib_uselibpq, \@contrib_uselibpgport, \@contrib_uselibpq, \@contrib_uselibpgport,
\@contrib_uselibpgcommon, $contrib_extralibs, \@contrib_uselibpgcommon, $contrib_extralibs,
$contrib_extrasource, $contrib_extraincludes); $contrib_extrasource, $contrib_extraincludes);
return;
} }
sub AdjustFrontendProj sub AdjustFrontendProj
@ -1030,6 +1033,7 @@ sub AdjustFrontendProj
\@frontend_uselibpq, \@frontend_uselibpgport, \@frontend_uselibpq, \@frontend_uselibpgport,
\@frontend_uselibpgcommon, $frontend_extralibs, \@frontend_uselibpgcommon, $frontend_extralibs,
$frontend_extrasource, $frontend_extraincludes); $frontend_extrasource, $frontend_extraincludes);
return;
} }
sub AdjustModule sub AdjustModule
@ -1086,6 +1090,7 @@ sub AdjustModule
$proj->AddFile($i); $proj->AddFile($i);
} }
} }
return;
} }
END END

View File

@ -45,6 +45,7 @@ sub AddFile
my ($self, $filename) = @_; my ($self, $filename) = @_;
$self->{files}->{$filename} = 1; $self->{files}->{$filename} = 1;
return;
} }
sub AddFiles sub AddFiles
@ -56,6 +57,7 @@ sub AddFiles
{ {
$self->{files}->{ $dir . "/" . $f } = 1; $self->{files}->{ $dir . "/" . $f } = 1;
} }
return;
} }
sub ReplaceFile sub ReplaceFile
@ -110,6 +112,7 @@ sub RelocateFiles
$self->AddFile($targetdir . '/' . basename($f)); $self->AddFile($targetdir . '/' . basename($f));
} }
} }
return;
} }
sub AddReference sub AddReference
@ -122,6 +125,7 @@ sub AddReference
$self->AddLibrary( $self->AddLibrary(
"__CFGNAME__/" . $ref->{name} . "/" . $ref->{name} . ".lib"); "__CFGNAME__/" . $ref->{name} . "/" . $ref->{name} . ".lib");
} }
return;
} }
sub AddLibrary sub AddLibrary
@ -138,6 +142,7 @@ sub AddLibrary
{ {
push @{ $self->{suffixlib} }, $lib; push @{ $self->{suffixlib} }, $lib;
} }
return;
} }
sub AddIncludeDir sub AddIncludeDir
@ -149,6 +154,7 @@ sub AddIncludeDir
$self->{includes} .= ';'; $self->{includes} .= ';';
} }
$self->{includes} .= $inc; $self->{includes} .= $inc;
return;
} }
sub AddPrefixInclude sub AddPrefixInclude
@ -156,6 +162,7 @@ sub AddPrefixInclude
my ($self, $inc) = @_; my ($self, $inc) = @_;
$self->{prefixincludes} = $inc . ';' . $self->{prefixincludes}; $self->{prefixincludes} = $inc . ';' . $self->{prefixincludes};
return;
} }
sub AddDefine sub AddDefine
@ -164,6 +171,7 @@ sub AddDefine
$def =~ s/"/&quot;&quot;/g; $def =~ s/"/&quot;&quot;/g;
$self->{defines} .= $def . ';'; $self->{defines} .= $def . ';';
return;
} }
sub FullExportDLL sub FullExportDLL
@ -173,6 +181,7 @@ sub FullExportDLL
$self->{builddef} = 1; $self->{builddef} = 1;
$self->{def} = "./__CFGNAME__/$self->{name}/$self->{name}.def"; $self->{def} = "./__CFGNAME__/$self->{name}/$self->{name}.def";
$self->{implib} = "__CFGNAME__/$self->{name}/$libname"; $self->{implib} = "__CFGNAME__/$self->{name}/$libname";
return;
} }
sub UseDef sub UseDef
@ -180,6 +189,7 @@ sub UseDef
my ($self, $def) = @_; my ($self, $def) = @_;
$self->{def} = $def; $self->{def} = $def;
return;
} }
sub AddDir sub AddDir
@ -284,6 +294,7 @@ sub AddDir
} }
$self->AddDirResourceFile($reldir); $self->AddDirResourceFile($reldir);
return;
} }
# If the directory's Makefile bears a description string, add a resource file. # If the directory's Makefile bears a description string, add a resource file.
@ -299,6 +310,7 @@ sub AddDirResourceFile
if ($mf =~ /^PGAPPICON\s*=\s*(.*)$/m) { $ico = $1; } if ($mf =~ /^PGAPPICON\s*=\s*(.*)$/m) { $ico = $1; }
$self->AddResourceFile($reldir, $desc, $ico); $self->AddResourceFile($reldir, $desc, $ico);
} }
return;
} }
sub AddResourceFile sub AddResourceFile
@ -332,6 +344,7 @@ sub AddResourceFile
close($i); close($i);
} }
$self->AddFile("$dir/win32ver.rc"); $self->AddFile("$dir/win32ver.rc");
return;
} }
sub DisableLinkerWarnings sub DisableLinkerWarnings
@ -341,6 +354,7 @@ sub DisableLinkerWarnings
$self->{disablelinkerwarnings} .= ',' $self->{disablelinkerwarnings} .= ','
unless ($self->{disablelinkerwarnings} eq ''); unless ($self->{disablelinkerwarnings} eq '');
$self->{disablelinkerwarnings} .= $warnings; $self->{disablelinkerwarnings} .= $warnings;
return;
} }
sub Save sub Save
@ -366,6 +380,7 @@ sub Save
$self->WriteFiles($f); $self->WriteFiles($f);
$self->Footer($f); $self->Footer($f);
close($f); close($f);
return;
} }
sub GetAdditionalLinkerDependencies sub GetAdditionalLinkerDependencies

View File

@ -75,6 +75,7 @@ sub DeterminePlatform
$? >> 8 == 0 or die "cl command not found"; $? >> 8 == 0 or die "cl command not found";
$self->{platform} = ($output =~ /^\/favor:<.+AMD64/m) ? 'x64' : 'Win32'; $self->{platform} = ($output =~ /^\/favor:<.+AMD64/m) ? 'x64' : 'Win32';
print "Detected hardware platform: $self->{platform}\n"; print "Detected hardware platform: $self->{platform}\n";
return;
} }
# Return 1 if $oldfile is newer than $newfile, or if $newfile doesn't exist. # Return 1 if $oldfile is newer than $newfile, or if $newfile doesn't exist.
@ -112,6 +113,7 @@ sub copyFile
} }
close($i); close($i);
close($o); close($o);
return;
} }
sub GenerateFiles sub GenerateFiles
@ -533,6 +535,7 @@ EOF
<!ENTITY majorversion "$self->{majorver}"> <!ENTITY majorversion "$self->{majorver}">
EOF EOF
close($o); close($o);
return;
} }
sub GenerateDefFile sub GenerateDefFile
@ -555,6 +558,7 @@ sub GenerateDefFile
close($of); close($of);
close($if); close($if);
} }
return;
} }
sub AddProject sub AddProject
@ -727,6 +731,7 @@ EOF
EndGlobal EndGlobal
EOF EOF
close($sln); close($sln);
return;
} }
sub GetFakeConfigure sub GetFakeConfigure

View File

@ -56,6 +56,7 @@ EOF
</Configurations> </Configurations>
EOF EOF
$self->WriteReferences($f); $self->WriteReferences($f);
return;
} }
sub WriteFiles sub WriteFiles
@ -152,6 +153,7 @@ EOF
print $f <<EOF; print $f <<EOF;
</Files> </Files>
EOF EOF
return;
} }
sub Footer sub Footer
@ -162,6 +164,7 @@ sub Footer
<Globals/> <Globals/>
</VisualStudioProject> </VisualStudioProject>
EOF EOF
return;
} }
sub WriteConfiguration sub WriteConfiguration
@ -227,6 +230,7 @@ EOF
print $f <<EOF; print $f <<EOF;
</Configuration> </Configuration>
EOF EOF
return;
} }
sub WriteReferences sub WriteReferences
@ -239,6 +243,7 @@ sub WriteReferences
" <ProjectReference ReferencedProjectIdentifier=\"$ref->{guid}\" Name=\"$ref->{name}\" />\n"; " <ProjectReference ReferencedProjectIdentifier=\"$ref->{guid}\" Name=\"$ref->{name}\" />\n";
} }
print $f " </References>\n"; print $f " </References>\n";
return;
} }
sub GenerateCustomTool sub GenerateCustomTool

View File

@ -107,7 +107,7 @@ sub renamefiles
move $f, $nf; move $f, $nf;
} }
chdir $savedir; chdir $savedir;
return;
} }
sub missing sub missing

View File

@ -20,6 +20,7 @@ sub dumpsyms
system("dumpbin /symbols /out:$tmpfile $_ >NUL") system("dumpbin /symbols /out:$tmpfile $_ >NUL")
&& die "Could not call dumpbin"; && die "Could not call dumpbin";
rename($tmpfile, $symfile); rename($tmpfile, $symfile);
return;
} }
# Given a symbol file path, loops over its contents # Given a symbol file path, loops over its contents
@ -116,6 +117,7 @@ sub extract_syms
$def->{ $pieces[6] } = $pieces[3]; $def->{ $pieces[6] } = $pieces[3];
} }
close($f); close($f);
return;
} }
sub writedef sub writedef
@ -143,6 +145,7 @@ sub writedef
} }
} }
close($fh); close($fh);
return;
} }

View File

@ -111,6 +111,7 @@ sub installcheck
system(@args); system(@args);
my $status = $? >> 8; my $status = $? >> 8;
exit $status if $status; exit $status if $status;
return;
} }
sub check sub check
@ -132,6 +133,7 @@ sub check
system(@args); system(@args);
my $status = $? >> 8; my $status = $? >> 8;
exit $status if $status; exit $status if $status;
return;
} }
sub ecpgcheck sub ecpgcheck
@ -157,6 +159,7 @@ sub ecpgcheck
system(@args); system(@args);
$status = $? >> 8; $status = $? >> 8;
exit $status if $status; exit $status if $status;
return;
} }
sub isolationcheck sub isolationcheck
@ -173,6 +176,7 @@ sub isolationcheck
system(@args); system(@args);
my $status = $? >> 8; my $status = $? >> 8;
exit $status if $status; exit $status if $status;
return;
} }
sub tap_check sub tap_check
@ -224,6 +228,7 @@ sub bincheck
$mstat ||= $status; $mstat ||= $status;
} }
exit $mstat if $mstat; exit $mstat if $mstat;
return;
} }
sub taptest sub taptest
@ -244,6 +249,7 @@ sub taptest
InstallTemp(); InstallTemp();
my $status = tap_check(@args); my $status = tap_check(@args);
exit $status if $status; exit $status if $status;
return;
} }
sub mangle_plpython3 sub mangle_plpython3
@ -365,6 +371,7 @@ sub plcheck
} }
chdir "$topdir"; chdir "$topdir";
return;
} }
sub subdircheck sub subdircheck
@ -413,6 +420,7 @@ sub subdircheck
print join(' ', @args), "\n"; print join(' ', @args), "\n";
system(@args); system(@args);
chdir ".."; chdir "..";
return;
} }
sub contribcheck sub contribcheck
@ -434,6 +442,7 @@ sub contribcheck
$mstat ||= $status; $mstat ||= $status;
} }
exit $mstat if $mstat; exit $mstat if $mstat;
return;
} }
sub modulescheck sub modulescheck
@ -447,6 +456,7 @@ sub modulescheck
$mstat ||= $status; $mstat ||= $status;
} }
exit $mstat if $mstat; exit $mstat if $mstat;
return;
} }
sub recoverycheck sub recoverycheck
@ -457,6 +467,7 @@ sub recoverycheck
my $dir = "$topdir/src/test/recovery"; my $dir = "$topdir/src/test/recovery";
my $status = tap_check($dir); my $status = tap_check($dir);
exit $status if $status; exit $status if $status;
return;
} }
# Run "initdb", then reconfigure authentication. # Run "initdb", then reconfigure authentication.
@ -501,6 +512,7 @@ sub generate_db
system('createdb', quote_system_arg($dbname)); system('createdb', quote_system_arg($dbname));
my $status = $? >> 8; my $status = $? >> 8;
exit $status if $status; exit $status if $status;
return;
} }
sub upgradecheck sub upgradecheck
@ -586,6 +598,7 @@ sub upgradecheck
print "dumps not identical!\n"; print "dumps not identical!\n";
exit(1); exit(1);
} }
return;
} }
sub fetchRegressOpts sub fetchRegressOpts
@ -680,6 +693,7 @@ sub InstallTemp
Install("$tmp_installdir", "all", $config); Install("$tmp_installdir", "all", $config);
} }
$ENV{PATH} = "$tmp_installdir/bin;$ENV{PATH}"; $ENV{PATH} = "$tmp_installdir/bin;$ENV{PATH}";
return;
} }
sub usage sub usage

View File

@ -297,4 +297,6 @@ sub checkit
print "$file references $symbol, defined in @places\n"; print "$file references $symbol, defined in @places\n";
# print "includes: @includes\n"; # print "includes: @includes\n";
return;
} }

View File

@ -93,6 +93,8 @@ sub check_indent
"You appear to have GNU indent rather than BSD indent.\n"; "You appear to have GNU indent rather than BSD indent.\n";
exit 1; exit 1;
} }
return;
} }
@ -162,6 +164,7 @@ sub process_exclude
} }
close($eh); close($eh);
} }
return;
} }
@ -189,6 +192,7 @@ sub write_source
|| die "cannot open file \"$source_filename\": $!\n"; || die "cannot open file \"$source_filename\": $!\n";
print $src_fh $source; print $src_fh $source;
close($src_fh); close($src_fh);
return;
} }
@ -316,6 +320,7 @@ sub diff
. $pre_fh->filename . " " . $pre_fh->filename . " "
. $post_fh->filename . $post_fh->filename
. " >&2"); . " >&2");
return;
} }
@ -361,6 +366,7 @@ sub run_build
$ENV{PGINDENT} = abs_path('pg_bsd_indent'); $ENV{PGINDENT} = abs_path('pg_bsd_indent');
chdir $save_dir; chdir $save_dir;
return;
} }
@ -382,6 +388,7 @@ sub build_clean
system("rm -rf src/tools/pgindent/pg_bsd_indent"); system("rm -rf src/tools/pgindent/pg_bsd_indent");
system("rm -f src/tools/pgindent/tmp_typedefs.list"); system("rm -f src/tools/pgindent/tmp_typedefs.list");
return;
} }

View File

@ -12,3 +12,8 @@ theme = core
# allow octal constants with leading zeros # allow octal constants with leading zeros
[-ValuesAndExpressions::ProhibitLeadingZeros] [-ValuesAndExpressions::ProhibitLeadingZeros]
# for now raise severity of this to level 5
[Subroutines::RequireFinalReturn]
severity = 5

View File

@ -15,7 +15,7 @@ PERLCRITIC=${PERLCRITIC:-perlcritic}
# locate all Perl files in the tree # locate all Perl files in the tree
{ {
# take all .pl and .pm files # take all .pl and .pm files
find . -type f -a \( -name '*.pl' -o -name '*.pm' \) -print find . -type f -name '*.p[lm]' -print
# take executable files that file(1) thinks are perl files # take executable files that file(1) thinks are perl files
find . -type f -perm -100 -exec file {} \; -print | find . -type f -perm -100 -exec file {} \; -print |
egrep -i ':.*perl[0-9]*\>' | egrep -i ':.*perl[0-9]*\>' |

View File

@ -141,4 +141,5 @@ sub sed_file
or die "mv failed: $?"; or die "mv failed: $?";
$fixedfiles .= "\t$filename\n"; $fixedfiles .= "\t$filename\n";
return;
} }