Author: paul
Date: 2007-05-15 19:16:15 +0200 (Tue, 15 May 2007)
New Revision: 6468
Log:
r20384@frost: paul | 2007-05-15 12:12:55 -0500
Optimization: Do not make a document dependent on the idmap files
for its own XML source files. Any references to IDs in those files
will be resolved internally, not externally via idmap files.
The dependencies include only those idmap files corresponding
to XML files containing external ID references.
Modified:
trunk/tools/xmldepend-post.pl
Property changes on: trunk
___________________________________________________________________
Name: svk:merge
- 4767c598-dc10-0410-bea0-d01b485662eb:/mysqldoc-local/mysqldoc/trunk:24982
7d8d2c4e-af1d-0410-ab9f-b038ce55645b:/mysqldoc-local/mysqldoc:20364
b5ec3a16-e900-0410-9ad2-d183a3acac99:/mysqldoc-local/mysqldoc/trunk:14218
bf112a9c-6c03-0410-a055-ad865cd57414:/mysqldoc-local/mysqldoc/trunk:17229
+ 4767c598-dc10-0410-bea0-d01b485662eb:/mysqldoc-local/mysqldoc/trunk:24982
7d8d2c4e-af1d-0410-ab9f-b038ce55645b:/mysqldoc-local/mysqldoc:20384
b5ec3a16-e900-0410-9ad2-d183a3acac99:/mysqldoc-local/mysqldoc/trunk:14218
bf112a9c-6c03-0410-a055-ad865cd57414:/mysqldoc-local/mysqldoc/trunk:17229
Modified: trunk/tools/xmldepend-post.pl
===================================================================
--- trunk/tools/xmldepend-post.pl 2007-05-15 17:07:25 UTC (rev 6467)
+++ trunk/tools/xmldepend-post.pl 2007-05-15 17:16:15 UTC (rev 6468)
Changed blocks: 5, Lines Added: 14, Lines Deleted: 10; 2922 bytes
@@ -153,7 +153,7 @@
foreach my $file (sort keys %file_lines)
{
- my (@words, $base, $base_under);
+ my (@files, @idrefs, $base, $base_under);
$base = $file;
$base =~ s/\.xml$//;
@@ -161,12 +161,12 @@
# produce variable definition for all included files
- @words = @{$file_lines{$file}};
+ @files = @{$file_lines{$file}};
- define_variable ($base_under . "_INCLUDES", @words);
+ define_variable ($base_under . "_INCLUDES", @files);
# produce variable definition for included image files
define_variable ($base_under . "_IMAGES",
- grep { $_ =~ /\.(png|gif|jpg|jpeg)/ } @words);
+ grep { $_ =~ /\.(png|gif|jpg|jpeg)/ } @files);
# produce variable definition for all source files
print "${base_under}_SOURCES = $file \$(${base_under}_INCLUDES)\n";
# produce variable definition for all source files used to produce ID
@@ -174,7 +174,7 @@
# (same as .xml files in _SOURCES minus anything in the ID map exclusions)
my @idfiles = ();
push (@idfiles, $file) unless grep { $_ eq $file } @idmap_excl_list;
- foreach my $f (grep { $_ =~ /\.xml$/} @words)
+ foreach my $f (grep { $_ =~ /\.xml$/} @files)
{
push (@idfiles, $f) unless grep { $_ eq $f } @idmap_excl_list;
}
@@ -182,11 +182,11 @@
# produce variable definition for ID map files for referred-to IDs
- @words = @{$idref_lines{$file}};
+ @idrefs = @{$idref_lines{$file}};
- # Map IDs to files that define them
+ # Map IDs to .xml files where the IDs are defined
my %idfiles = ();
- foreach my $id (@words)
+ foreach my $id (@idrefs)
{
my $xfile = $idmap->id_file ($id);
die "ID $id not found in current maps (@srcpaths)\n"
@@ -194,17 +194,21 @@
$idfiles{$xfile} = 1;
}
#warn "idrefs $file ", join (" ", sort (keys (%idfiles))), "\n";
- # Convert each .xml filename to its corresponding .idmap file
+ # Convert each abc.xml filename to its corresponding metadata/abc.idmap
+ # file. Ignore idmap files for files in the _SOURCES value because
+ # IDs in those files resolve internally without need for idmap files.
my @idmaps = ();
foreach my $xfile (keys (%idfiles))
{
+ next if grep { $_ eq $xfile } $file, @files;
my ($base, $dir, $suffix) = fileparse ($xfile, ".xml");
my $mapfile = "metadata/$base.idmap";
$mapfile = $dir . $mapfile unless $dir eq "./";
push @idmaps, $mapfile;
}
#warn "idmaps $file ", join (" ", @idmaps), "\n";
- # produce variable definition for all required idmap files
+ # produce variable definition for all idmap files required to resolve
+ # external ID references
define_variable ($base_under . "_IDMAPS", @idmaps);
# produce dependencies for target types given in --file-dep-targets
| Thread |
|---|
| • svn commit - mysqldoc@docsrva: r6468 - in trunk: . tools | paul | 15 May |