fix_log_debug_art211.pl
Go to the documentation of this file.
1 
2 use strict;
3 use warnings;
4 
5 if( $#ARGV < 0 ) {
6  print "\n";
7  print "USAGE: fix_log_debug_art211.pl <input-file>\n";
8  print "\n";
9  exit 1;
10 }
11 
12 my $inputfile = $ARGV[0];
13 my $outputfile = $inputfile.".new";
14 
15 print "check $inputfile for LOG_DEBUG\n";
16 open(PIN, "< $inputfile") or die "Couldn't open $inputfile";
17 open(POUT, "> $outputfile") or die "Couldn't open $outputfile";
18 my $line;
19 while ( $line=<PIN> ) {
20  chop $line;
21  if (( $line =~ m/LOG_DEBUG/ ) && ( $line =~ m/<</ )) {
22  if ( $line =~ m/^\/\// ) {
23  print POUT "$line\n";
24  } else {
25  print "updating $line\n";
26  print POUT "// workaround for #19851\n";
27  print POUT "//$line\n";
28  $line =~ s/LOG_DEBUG/mf::LogDebug/;
29  print POUT "$line\n";
30  }
31  } else {
32  print POUT "$line\n";
33  }
34 
35 }
36 close(PIN);
37 close(POUT);
38 
39 exit(0);