List:Commits« Previous MessageNext Message »
From:mcbrown Date:March 14 2007 3:07pm
Subject:svn commit - mysqldoc@docsrva: r5351 - trunk/tools
View as plain text  
Author: mcbrown
Date: 2007-03-14 16:07:43 +0100 (Wed, 14 Mar 2007)
New Revision: 5351

Log:
Adding item specific output



Modified:
   trunk/tools/dyndocs-optvars-generate.pl


Modified: trunk/tools/dyndocs-optvars-generate.pl
===================================================================
--- trunk/tools/dyndocs-optvars-generate.pl	2007-03-14 15:00:16 UTC (rev 5350)
+++ trunk/tools/dyndocs-optvars-generate.pl	2007-03-14 15:07:43 UTC (rev 5351)
Changed blocks: 3, Lines Added: 95, Lines Deleted: 7; 5714 bytes

@@ -58,12 +58,23 @@
 XML::Parser::PerlSAX->new->parse(Source => { SystemId => $file}, 
                                  Handler => $my_handler);
 
-generate_summary_table($my_handler->{tabledata},{genxref => $opt_genxref,
-                                                 version => $opt_version,
-                                                 command => $opt_command,
-                                                 section => $opt_section,
-                                                 subsection => $opt_subsection,
-                                                 outfile => $opt_outfile});
+if ($opt_tabletype eq 'summary')
+{
+    generate_summary_table($my_handler->{tabledata},{genxref => $opt_genxref,
+                                                     version => $opt_version,
+                                                     command => $opt_command,
+                                                     section => $opt_section,
+                                                     subsection => $opt_subsection,
+                                                     outfile => $opt_outfile});
+}
+else
+{
+    generate_item_tables($my_handler->{tabledata},{version => $opt_version,
+                                                   command => $opt_command,
+                                                   section => $opt_section,
+                                                   subsection => $opt_subsection,
+                                                   outpath => $opt_outpath});
+}
 
 sub show_requirements
 {

@@ -130,6 +141,83 @@
 }
 }
 
+sub generate_itemsummary_tables
+{
+    my ($tabledata,$options) = @_;
+
+    my @sorted = sort { $tabledata->{$a}->{'_sortbase'} cmp 
+                            $tabledata->{$b}->{'_sortbase'} } keys %{$tabledata};
+
+    foreach my $id (@sorted)
+    {
+        next unless (exists($tabledata->{$id}->{manualversion}->{$options->{version}}));
+        next unless (exists($tabledata->{$id}->{classification}->{command}) &&
+                     ($tabledata->{$id}->{classification}->{command} eq $options->{command}));
+
+        my $outfile = "$options->{outpath}/$id.xml";
+
+        open(SUMMTABLE,">$outfile") or die "Error: Cannot open $outfile ($!)";
+        print SUMMTABLE <<EOF;
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE informaltable PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
+"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd"
+>
+<informaltable>
+<tgroup cols="2">
+<colspaec width="30*"/>
+<colspaec width="70*"/>
+<thead>
+<row>
+<entry/>
+<entry>Notes</entry>
+</row>
+</thead>
+<tbody>
+EOF
+
+printf SUMMTABLE ("<row><entry>Name</entry><entry>%s</entry>\n",$id);
+printf SUMMTABLE ("<row><entry>Description</entry><entry>%s</entry>\n",$tabledata->{$id}->{shortdescription});
+printf SUMMTABLE ("<row><entry>Introduced</entry><entry>%s</entry>\n",$tabledata->{$id}->{introduced})
+    if (exists($tabledata->{$id}->{introduced}));
+printf SUMMTABLE ("<row><entry>Configuation File</entry><entry>%s</entry>\n",$tabledata->{$id}->{cmdline}->{format})
+    if (exists($tabledata->{$id}->{cmdline}));
+printf SUMMTABLE ("<row><entry>Option Sets Variable Value</entry><entry>Yes, %s</entry>\n",$tabledata->{$id}->{cmdline}->{setvar})
+    if (exists($tabledata->{$id}->{cmdline}));
+printf SUMMTABLE ("<row><entry>Option</entry><entry>%s</entry>\n",$tabledata->{$id}->{introduced})
+    if (exists($tabledata->{$id}->{mycnf}));
+printf SUMMTABLE ("<row><entry>Variable</entry><entry>%s</entry>\n",$tabledata->{$id}->{introduced});
+printf SUMMTABLE ("<row><entry>Variable Type</entry><entry>%s</entry>\n",$tabledata->{$id}->{introduced});
+printf SUMMTABLE ("<row><entry>Dynamic Variable</entry><entry>%s</entry>\n",$tabledata->{$id}->{isdynamic});
+
+printf SUMMTABLE ("<row><entry>Deprecated</entry><entry>%s</entry>\n",$tabledata->{$id}->{deprecated}) 
+    if (exists($tabledata->{$id}->{deprecated}));
+printf SUMMTABLE ("<row><entry>Disabled By</entry><entry>%s</entry>\n",$tabledata->{$id}->{disabledby}) 
+    if (exists($tabledata->{$id}->{disabledby}));
+printf SUMMTABLE ("<row><entry>Supported Platform</entry><entry>%s</entry>\n",$tabledata->{$id}->{platforms}) 
+    if (exists($tabledata->{$id}->{platforms}));
+
+        print SUMMTABLE "</tbody></tgroup></informaltable>";
+
+        close(SUMMTABLE);
+    }
+
+#                                                 | Version | Notes
+#Name                 | Binlog Format             |
+#Description          | Specifies the format of the binary log
+#Official type        | Server Variable
+#Option Name          | binlog-format             |   5.1.5 |
+#Server Var           | binlog_format             |   5.1.6 |
+#Status Var
+#my.cnf               | binlog-format
+#Command Line         | -binlog-format=[BIN|TEXT] |   5.2.0 | Will fail if bad format used
+#Option sets var?     | YES
+#Session/System Var?  | Both
+#Compatible Engines   | All
+#Compatible Platforms | None
+#Disabled by          | no_binlog
+#Incompatible with    | I_dont_want_a_binlog, binlogs_dontwork_here
+}
+
 sub generate_summary_table
 {
     my ($tabledata,$options) = @_;

@@ -137,7 +225,7 @@
     my @sorted = sort { $tabledata->{$a}->{'_sortbase'} cmp 
                             $tabledata->{$b}->{'_sortbase'} } keys %{$tabledata};
 
-        open(OUTPUT,">$options->{outfile}") or die "Couldn't open $options->{outfile} ($!)\n";
+    open(OUTPUT,">$options->{outfile}") or die "Couldn't open $options->{outfile} ($!)\n";
 
     print OUTPUT <<EOF;
 <?xml version="1.0" encoding="utf-8"?>


Thread
svn commit - mysqldoc@docsrva: r5351 - trunk/toolsmcbrown14 Mar