1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-17 17:02:08 +03:00

perltidy some recent code changes before changing perltidy settings

This commit is contained in:
Andrew Dunstan
2018-05-09 10:04:17 -04:00
parent d1e2cac5ff
commit 286bb240e1
3 changed files with 28 additions and 23 deletions

View File

@ -261,10 +261,12 @@ sub mangle_plpython3
{ {
my $extension = ($dir eq 'sql' ? 'sql' : 'out'); my $extension = ($dir eq 'sql' ? 'sql' : 'out');
my @files = glob("$dir/$test.$extension $dir/${test}_[0-9].$extension"); my @files =
glob("$dir/$test.$extension $dir/${test}_[0-9].$extension");
foreach my $file (@files) foreach my $file (@files)
{ {
open(my $handle, '<', $file) || die "test file $file not found"; open(my $handle, '<', $file)
|| die "test file $file not found";
my $contents = <$handle>; my $contents = <$handle>;
close($handle); close($handle);
do do
@ -279,16 +281,18 @@ sub mangle_plpython3
s/LANGUAGE plpython2?u/LANGUAGE plpython3u/g; s/LANGUAGE plpython2?u/LANGUAGE plpython3u/g;
s/EXTENSION ([^ ]*_)*plpython2?u/EXTENSION $1plpython3u/g; s/EXTENSION ([^ ]*_)*plpython2?u/EXTENSION $1plpython3u/g;
s/installing required extension "plpython2u"/installing required extension "plpython3u"/g; s/installing required extension "plpython2u"/installing required extension "plpython3u"/g;
} for ($contents); }
for ($contents);
my $base = basename $file; my $base = basename $file;
open($handle, '>', "$dir/python3/$base") || open($handle, '>', "$dir/python3/$base")
die "opening python 3 file for $file"; || die "opening python 3 file for $file";
print $handle $contents; print $handle $contents;
close($handle); close($handle);
} }
} }
} }
do { s!^!python3/!; } foreach(@$tests); do { s!^!python3/!; }
foreach (@$tests);
return @$tests; return @$tests;
} }
@ -314,8 +318,9 @@ sub plcheck
} }
if ($lang eq 'plpython') if ($lang eq 'plpython')
{ {
next unless -d "$topdir/$Config/plpython2" || next
-d "$topdir/$Config/plpython3"; unless -d "$topdir/$Config/plpython2"
|| -d "$topdir/$Config/plpython3";
$lang = 'plpythonu'; $lang = 'plpythonu';
} }
else else