File: findunusederrtxt

package info (click to toggle)
mpich 3.3-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 131,836 kB
  • sloc: ansic: 975,868; cpp: 57,437; f90: 53,762; perl: 19,562; xml: 12,464; sh: 12,303; fortran: 7,875; makefile: 7,078; ruby: 126; java: 100; python: 98; lisp: 19; php: 8; sed: 4
file content (30 lines) | stat: -rwxr-xr-x 717 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#! /usr/bin/env perl
use warnings;

#
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>) {
	if (/^\.git\//) { 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;
}