Source code of Windows XP (NT5)
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.

50 lines
1.2 KiB

  1. @echo off
  2. REM ------------------------------------------------------------------
  3. REM
  4. REM wrapper.cmd
  5. REM used by pbuild.cmd to manage async. processes
  6. REM
  7. REM Copyright (c) Microsoft Corporation. All rights reserved.
  8. REM
  9. REM ------------------------------------------------------------------
  10. perl -x "%~f0" %*
  11. goto :EOF
  12. #!perl
  13. use strict;
  14. use lib $ENV{RAZZLETOOLPATH};
  15. use Logmsg;
  16. use File::Basename;
  17. dbgmsg("wrapper args: " . join(', ', @ARGV));
  18. my ($instance, $command, @options) = @ARGV;
  19. my $short_name = basename($command);
  20. my $command_line = join ' ', $command, @options;
  21. my $start_time = time();
  22. if ( $command =~ /\.p[lm]/ ) {
  23. system( "perl $command_line" );
  24. } else {
  25. system( "$command_line" );
  26. }
  27. my $exit_code = $?;
  28. my $elapsed_time = time() - $start_time;
  29. infomsg("TIMING: $short_name took $elapsed_time seconds");
  30. # finally, send the messages needed to finish up the script
  31. my $event_name = "$short_name";
  32. $event_name .= ".$instance";
  33. dbgmsg("wrapper event name: $event_name");
  34. system( "perl \%RazzleToolPath\%\\PostBuildScripts\\cmdevt.pl -ih " .
  35. "$event_name" );
  36. system( "perl \%RazzleToolPath\%\\PostBuildScripts\\cmdevt.pl -is " .
  37. "$event_name" );
  38. if ($exit_code) {
  39. print "\nPossible error, sleeping 30 minutes\n";
  40. sleep 1800;
  41. }