iserror.pl
Upload User: caisha3
Upload Date: 2013-09-21
Package Size: 208739k
Code Size: 2k
Category:

Windows Develop

Development Platform:

Visual C++

  1. #! perl
  2. # ISERROR.PL
  3. # scan BUILD.LOG (or whatever) for errors which are put in BUILD.ERR
  4. #
  5. # Command-line arguments:
  6. # PERL ISERROR.PL <1> <2>
  7. # <1> Source file (default is BUILD.LOG)
  8. # <2> Destination file (default is BUILD.ERR)
  9. if ($ARGV[0]) { $filename = $ARGV[0];}
  10. else {          $filename = "BUILD.LOG";}
  11. if ($ARGV[1]) { $outfile = $ARGV[1];}
  12. else {          $outfile = "ERROR.LOG";}
  13. unlink($outfile);
  14. $fErrOpen = 0;
  15. open(LOG, $filename) || die "ISERROR.PL -- Can't open $filename: $!n";
  16. while ($line = <LOG>)   {
  17. # if ($line =~ /.*Build complete.*/) {$complete=-1;}
  18. if ($line =~ /.*[error|warning|fatal error] [A-Z]+[0-9][0-9][0-9][0-9] ?:.*/) {
  19. unless (($line =~ /.*warning M0002:.*IDispatch::Invoke/) ||
  20. ($line =~ /.*warning RC4509 : Resource types '10' and '240' were both mapped to 'HEXA'/) ||
  21. ($line =~ /.*warning LNK4099: PDB "ole2auto.pdb" was not found with/) ||
  22. ($line =~ /.*More than 64 delegated methods not supported/) ||
  23. ($line =~ /.*LINK : warning LNK4001: no object files specified; libraries used/)) {
  24. if ($fErrOpen == 0) {
  25. $fErrOpen = -1;
  26. open(OUT, ">>$outfile") ||
  27. die "ISERROR.PL -- Can't create $outfile: $!n";
  28. $oldhandle=select(OUT);
  29. print "The build generated the following messages:n";
  30. print "----------------------------------------------------n";
  31. }
  32. print $line;
  33. }
  34. }
  35. }
  36. # If we didn't find "Build complete" or any specific errors
  37. #if ($complete == 0 && $fErrOpen == 0) {
  38. # $fErrOpen = -1;
  39. # open(OUT, ">>$outfile") || die "ISERROR.PL -- Can't create $outfile: $!n";
  40. # $oldhandle=select(OUT);
  41. # print "Build failed for unknown reasons.n";
  42. # print "---------------------------------------------n";
  43. # }
  44. close(LOG);
  45. if ($fErrOpen == -1) {
  46. close(OUT);
  47.     exit(1);
  48. }
  49. exit(0);