List:Commits« Previous MessageNext Message »
From:mcbrown Date:October 12 2006 10:58am
Subject:svn commit - mysqldoc@docsrva: r3615 - trunk/tools
View as plain text  
Author: mcbrown
Date: 2006-10-12 12:58:21 +0200 (Thu, 12 Oct 2006)
New Revision: 3615

Log:
For deep-check.pl: 

 - Fixed the bug where some section/chapter/other major types were not being identified
 - Updated display to show the type of bad reference
 - Fixed the bug where numeric only <link> text would be reported as bad

For idmap.pl
 
 - Removed the concurrent update checking code (since building should now be handled by 
   make)
 - Fixed the issue of ID maps being built even if there wasn't an ID for a given element
 - Added WARNING for missing IDs
 - Fixed a bug where section elements would partial match (bad regex)

For genoptionstable.pl

 - Fixed the column specification




Modified:
   trunk/tools/deep-check.pl
   trunk/tools/genoptionstable.pl
   trunk/tools/idmap.pl


Modified: trunk/tools/deep-check.pl
===================================================================
--- trunk/tools/deep-check.pl	2006-10-12 07:07:10 UTC (rev 3614)
+++ trunk/tools/deep-check.pl	2006-10-12 10:58:21 UTC (rev 3615)
Changed blocks: 4, Lines Added: 4, Lines Deleted: 4; 1400 bytes

@@ -185,7 +185,7 @@
         }
     }
 
-    if ($element->{Name} eq 'section')
+    if ($element->{Name} =~ m/^(appendix|book|chapter|example|preface|refentry|refsection|section)$/i)
     {
         if (exists($element->{Attributes}->{id}))
         {

@@ -193,7 +193,7 @@
             $self->{currsection} = $element->{Attributes}->{id};
             if (exists($self->{sectionids}->{$element->{Attributes}->{id}}))
             {
-                print STDERR "Error: Found a duplicate section ID ($element->{Attributes}->{id})\n";
+                print STDERR "Error: Found a duplicate reference ID ($element->{Attributes}->{id})\n";
             }
             else
             {

@@ -203,7 +203,7 @@
         }
         else
         {
-            print STDERR "Error: Found a section without an ID!\n";
+            print STDERR "Error: Found a $element->{Name} without an ID!\n";
         }
     }
 

@@ -267,7 +267,7 @@
 
     if ($element->{Name} eq 'link')
     {
-        if ($self->{linktext} !~ m/[a-zA-Z]+/)
+        if ($self->{linktext} !~ m/[a-zA-Z0-9]+/)
         {
             print STDERR ("Error: You cannot use <link> to '",
                           $self->{linkref} || 'NOLINK',


Modified: trunk/tools/genoptionstable.pl
===================================================================
--- trunk/tools/genoptionstable.pl	2006-10-12 07:07:10 UTC (rev 3614)
+++ trunk/tools/genoptionstable.pl	2006-10-12 10:58:21 UTC (rev 3615)
Changed blocks: 1, Lines Added: 1, Lines Deleted: 1; 436 bytes

@@ -78,7 +78,7 @@
 
 print <<EOF;
 <informaltable>
-<tgroup cols="6">
+<tgroup cols="5">
 <colspec colwidth="50*"/>
 <colspec colwidth="10*" align="center"/>
 <colspec colwidth="10*" align="center"/>


Modified: trunk/tools/idmap.pl
===================================================================
--- trunk/tools/idmap.pl	2006-10-12 07:07:10 UTC (rev 3614)
+++ trunk/tools/idmap.pl	2006-10-12 10:58:21 UTC (rev 3615)
Changed blocks: 4, Lines Added: 20, Lines Deleted: 34; 2679 bytes

@@ -78,32 +78,8 @@
 
     mkpath($mapdir);
 
-    my ($mapfilemtime) = 0;
-
-    ($mapfilemtime) = (stat($mapfile))[9] if -e $mapfile;
-    my ($filemtime) = (stat($file))[9];
-        
-    if ($mapfilemtime >= $filemtime)
-    {
-        delete($filemap->{$file});
-        return;
-    }
-
-    if (-e $maptempfile)
-    {
-        my ($tmpfiletime) = (stat($maptempfile))[9];
-        if ($tmpfiletime <= ($^T-60))
-        {
-            unlink($maptempfile);
-        }
-        else
-        {
-            return;
-        }
-    }
-
     my $my_handler = MySQLDocBook->new();
-    
+
     XML::Parser::PerlSAX->new->parse(Source => { SystemId => $file}, 
                                      Handler => $my_handler);
     

@@ -113,14 +89,23 @@
 
     foreach my $id (sort { $a cmp $b } keys %{$my_handler->{ids}})
     {
-        print MAP (join(':',
-                    $id,
-                    $my_handler->{ids}->{$id}->{type},
-                    $my_handler->{ids}->{$id}->{sectionparent},
-                    $file,
-                    $urlbase,
-                    $my_handler->{ids}->{$id}->{title} || $id),
-                   "\n");
+        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",
+                           $file, 
+                           $my_handler->{ids}->{$id}->{title});
+        }
+        else
+        {
+            print MAP (join(':',
+                            $id,
+                            $my_handler->{ids}->{$id}->{type} || '',
+                            $my_handler->{ids}->{$id}->{sectionparent} || '',
+                            $file || '',
+                            $urlbase || '',
+                            $my_handler->{ids}->{$id}->{title} || $id),
+                       "\n");
+        }
     }
     close(MAP);
 

@@ -129,6 +114,7 @@
     delete($filemap->{$file});
 }
 
+
 package MySQLDocBook;
 
 sub new

@@ -154,7 +140,7 @@
 
     if (exists($element->{Attributes}->{id}))
     {
-        return unless ($element->{Name} =~ m/appendix|book|chapter|example|para|preface|programlisting|refentry|refsection|section/i);
+        return unless ($element->{Name} =~ m/^(appendix|book|chapter|example|para|preface|programlisting|refentry|refsection|section)$/i);
 
         $self->{ids}->{$element->{Attributes}->{id}} = {'type' => $element->{Name},
                                                         'sectionparent' => $self->{currsection} || '--TOP--',


Thread
svn commit - mysqldoc@docsrva: r3615 - trunk/toolsmcbrown12 Oct