From 2bc09ff4994fbeecef9601b8654f3f94b55bc81a Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Wed, 4 Jul 2012 21:47:48 -0400 Subject: Run newly-configured perltidy script on Perl files. Run on HEAD and 9.2. --- doc/src/sgml/generate-errcodes-table.pl | 69 ++++++++++++++------------- doc/src/sgml/generate_history.pl | 55 ++++++++++++---------- doc/src/sgml/mk_feature_tables.pl | 82 +++++++++++++++++++-------------- 3 files changed, 114 insertions(+), 92 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/generate-errcodes-table.pl b/doc/src/sgml/generate-errcodes-table.pl index e2945747e2e..b9c14d3f7de 100644 --- a/doc/src/sgml/generate-errcodes-table.pl +++ b/doc/src/sgml/generate-errcodes-table.pl @@ -6,51 +6,54 @@ use warnings; use strict; -print "\n"; +print + "\n"; open my $errcodes, $ARGV[0] or die; -while (<$errcodes>) { - chomp; +while (<$errcodes>) +{ + chomp; - # Skip comments - next if /^#/; - next if /^\s*$/; + # Skip comments + next if /^#/; + next if /^\s*$/; - # Emit section headers - if (/^Section:/) { + # Emit section headers + if (/^Section:/) + { - # Remove the Section: string - s/^Section: //; - # Escape dashes for SGML - s/-/—/; - # Wrap PostgreSQL in - s/PostgreSQL/PostgreSQL<\/>/g; + # Remove the Section: string + s/^Section: //; - print "\n\n"; - print "\n"; - print ""; - print "$_\n"; - print "\n"; + # Escape dashes for SGML + s/-/—/; + + # Wrap PostgreSQL in + s/PostgreSQL/PostgreSQL<\/>/g; - next; - } + print "\n\n"; + print "\n"; + print ""; + print "$_\n"; + print "\n"; - die unless /^([^\s]{5})\s+([EWS])\s+([^\s]+)(?:\s+)?([^\s]+)?/; + next; + } - (my $sqlstate, - my $type, - my $errcode_macro, - my $condition_name) = ($1, $2, $3, $4); + die unless /^([^\s]{5})\s+([EWS])\s+([^\s]+)(?:\s+)?([^\s]+)?/; - # Skip lines without PL/pgSQL condition names - next unless defined($condition_name); + (my $sqlstate, my $type, my $errcode_macro, my $condition_name) = + ($1, $2, $3, $4); - print "\n"; - print "\n"; - print "$sqlstate\n"; - print "$condition_name\n"; - print "\n"; + # Skip lines without PL/pgSQL condition names + next unless defined($condition_name); + + print "\n"; + print "\n"; + print "$sqlstate\n"; + print "$condition_name\n"; + print "\n"; } close $errcodes; diff --git a/doc/src/sgml/generate_history.pl b/doc/src/sgml/generate_history.pl index a6c0bd77c23..1d90c676c73 100644 --- a/doc/src/sgml/generate_history.pl +++ b/doc/src/sgml/generate_history.pl @@ -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 () { - # Recursively expand sub-files of the release notes - if (m/^&(release-.*);$/) { - process_file($1 . ".sgml"); - next; - } + while () + { - # Remove tags, which might span multiple lines - while (m/]*>//) { - next; - } - # incomplete tag, so slurp another line - $_ .= ; - } + # Recursively expand sub-files of the release notes + if (m/^&(release-.*);$/) + { + process_file($1 . ".sgml"); + next; + } + + # Remove tags, which might span multiple lines + while (m/]*>//) + { + next; + } - # Remove too - s|||g; + # incomplete tag, so slurp another line + $_ .= ; + } - print; - } - close(FILE); + # Remove too + s|||g; + + print; + } + close(FILE); } diff --git a/doc/src/sgml/mk_feature_tables.pl b/doc/src/sgml/mk_feature_tables.pl index 7c78e0e3aa9..45dea798cdd 100644 --- a/doc/src/sgml/mk_feature_tables.pl +++ b/doc/src/sgml/mk_feature_tables.pl @@ -8,14 +8,18 @@ open PACK, $ARGV[1] or die; my %feature_packages; -while () { - chomp; - my ($fid, $pname) = split /\t/; - if ($feature_packages{$fid}) { - $feature_packages{$fid} .= ", $pname"; - } else { - $feature_packages{$fid} = $pname; - } +while () +{ + chomp; + my ($fid, $pname) = split /\t/; + if ($feature_packages{$fid}) + { + $feature_packages{$fid} .= ", $pname"; + } + else + { + $feature_packages{$fid} = $pname; + } } close PACK; @@ -24,33 +28,41 @@ open FEAT, $ARGV[2] or die; print "\n"; -while () { - chomp; - my ($feature_id, $feature_name, $subfeature_id, $subfeature_name, $is_supported, $comments) = split /\t/; - - $is_supported eq $yesno || next; - - $feature_name =~ s//>/g; - $subfeature_name =~ s//>/g; - - print " \n"; - - if ($subfeature_id) { - print " $feature_id-$subfeature_id\n"; - } else { - print " $feature_id\n"; - } - print " " . $feature_packages{$feature_id} . "\n"; - if ($subfeature_id) { - print " $subfeature_name\n"; - } else { - print " $feature_name\n"; - } - print " $comments\n"; - - print " \n"; +while () +{ + chomp; + my ($feature_id, $feature_name, $subfeature_id, + $subfeature_name, $is_supported, $comments) = split /\t/; + + $is_supported eq $yesno || next; + + $feature_name =~ s//>/g; + $subfeature_name =~ s//>/g; + + print " \n"; + + if ($subfeature_id) + { + print " $feature_id-$subfeature_id\n"; + } + else + { + print " $feature_id\n"; + } + print " " . $feature_packages{$feature_id} . "\n"; + if ($subfeature_id) + { + print " $subfeature_name\n"; + } + else + { + print " $feature_name\n"; + } + print " $comments\n"; + + print " \n"; } print "\n"; -- cgit v1.2.3