MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:mcbrown Date:July 2 2006 6:46am
Subject:svn commit - mysqldoc@docsrva: r2587 - trunk/tools
View as plain text  
Author: mcbrown
Date: 2006-07-02 08:46:28 +0200 (Sun, 02 Jul 2006)
New Revision: 2587

Log:
Fixed the script to use strict pragma.
Output is now sent to STDERR (also in last commit)
Added a section to check for duplicate IDs (sections only)



Modified:
   trunk/tools/deep-check.pl

Modified: trunk/tools/deep-check.pl
===================================================================
--- trunk/tools/deep-check.pl	2006-07-02 06:35:54 UTC (rev 2586)
+++ trunk/tools/deep-check.pl	2006-07-02 06:46:28 UTC (rev 2587)
@@ -11,6 +11,8 @@
 # mc@stripped
 # 2006-06-29
 
+use strict;
+
 eval "require XML::Parser::PerlSAX;";
 
 if ($@) 
@@ -44,9 +46,9 @@
 EOF
 }
 
-$file = shift or die "You must supply the name of the file to process";
+my $file = shift or die "You must supply the name of the file to process";
 
-$my_handler = MySQLDocBook->new();
+my $my_handler = MySQLDocBook->new();
 
 XML::Parser::PerlSAX->new->parse(Source => { SystemId => $file}, 
                                  Handler => $my_handler);
@@ -60,6 +62,7 @@
     my $tag = shift;
 
     return bless {'tag' => $tag,
+                  'sectionids' => {},
                   'intag' => 0,
                   'tablecount' => 0,
                   'tabledefs' => {},
@@ -80,6 +83,26 @@
         }
     }
 
+    if ($element->{Name} eq 'section')
+    {
+        if (exists($element->{Attributes}->{id}))
+        {
+            if (exists($self->{sectionids}->{$element->{Attributes}->{id}}))
+            {
+                print STDERR "Error: Found a duplicate section ID ($element->{Attributes}->{id})\n";
+            }
+            else
+            {
+                $self->{sectionids}->{$element->{Attributes}->{id}} = 0;
+            }
+            $self->{sectionids}->{$element->{Attributes}->{id}}++;
+        }
+        else
+        {
+            print STDERR "Error: Found a section without an ID!\n";
+        }
+    }
+
     if ($self->{intable} >= 1)
     {
         if ($element->{Name} eq 'tgroup')

Thread
svn commit - mysqldoc@docsrva: r2587 - trunk/toolsmcbrown2 Jul