summaryrefslogtreecommitdiffstats
path: root/doc/src/sgml/mk_feature_tables.pl
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 13:44:03 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 13:44:03 +0000
commit293913568e6a7a86fd1479e1cff8e2ecb58d6568 (patch)
treefc3b469a3ec5ab71b36ea97cc7aaddb838423a0c /doc/src/sgml/mk_feature_tables.pl
parentInitial commit. (diff)
downloadpostgresql-16-293913568e6a7a86fd1479e1cff8e2ecb58d6568.tar.xz
postgresql-16-293913568e6a7a86fd1479e1cff8e2ecb58d6568.zip
Adding upstream version 16.2.upstream/16.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'doc/src/sgml/mk_feature_tables.pl')
-rw-r--r--doc/src/sgml/mk_feature_tables.pl77
1 files changed, 77 insertions, 0 deletions
diff --git a/doc/src/sgml/mk_feature_tables.pl b/doc/src/sgml/mk_feature_tables.pl
new file mode 100644
index 0000000..824be72
--- /dev/null
+++ b/doc/src/sgml/mk_feature_tables.pl
@@ -0,0 +1,77 @@
+# /usr/bin/perl
+
+# doc/src/sgml/mk_feature_tables.pl
+
+use strict;
+use warnings;
+
+my $yesno = $ARGV[0];
+
+open my $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;
+ }
+}
+
+close $pack;
+
+open my $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/</&lt;/g;
+ $feature_name =~ s/>/&gt;/g;
+ $subfeature_name =~ s/</&lt;/g;
+ $subfeature_name =~ s/>/&gt;/g;
+
+ print " <row>\n";
+
+ if ($subfeature_id)
+ {
+ print " <entry>$feature_id-$subfeature_id</entry>\n";
+ }
+ else
+ {
+ print " <entry>$feature_id</entry>\n";
+ }
+ print " <entry>",
+ defined($feature_packages{$feature_id})
+ ? $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";
+
+close $feat;