Author: mcbrown
Date: 2007-12-10 16:53:14 +0100 (Mon, 10 Dec 2007)
New Revision: 9226
Log:
Updating ID mapping
Using a deep_copy version of the file_info to prevent corruption
Fix to parser for appendix
Modified:
trunk/tools/MySQL/DynXMLParse.pm
trunk/tools/MySQL/IDMap.pm
trunk/tools/MySQL/IDMap/XMLParser.pm
Modified: trunk/tools/MySQL/DynXMLParse.pm
===================================================================
--- trunk/tools/MySQL/DynXMLParse.pm 2007-12-10 12:29:02 UTC (rev 9225)
+++ trunk/tools/MySQL/DynXMLParse.pm 2007-12-10 15:53:14 UTC (rev 9226)
Changed blocks: 1, Lines Added: 2, Lines Deleted: 0; 375 bytes
@@ -154,3 +154,5 @@
+{map { $_ => deep_copy($this->{$_}) } keys %$this};
} else { die 'what type is $_?' }
}
+
+1;
Modified: trunk/tools/MySQL/IDMap/XMLParser.pm
===================================================================
--- trunk/tools/MySQL/IDMap/XMLParser.pm 2007-12-10 12:29:02 UTC (rev 9225)
+++ trunk/tools/MySQL/IDMap/XMLParser.pm 2007-12-10 15:53:14 UTC (rev 9226)
Changed blocks: 1, Lines Added: 2, Lines Deleted: 1; 718 bytes
@@ -159,7 +159,8 @@
if ($element->{Name} eq 'section' ||
$element->{Name} eq 'refentry' ||
$element->{Name} eq 'refsection' ||
- $element->{Name} eq 'chapter'
+ $element->{Name} eq 'chapter' ||
+ $element->{Name} eq 'appendix'
)
{
push(@{$self->{sectionmap}},$element->{Attributes}->{id});
Modified: trunk/tools/MySQL/IDMap.pm
===================================================================
--- trunk/tools/MySQL/IDMap.pm 2007-12-10 12:29:02 UTC (rev 9225)
+++ trunk/tools/MySQL/IDMap.pm 2007-12-10 15:53:14 UTC (rev 9226)
Changed blocks: 5, Lines Added: 35, Lines Deleted: 17; 3344 bytes
@@ -155,22 +155,23 @@
sub builddefaultsources
{
+
my @basepaths = ('.','..','../..');
my @basedirs = qw/
- refman-4.1
- refman-5.0
- refman-5.1
+ refman-4.1
+ refman-5.0
+ refman-5.1
refman-5.2
refman-6.0
- refman-common
- gui-common
- internals
- query-browser
- administrator
- migration-toolkit
- workbench
+ refman-common
+ gui-common
+ internals
+ query-browser
+ administrator
+ migration-toolkit
+ workbench
workbench-pro
- falcon
+ falcon
ndbapi
mysqldoc-guide
guibook
@@ -248,16 +249,18 @@
if (exists($self->{mapfilesbyfullpath}->{$realfile}->{rootid})
&&
defined($self->{mapfilesbyfullpath}->{$realfile}->{rootid}))
{
+# Add the root ID of the imported file to the list of IDs that are children of this ID
$idtree->{$id}->{$self->{mapfilesbyfullpath}->{$realfile}->{rootid}} = 1;
}
}
}
+
if (exists($self->{byid}->{$id}->{parent}) &&
defined($self->{byid}->{$id}->{parent}))
{
if (defined($prefix))
{
- next unless (exists($self->{byprefixid
}->{$prefix}->{$id}->{prefix}));
+ next unless
(exists($self->{byprefixid}->{$prefix}->{$id}->{prefix}));
}
next if ($self->{byid}->{$id}->{parent} eq $id);
$idtree->{$self->{byid}->{$id}->{parent}}->{$id} = 1;
@@ -403,7 +406,7 @@
my $fullpath = sprintf('%s/%s',$prefix,$srcfile);
my $relpath = sprintf('%s/%s',$relprefix,$srcfile);
- $self->{fileinfo} = {
+ my $fileinfo = {
srcfile => $srcfile,
docbase => $docbase,
docversion => $docversion,
@@ -417,12 +420,16 @@
fullpath => $fullpath,
relpath => $relpath
};
- $self->{mapfilesbyfile}->{$srcfile} = $self->{fileinfo};
- $self->{mapfilesbyfullpath}->{$fullpath} = $self->{fileinfo};
+
+ $self->{fileinfo} = deep_copy($fileinfo);
+
+ $self->{mapfilesbyfile}->{$srcfile} = deep_copy($fileinfo);
+ $self->{mapfilesbyfullpath}->{$fullpath} = deep_copy($fileinfo);
+
if (defined($rootid))
{
- $self->{mapfilesbyid}->{$rootid} = $self->{fileinfo};
- $self->{mapfilesbyprefixid}->{$prefix}->{$rootid} =
$self->{fileinfo};
+ $self->{mapfilesbyid}->{$rootid} = deep_copy($fileinfo);
+ $self->{mapfilesbyprefixid}->{$prefix}->{$rootid} =
deep_copy($fileinfo);
}
}
else
@@ -896,4 +903,15 @@
}
+sub deep_copy {
+ my $this = shift;
+ if (not ref $this) {
+ $this;
+ } elsif (ref $this eq 'ARRAY') {
+ [map deep_copy($_), @$this];
+ } elsif (ref $this eq 'HASH') {
+ +{map { $_ => deep_copy($this->{$_}) } keys %$this};
+ } else { die 'what type is $_?' }
+}
+
1;
| Thread |
|---|
| • svn commit - mysqldoc@docsrva: r9226 - in trunk/tools/MySQL: . IDMap | mcbrown | 10 Dec |