diff options
author | Bruce Momjian | 2012-07-05 01:47:49 +0000 |
---|---|---|
committer | Bruce Momjian | 2012-07-05 01:47:49 +0000 |
commit | 042d9ffc282a8c796d2a5babc600c1a6db150dac (patch) | |
tree | 3204f89a7552bb9211aa9565f18367da150ffe60 /doc/src | |
parent | d7c734841b3e6cb44de363a8a3d83c35b75b30d9 (diff) |
Run newly-configured perltidy script on Perl files.
Run on HEAD and 9.2.
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/sgml/generate-errcodes-table.pl | 69 | ||||
-rw-r--r-- | doc/src/sgml/generate_history.pl | 55 | ||||
-rw-r--r-- | doc/src/sgml/mk_feature_tables.pl | 82 |
3 files changed, 114 insertions, 92 deletions
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 "<!-- autogenerated from src/backend/utils/errcodes.txt, do not edit -->\n"; +print + "<!-- autogenerated from src/backend/utils/errcodes.txt, do not edit -->\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 <productname/> - s/PostgreSQL/<productname>PostgreSQL<\/>/g; + # Remove the Section: string + s/^Section: //; - print "\n\n"; - print "<row>\n"; - print "<entry spanname=\"span12\">"; - print "<emphasis role=\"bold\">$_</></entry>\n"; - print "</row>\n"; + # Escape dashes for SGML + s/-/—/; + + # Wrap PostgreSQL in <productname/> + s/PostgreSQL/<productname>PostgreSQL<\/>/g; - next; - } + print "\n\n"; + print "<row>\n"; + print "<entry spanname=\"span12\">"; + print "<emphasis role=\"bold\">$_</></entry>\n"; + print "</row>\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 "<row>\n"; - print "<entry><literal>$sqlstate</literal></entry>\n"; - print "<entry><symbol>$condition_name</symbol></entry>\n"; - print "</row>\n"; + # Skip lines without PL/pgSQL condition names + next unless defined($condition_name); + + print "\n"; + print "<row>\n"; + print "<entry><literal>$sqlstate</literal></entry>\n"; + print "<entry><symbol>$condition_name</symbol></entry>\n"; + print "</row>\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 (<FILE>) { - # Recursively expand sub-files of the release notes - if (m/^&(release-.*);$/) { - process_file($1 . ".sgml"); - next; - } + while (<FILE>) + { - # Remove <link ...> tags, which might span multiple lines - while (m/<link/) { - if (s/<link\s+linkend[^>]*>//) { - next; - } - # incomplete tag, so slurp another line - $_ .= <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; + } - # Remove </link> too - s|</link>||g; + # incomplete tag, so slurp another line + $_ .= <FILE>; + } - print; - } - close(FILE); + # Remove </link> too + s|</link>||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 (<PACK>) { - chomp; - my ($fid, $pname) = split /\t/; - if ($feature_packages{$fid}) { - $feature_packages{$fid} .= ", $pname"; - } else { - $feature_packages{$fid} = $pname; - } +while (<PACK>) +{ + 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 "<tbody>\n"; -while (<FEAT>) { - chomp; - my ($feature_id, $feature_name, $subfeature_id, $subfeature_name, $is_supported, $comments) = split /\t/; - - $is_supported eq $yesno || next; - - $feature_name =~ s/</</g; - $feature_name =~ s/>/>/g; - $subfeature_name =~ s/</</g; - $subfeature_name =~ s/>/>/g; - - print " <row>\n"; - - if ($subfeature_id) { - print " <entry>$feature_id-$subfeature_id</entry>\n"; - } else { - print " <entry>$feature_id</entry>\n"; - } - print " <entry>" . $feature_packages{$feature_id} . "</entry>\n"; - if ($subfeature_id) { - print " <entry>$subfeature_name</entry>\n"; - } else { - print " <entry>$feature_name</entry>\n"; - } - print " <entry>$comments</entry>\n"; - - print " </row>\n"; +while (<FEAT>) +{ + chomp; + my ($feature_id, $feature_name, $subfeature_id, + $subfeature_name, $is_supported, $comments) = split /\t/; + + $is_supported eq $yesno || next; + + $feature_name =~ s/</</g; + $feature_name =~ s/>/>/g; + $subfeature_name =~ s/</</g; + $subfeature_name =~ s/>/>/g; + + print " <row>\n"; + + if ($subfeature_id) + { + print " <entry>$feature_id-$subfeature_id</entry>\n"; + } + else + { + print " <entry>$feature_id</entry>\n"; + } + print " <entry>" . $feature_packages{$feature_id} . "</entry>\n"; + if ($subfeature_id) + { + print " <entry>$subfeature_name</entry>\n"; + } + else + { + print " <entry>$feature_name</entry>\n"; + } + print " <entry>$comments</entry>\n"; + + print " </row>\n"; } print "</tbody>\n"; |