mirror of
https://github.com/postgres/postgres.git
synced 2025-06-16 06:01:02 +03:00
Clean up Perl code according to perlcritic
Fix all perlcritic warnings of severity level 5, except in src/backend/utils/Gen_dummy_probes.pl, which is automatically generated. Reviewed-by: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org> Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
This commit is contained in:
@ -58,8 +58,8 @@ sub Install
|
||||
|
||||
# suppress warning about harmless redeclaration of $config
|
||||
no warnings 'misc';
|
||||
require "config_default.pl";
|
||||
require "config.pl" if (-f "config.pl");
|
||||
do "config_default.pl";
|
||||
do "config.pl" if (-f "config.pl");
|
||||
}
|
||||
|
||||
chdir("../../..") if (-f "../../../configure");
|
||||
@ -367,7 +367,7 @@ sub GenerateConversionScript
|
||||
$sql .=
|
||||
"COMMENT ON CONVERSION pg_catalog.$name IS 'conversion for $se to $de';\n\n";
|
||||
}
|
||||
open($F, ">$target/share/conversion_create.sql")
|
||||
open($F, '>', "$target/share/conversion_create.sql")
|
||||
|| die "Could not write to conversion_create.sql\n";
|
||||
print $F $sql;
|
||||
close($F);
|
||||
@ -409,7 +409,7 @@ sub GenerateTsearchFiles
|
||||
$mf =~ /^LANGUAGES\s*=\s*(.*)$/m
|
||||
|| die "Could not find LANGUAGES line in snowball Makefile\n";
|
||||
my @pieces = split /\s+/, $1;
|
||||
open($F, ">$target/share/snowball_create.sql")
|
||||
open($F, '>', "$target/share/snowball_create.sql")
|
||||
|| die "Could not write snowball_create.sql";
|
||||
print $F read_file('src/backend/snowball/snowball_func.sql.in');
|
||||
|
||||
@ -735,7 +735,7 @@ sub read_file
|
||||
my $t = $/;
|
||||
|
||||
undef $/;
|
||||
open($F, $filename) || die "Could not open file $filename\n";
|
||||
open($F, '<', $filename) || die "Could not open file $filename\n";
|
||||
my $txt = <$F>;
|
||||
close($F);
|
||||
$/ = $t;
|
||||
|
Reference in New Issue
Block a user