Author: mcbrown
Date: 2007-03-29 13:50:45 +0200 (Thu, 29 Mar 2007)
New Revision: 5621
Log:
Simplifying some elements of the dynamic docs generation script
Adding UTF8 (wide character) support to ID Map generation (already supported in remapping)
Modified:
trunk/tools/dyndocs-optvars-generate.pl
trunk/tools/idmap.pl
Modified: trunk/tools/dyndocs-optvars-generate.pl
===================================================================
--- trunk/tools/dyndocs-optvars-generate.pl 2007-03-29 11:21:13 UTC (rev 5620)
+++ trunk/tools/dyndocs-optvars-generate.pl 2007-03-29 11:50:45 UTC (rev 5621)
Changed blocks: 3, Lines Added: 2, Lines Deleted: 5; 1366 bytes
@@ -1,8 +1,7 @@
#! /usr/bin/perl -w
# vim:set ts=2 sw=2 expandtab:
-# genoptionstable.pl - generate the mysqld options/vars table(s)
-#
+# dyndocs-optvars-generate.pl - generate the mysqld options/vars table(s)
# Martin MC Brown
# mc@stripped
@@ -53,8 +52,6 @@
if (!(defined($opt_outpath) or
defined($opt_inplace)))
{
- print STDERR "$opt_outpath\n";
- print STDERR "$opt_inplace\n";
show_help("ERROR: You must specify the output path or inplace file to edit for a $opt_tabletype table");
}
}
@@ -217,7 +214,7 @@
--tabletype table type to produce. Valid options are:
- 'summary' for a list of entries but no details (requires --outfile)
- - 'persummary' for detailed summary of each options (requires --outpath)
+ - 'itemsummary' for detailed summary of each options (requires --outpath)
--version Version number of the manual to produce the entry for
--command (filter) Command to produce the output for
--section (filter) Section to produce the output for
Modified: trunk/tools/idmap.pl
===================================================================
--- trunk/tools/idmap.pl 2007-03-29 11:21:13 UTC (rev 5620)
+++ trunk/tools/idmap.pl 2007-03-29 11:50:45 UTC (rev 5621)
Changed blocks: 3, Lines Added: 11, Lines Deleted: 6; 1880 bytes
@@ -11,6 +11,7 @@
use File::Basename;
use File::Path;
use Getopt::Long;
+use IO::File;
my $idmapversion = 1;
@@ -113,23 +114,27 @@
XML::Parser::PerlSAX->new->parse(Source => { SystemId => $file},
Handler => $my_handler);
+
+ my $dest = IO::File->new($maptempfile,'w');
- open(MAP,">$maptempfile") or die "Couldn't open map destination file ($mapfile): $!";
+ die "Couldn't open map destination file ($maptempfile): $!" unless (defined($dest));
- print MAP "!!!mapversion:1!!!\n";
- printf MAP "!!!INFO!!!%s\n",join(':',$file,$docbase,$docversion,$doclang,$urlbase);
+ binmode($dest,':utf8');
+ print $dest "!!!mapversion:1!!!\n";
+ printf $dest "!!!INFO!!!%s\n",join(':',$file,$docbase,$docversion,$doclang,$urlbase);
+
foreach my $id (sort { $a cmp $b } keys %{$my_handler->{ids}})
{
if (!defined($id) || $id eq '')
{
- printf STDERR ("WARNING: Can't make a valid IDMAP on %s when the ID for '%s' is not specified\n",
+ printf STDERR ("WARNING: Can't make a valid ID$dest on %s when the ID for '%s' is not specified\n",
$file,
$my_handler->{ids}->{$id}->{title});
}
else
{
- print MAP (join(':',
+ print $dest (join(':',
$id,
$my_handler->{ids}->{$id}->{type} || '',
$my_handler->{ids}->{$id}->{sectionparent} || '',
@@ -137,7 +142,7 @@
"\n");
}
}
- close(MAP);
+ close($dest);
unlink($mapfile);
rename($maptempfile,$mapfile);
| Thread |
|---|
| • svn commit - mysqldoc@docsrva: r5621 - trunk/tools | mcbrown | 29 Mar |