Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

64 lines
1.5 KiB

  1. #perl
  2. #! perl
  3. use Getopt::Long;
  4. $mail = 1;
  5. $mailto="cgreen";
  6. $mailfrom="cgreen\@valvesoftware.com";
  7. $branch="main";
  8. $result = GetOptions(
  9. "nosync" => \$nosync,
  10. "clean" => \$clean,
  11. "mailto:s" => \$mailto,
  12. "branch:s" => \$branch,
  13. "mailfrom:s" => \$mailfrom,
  14. "mail" => \$mail );
  15. print STDERR `p4 sync` unless ($nosync);
  16. print STDERR `perl devtools/bin/vpc2linuxmake.pl`;
  17. print STDERR `make clean` if ($clean);
  18. open(ERROROUT, "./linux_makeinorder.sh 2>&1 |" ) || die "can't create pipe to compile";
  19. while(<ERROROUT>)
  20. {
  21. my $iserror = /error:/;
  22. $iserror = 1 if (/^.*:\d+:\d+:/);
  23. $errtxt .= $_ if ($iserror );
  24. print $_;
  25. }
  26. if (length($errtxt) )
  27. {
  28. if ($mail)
  29. {
  30. use Net::SMTP;
  31. open CHANGES, "p4 changes -m 10 -s submitted //ValveGames/$branch/src/...|";
  32. my @changes = <CHANGES>;
  33. close CHANGES;
  34. $smtp = Net::SMTP->new('exchange2.valvesoftware.com');
  35. $smtp->mail($mailfrom);
  36. $smtp->to($mailto);
  37. $smtp->data();
  38. $smtp->datasend("To: $mailto\n");
  39. $smtp->datasend("Subject: [$branch broken in linux]\n");
  40. $smtp->datasend("\nThere are errors building $branch for linux.\nSome help is available at http://intranet.valvesoftware.com/wiki/index.php/Writing_code_that_is_compatible_between_gcc_and_visual_studio\n\n$errtxt");
  41. $smtp->datasend("-" x 75);
  42. $smtp->datasend("\nLAST 10 SUBMITS TO MAIN:\n");
  43. $smtp->datasend(join("",@changes ) );
  44. $smtp->dataend();
  45. $smtp->quit;
  46. }
  47. else
  48. {
  49. print STDERR "*****ERRORS****\n$errtxt\n";
  50. }
  51. }