Author: mcbrown
Date: 2006-07-02 08:35:54 +0200 (Sun, 02 Jul 2006)
New Revision: 2586
Log:
Added a section to check for the PerlSAX parser, and report how to install if it isn't found
Added checking of images to ensure a reference image exists in the directory tree
Modified:
trunk/tools/deep-check.pl
Modified: trunk/tools/deep-check.pl
===================================================================
--- trunk/tools/deep-check.pl 2006-07-02 06:25:13 UTC (rev 2585)
+++ trunk/tools/deep-check.pl 2006-07-02 06:35:54 UTC (rev 2586)
@@ -11,8 +11,39 @@
# mc@stripped
# 2006-06-29
-use XML::Parser::PerlSAX;
+eval "require XML::Parser::PerlSAX;";
+if ($@)
+{
+ die <<EOF;
+ERROR: Cannot load the PerlSAX parser.
+
+You need to install the expat library and the XML::Parser::PerlSAX module for perl.
+Either do it by hand:
+ - libexpat is available from http://expat.sourceforge.net
+ - PerlSAX is available from http://search.cpan.org/~kmacleod/libxml-perl-0.08/lib/XML/Parser/PerlSAX.pm
+
+Using CPAN:
+ - Install libexpat
+ - Run:
+
+\$ perl -MCPAN -e 'install XML::Parser::PerlSAX'
+
+Using apt-get:
+
+\$ apt-get install libexpat-dev
+\$ perl -MCPAN -e 'install XML::Parser::PerlSAX
+
+Using YaST:
+
+\$ yast -i expat
+\$ perl -MCPAN -e 'install XML::Parser::PerlSAX
+
+Please install and try again.
+
+EOF
+}
+
$file = shift or die "You must supply the name of the file to process";
$my_handler = MySQLDocBook->new();
@@ -41,6 +72,14 @@
{
my ($self, $element) = @_;
+ if ($element->{Name} eq 'imagedata')
+ {
+ if (!-e $element->{Attributes}->{fileref})
+ {
+ print STDERR "Error image: $element->{Attributes}->{fileref} does not exist\n";
+ }
+ }
+
if ($self->{intable} >= 1)
{
if ($element->{Name} eq 'tgroup')
@@ -81,38 +120,38 @@
if (!defined($self->{tabledefs}->{$self->{tablecount}}->{speccolumns}))
{
- print "Error in Table $self->{tablecount}: No columns specified in table!\n";
+ print STDERR "Error in Table $self->{tablecount}: No columns specified in table!\n";
}
elsif (!defined($self->{tabledefs}->{$self->{tablecount}}->{defcolumns}))
{
- print "Error in Table $self->{tablecount}: No columns in table!\n";
+ print STDERR "Error in Table $self->{tablecount}: No columns in table!\n";
}
elsif ($self->{tabledefs}->{$self->{tablecount}}->{speccolumns} !=
$self->{tabledefs}->{$self->{tablecount}}->{defcolumns})
{
- print "Error in Table $self->{tablecount}\n";
- print "\tWarning!: Table definition mismatch!!\n";
- print "\tDefined columns $self->{tabledefs}->{$self->{tablecount}}->{defcolumns}\n";
- print "\tActual columns $self->{tabledefs}->{$self->{tablecount}}->{speccolumns}\n";
+ print STDERR "Error in Table $self->{tablecount}\n";
+ print STDERR "\tWarning!: Table definition mismatch!!\n";
+ print STDERR "\tDefined columns $self->{tabledefs}->{$self->{tablecount}}->{defcolumns}\n";
+ print STDERR "\tActual columns $self->{tabledefs}->{$self->{tablecount}}->{speccolumns}\n";
}
# Check the column width count and ensure that the total figures equal 100
if (!defined($self->{tabledefs}->{$self->{tablecount}}->{colwidth}))
{
- print "Error in Table $self->{tablecount}: No column width specified\n";
+ print STDERR "Error in Table $self->{tablecount}: No column width specified\n";
}
elsif ($self->{tabledefs}->{$self->{tablecount}}->{colwidth} == 0)
{
- print "Error in Table $self->{tablecount}: Total column width is 0\n";
+ print STDERR "Error in Table $self->{tablecount}: Total column width is 0\n";
}
elsif ($self->{tabledefs}->{$self->{tablecount}}->{colwidth} == 0)
{
- print "Error in Table $self->{tablecount}: Total column width is less than 100%\n";
+ print STDERR "Error in Table $self->{tablecount}: Total column width is less than 100%\n";
}
elsif ($self->{tabledefs}->{$self->{tablecount}}->{colwidth} > 100)
{
- print "Error in Table $self->{tablecount}: Total column width is more than 100%\n";
+ print STDERR "Error in Table $self->{tablecount}: Total column width is more than 100%\n";
}
$self->{intable} = 0;
| Thread |
|---|
| • svn commit - mysqldoc@docsrva: r2586 - trunk/tools | mcbrown | 2 Jul |