1
0
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:
Bruce Momjian
2012-07-04 21:47:49 -04:00
parent d7c734841b
commit 042d9ffc28
53 changed files with 3253 additions and 2593 deletions

View File

@@ -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);
}