mirror of
https://github.com/postgres/postgres.git
synced 2025-11-06 07:49:08 +03:00
Run newly-configured perltidy script on Perl files.
Run on HEAD and 9.2.
This commit is contained in:
@@ -25,34 +25,41 @@ process_file($infile);
|
||||
|
||||
exit 0;
|
||||
|
||||
sub process_file {
|
||||
my $filename = shift;
|
||||
sub process_file
|
||||
{
|
||||
my $filename = shift;
|
||||
|
||||
local *FILE; # need a local filehandle so we can recurse
|
||||
local *FILE; # need a local filehandle so we can recurse
|
||||
|
||||
my $f = $srcdir . '/' . $filename;
|
||||
open(FILE, $f) || die "could not read $f: $!\n";
|
||||
my $f = $srcdir . '/' . $filename;
|
||||
open(FILE, $f) || die "could not read $f: $!\n";
|
||||
|
||||
while (<FILE>) {
|
||||
# Recursively expand sub-files of the release notes
|
||||
if (m/^&(release-.*);$/) {
|
||||
process_file($1 . ".sgml");
|
||||
next;
|
||||
while (<FILE>)
|
||||
{
|
||||
|
||||
# Recursively expand sub-files of the release notes
|
||||
if (m/^&(release-.*);$/)
|
||||
{
|
||||
process_file($1 . ".sgml");
|
||||
next;
|
||||
}
|
||||
|
||||
# Remove <link ...> tags, which might span multiple lines
|
||||
while (m/<link/)
|
||||
{
|
||||
if (s/<link\s+linkend[^>]*>//)
|
||||
{
|
||||
next;
|
||||
}
|
||||
|
||||
# incomplete tag, so slurp another line
|
||||
$_ .= <FILE>;
|
||||
}
|
||||
|
||||
# Remove </link> too
|
||||
s|</link>||g;
|
||||
|
||||
print;
|
||||
}
|
||||
|
||||
# Remove <link ...> tags, which might span multiple lines
|
||||
while (m/<link/) {
|
||||
if (s/<link\s+linkend[^>]*>//) {
|
||||
next;
|
||||
}
|
||||
# incomplete tag, so slurp another line
|
||||
$_ .= <FILE>;
|
||||
}
|
||||
|
||||
# Remove </link> too
|
||||
s|</link>||g;
|
||||
|
||||
print;
|
||||
}
|
||||
close(FILE);
|
||||
close(FILE);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user