[mpich2-commits] r4220 - mpich2/trunk/maint

gropp at mcs.anl.gov gropp at mcs.anl.gov
Sat Mar 28 16:37:21 CDT 2009


Author: gropp
Date: 2009-03-28 16:37:21 -0500 (Sat, 28 Mar 2009)
New Revision: 4220

Added:
   mpich2/trunk/maint/findunusederrtxt
Log:
Added a script to help find unused error strings

Added: mpich2/trunk/maint/findunusederrtxt
===================================================================
--- mpich2/trunk/maint/findunusederrtxt	                        (rev 0)
+++ mpich2/trunk/maint/findunusederrtxt	2009-03-28 21:37:21 UTC (rev 4220)
@@ -0,0 +1,30 @@
+#! /usr/bin/perl -w
+#
+open FD, "<unusederr.txt";
+%errkeys = ();
+while (<FD>) {
+    if (/^Name\s\*\*([\w\| \%]+)\sis defined in\s(.*)/) {
+	my $errname = $1;
+	my $location = $2;
+	$errkeys{$errname} = $location;
+    }
+}
+close FD;
+foreach $errname (sort(keys(%errkeys))) {
+    my $location = $errkeys{$errname};
+    print "About to run on $errname ($location)\n";
+    open FDG, "grep -R '\"\\\*\\\*$errname\"' src 2>&1 |";
+    while (<FDG>) {
+	# Skip those svn files
+	if (/\/\.svn\//) { next; }
+	# Skip the definition file
+	if (/errnames\.txt/) { next; }
+	if (/errnames-old\.txt/) { next; }
+	# Skip the translation files
+	if (/errhan\/defmsg\.h/) { next; }
+	if (/errhan\/windefmsg\.h/) { next; }
+	print $_;
+    }
+    close FDG;
+}
+


Property changes on: mpich2/trunk/maint/findunusederrtxt
___________________________________________________________________
Name: svn:executable
   + *



More information about the mpich2-commits mailing list