Author: mcbrown
Date: 2007-08-29 18:14:44 +0200 (Wed, 29 Aug 2007)
New Revision: 7585
Log:
Added a tool to quickly check renamed names files
Added:
trunk/tools/check-renamed-nodes.pl
Property changes on: trunk/tools/check-renamed-nodes.pl
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/tools/check-renamed-nodes.pl
===================================================================
--- trunk/tools/check-renamed-nodes.pl (rev 0)
+++ trunk/tools/check-renamed-nodes.pl 2007-08-29 16:14:44 UTC (rev 7585)
Changed blocks: 1, Lines Added: 70, Lines Deleted: 0; 2233 bytes
@@ -0,0 +1,70 @@
+#! /usr/bin/perl -w
+# vim:set ts=2 sw=2 expandtab:
+
+# check-renamed-nodes.pl - checks the current renamed-nodes file and
+# ensures the target ID exists somewhere
+
+# Martin MC Brown
+# mc@stripped
+# 2007-08-29
+
+use strict;
+use lib qw(./tools/ ../tools ../../tools ../../../trunk/tools);
+use IDMap;
+use Getopt::Long;
+use Data::Dumper;
+
+my ($srcpathopt,$debug,$showreverse,$showlevel,$showtype,$optformat) = ('',0,0,0,'','');
+my @srcpaths = ('.',
+ '../refman-5.1',
+ '../refman-5.0',
+ '../refman-4.1',
+ '../refman-common',
+ '../gui-common',
+ '../internals',
+ '../query-browser',
+ '../administrator',
+ '../migration-toolkit',
+ '../workbench',
+ '../falcon',
+ '../ndbapi',
+ './refman-5.1',
+ './refman-5.0',
+ './refman-4.1',
+ './refman-common',
+ './gui-common',
+ './internals',
+ './query-browser',
+ './administrator',
+ './migration-toolkit',
+ './workbench',
+ './falcon',
+ './ndbapi',
+ );
+
+my $idmap = IDMap->new({sources => \@srcpaths});
+
+open(NODES,"renamed-nodes.txt") or die "Couldn't find a renamed-nodes file I liked\n";
+
+while(my $line = <NODES>)
+{
+ next if ($line =~ m/^\#/);
+ chomp($line);
+
+ my ($src,$id) = split (/[ \t]+/,$line);
+
+ my $chkid = $id;
+
+ next if ($id =~ m/^http/);
+ next if ($id =~ m/^\.\./);
+ if ($id =~ m/^(.*?)\#(.*?)$/)
+ {
+
+ $chkid = $2;
+ }
+ if (!exists($idmap->{$chkid}->{file}))
+ {
+ print "Can't find id $chkid (redirected from $src (itself from $line))\n";
+ }
+
+}
Property changes on: trunk/tools/check-renamed-nodes.pl
___________________________________________________________________
Name: svn:executable
+ *
| Thread |
|---|
| • svn commit - mysqldoc@docsrva: r7585 - trunk/tools | mcbrown | 29 Aug |