Author: mcbrown
Date: 2008-04-21 05:10:24 +0200 (Mon, 21 Apr 2008)
New Revision: 10554
Log:
Fixing a few issues in the dynamic docs:
- Dictionary output from dynamic docs that support translations is now supported again
- Fixed an issue where the new layout for version entries didn't output a consistent list
of items from optvar
- Addressed an issue with the version output that made 'all' output determination fail;
this only affects the
quick guides where we use the 'all' determination, and is ignored during that output
anyway
Modified:
trunk/tools/MySQL/DynXML.pm
trunk/tools/MySQL/DynXML/Optvar.pm
trunk/tools/dynxml-parser.pl
trunk/tools/update-dictionaries.pl
Modified: trunk/tools/MySQL/DynXML/Optvar.pm
===================================================================
--- trunk/tools/MySQL/DynXML/Optvar.pm 2008-04-20 23:15:06 UTC (rev 10553)
+++ trunk/tools/MySQL/DynXML/Optvar.pm 2008-04-21 03:10:24 UTC (rev 10554)
Changed blocks: 5, Lines Added: 13, Lines Deleted: 11; 2418 bytes
@@ -95,7 +95,7 @@
}
else
{
- print STDERR "WARNING: Couldn't load lang-specific file $filename for parsing
($!)\n";
+ print STDERR "WARNING: Couldn't load lang-specific Optvar file $filename for
parsing ($!)\n";
}
}
@@ -107,7 +107,7 @@
{
my ($self,$options) = @_;
- $self->load_command_xml($options->{command},$options);
+ $self->load_command_xml($options->{command});
}
sub dump_translation
@@ -428,8 +428,6 @@
foreach my $id (@{$idlist})
{
-# print Dumper($td->{$id}),"\n";
-
my @cmdline = ();
if (exists($td->{$id}->{type}->{cmdline}))
@@ -1597,12 +1595,13 @@
my $words = {};
- my @files = glob("$options->{srcdir}/comman-doptvars/*.xml");
+ my @files = glob("$options->{srcdir}/command-optvars/*.xml");
foreach my $basefile (@files)
{
my ($command,$path,$suffix) = fileparse($basefile,qr{\.xml});
- $self->load_command_xml($command,$options);
+ $self->load_command_xml($command,
+ $options->{dictlang});
}
foreach my $command (keys %{$self->{tdcache}})
@@ -1611,14 +1610,17 @@
foreach my $option (keys %{$self->{tdcache}->{$command}})
{
$words->{$option} = 1;
- if
(exists($self->{tdcache}->{$command}->{$option}->{type}->{cmdline}->{format}))
+ foreach my $cmdline
(@{$self->{tdcache}->{$command}->{$option}->{vartypes}->{cmdline}})
{
-
$words->{$self->{tdcache}->{$command}->{$option}->{type}->{cmdline}->{format}}
= 1;
- $words->{sprintf('--%s',$option)} = 1;
+ if (exists($cmdline->{format}))
+ {
+ $words->{$cmdline->{format}} = 1;
+ $words->{sprintf('--%s',$option)} = 1;
+ }
+ $words->{$cmdline->{setvar}} = 1
+ if (exists($cmdline->{setvar}));
}
-
$words->{$self->{tdcache}->{$command}->{$option}->{type}->{cmdline}->{setvar}}
= 1
- if
(exists($self->{tdcache}->{$command}->{$option}->{type}->{cmdline}->{setvar}));
}
}
Modified: trunk/tools/MySQL/DynXML.pm
===================================================================
--- trunk/tools/MySQL/DynXML.pm 2008-04-20 23:15:06 UTC (rev 10553)
+++ trunk/tools/MySQL/DynXML.pm 2008-04-21 03:10:24 UTC (rev 10554)
Changed blocks: 2, Lines Added: 8, Lines Deleted: 0; 762 bytes
@@ -195,6 +195,7 @@
foreach my $loadlang (('en',$lang))
{
+ next unless (defined($loadlang));
if (!exists($self->{langtitlecache}->{$loadlang}))
{
my $filename = sprintf('%s/metadata-titles.%s.xml',
@@ -251,6 +252,13 @@
return($object->[0]);
}
+# If the version is 'all' then just mark the version as 5.1
+
+ if ($version eq 'all')
+ {
+ $version = 5.1;
+ }
+
# Work out the next version
my $nextversion = ($self->vertodec($version + 0.1)*10);
Modified: trunk/tools/dynxml-parser.pl
===================================================================
--- trunk/tools/dynxml-parser.pl 2008-04-20 23:15:06 UTC (rev 10553)
+++ trunk/tools/dynxml-parser.pl 2008-04-21 03:10:24 UTC (rev 10554)
Changed blocks: 1, Lines Added: 4, Lines Deleted: 3; 759 bytes
@@ -65,9 +65,10 @@
print <<EOF;
Usage: $0 --infile=FILENAME --outfile=FILENAME --srcdir=FILENAME
- --infile Specify the input DocBook XML file
- --outfile Specify the output DocBook XML file
- --srcdir Specify the source directory for dynamic docs files
+ --infile Specify the input DocBook XML file
+ --outfile Specify the output DocBook XML file
+ --srcdir Specify the source directory for dynamic docs files
+ --srclangdir Specify the language source directory
EOF
if (defined($message))
Modified: trunk/tools/update-dictionaries.pl
===================================================================
--- trunk/tools/update-dictionaries.pl 2008-04-20 23:15:06 UTC (rev 10553)
+++ trunk/tools/update-dictionaries.pl 2008-04-21 03:10:24 UTC (rev 10554)
Changed blocks: 3, Lines Added: 13, Lines Deleted: 7; 1749 bytes
@@ -24,11 +24,11 @@
use Getopt::Long;
use IO::File;
-my $dynxml = new MySQL::DynXML();
+my ($opt_outfile,$opt_srcdir,$opt_srclangdir,$opt_dictlang) = (undef,undef,undef,undef);
-my ($opt_outfile,$opt_srcdir) = (undef,undef,undef);
-
GetOptions("outfile=s" => \$opt_outfile,
+ "srclangdir=s" => \$opt_srclangdir,
+ "dictlang=s" => \$opt_dictlang,
"srcdir=s" => \$opt_srcdir);
if (!defined($opt_outfile) ||
@@ -38,9 +38,13 @@
}
my $options = {outfile => $opt_outfile,
+ srclangdir => $opt_srclangdir || $opt_srcdir,
srcdir => $opt_srcdir,
- };
+ dictlang => $opt_dictlang || 'en',
+};
+my $dynxml = new MySQL::DynXML($options);
+
my $OptVars = new MySQL::DynXML::Optvar($dynxml,$options);
my $OpFuncs = new MySQL::DynXML::Opfuncs($dynxml,$options);
my $ReservedWords = new MySQL::DynXML::ReservedWords($dynxml,$options);
@@ -56,10 +60,12 @@
print $message,"\n\n";
}
print "Usage:
-update-dictionaties.pl --srcdir=DIR --outfile=FILENAME
+update-dictionaries.pl --srcdir=DIR --outfile=FILENAME
- --srcdir Specify the base directory for the dynamic docs XML
- --outfile Specify the output dictionary file\n";
+ --srcdir Specify the base directory for the dynamic docs XML
+ --srclangdir Specify the location of the language extensions for the base XML
+ --dictlang Choose the dictionary language to generate
+ --outfile Specify the output dictionary file\n";
if (defined($message))
{
| Thread |
|---|
| • svn commit - mysqldoc@docsrva: r10554 - in trunk/tools: . MySQL MySQL/DynXML | mcbrown | 21 Apr 2008 |