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.

105 lines
3.7 KiB

  1. @echo off
  2. REM ------------------------------------------------------------------
  3. REM
  4. REM AllRel.cmd
  5. REM Check the status of release across release servers
  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} . "\\PostBuildScripts";
  15. use lib $ENV{RAZZLETOOLPATH};
  16. use PbuildEnv;
  17. use ParseArgs;
  18. use GetIniSetting;
  19. sub Usage { print<<USAGE; exit(1) }
  20. allrel [-n <build number>] [-b <branch>] [-a <arch>] [-t <type>]
  21. [-l <language>]
  22. Check the release servers specified in the .ini file for the state of
  23. the matching release.
  24. build number Build number for which to examine the relase logs.
  25. Default is latest build for each server / flavor.
  26. branch Branch for which to examine the release logs. Default is
  27. %_BuildBranch%.
  28. arch Build architecture for which to examine the release logs.
  29. Default is %_BuildArch%.
  30. type Build architecture for which to examine the release logs.
  31. Default is %_BuildType%.
  32. lang Language for which to examine the release logs. Default
  33. is 'usa'.
  34. USAGE
  35. my ($build, $branch, @arches, @types);
  36. parseargs('?' => \&Usage,
  37. 'n:'=> \$build,
  38. 'b:'=> \$branch,
  39. 'a:'=> \@arches,
  40. 't:'=> \@types);
  41. *GetSettingQuietEx = \&GetIniSetting::GetSettingQuietEx;
  42. my $back = 1;
  43. $build ||= '*';
  44. $branch ||= $ENV{_BUILDBRANCH};
  45. if (!@arches) { @arches = ('x86', 'ia64') }
  46. if (!@types) { @types = ('fre', 'chk') }
  47. for my $arch (@arches) {
  48. for my $type (@types) {
  49. print "$arch$type\n";
  50. my @servers = split / /, GetSettingQuietEx($branch, $ENV{LANG}, 'ReleaseServers', "$arch$type");
  51. for my $server (@servers) {
  52. print " $server\n";
  53. my $temp = 'c$\\temp';
  54. if ("\L$server" eq 'ntburnlab08') { $temp = 'c$\\winnt\\temp' }
  55. my $log_base = "\\\\$server\\$temp\\$ENV{LANG}";
  56. my @releases = glob "\\\\$server\\d\$\\release\\$ENV{LANG}\\$build.$arch$type.$branch.*";
  57. for (my $i=0; $i < $back and $i <= $#releases; $i++) {
  58. my ($build_name) = $releases[$#releases-$i] =~ /([^\\]+)$/;
  59. $build_name =~ s/_TEMP$//;
  60. my $log_dir = "$log_base\\$build_name";
  61. print " $build_name: ";
  62. my $log_file = "$log_dir\\srvrel.log";
  63. my $err_file = "$log_dir\\srvrel.err";
  64. if (-e $err_file and !-z $err_file) {
  65. print "ERROR\n";
  66. print " $err_file\n";
  67. }
  68. else {
  69. if (-e $log_file) {
  70. open FILE, $log_file or die $!;
  71. if (<FILE> =~ /Start \[srvrel.cmd\]/) {
  72. seek(FILE,-100,2);
  73. local $/ = undef;
  74. if (<FILE> =~ /Complete \[srvrel\.cmd\]/) {
  75. my $time = localtime((stat FILE)[9]);
  76. print "DONE AT $time\n";
  77. }
  78. else {
  79. print "RUNNING\n";
  80. }
  81. }
  82. else {
  83. print "FAILED TO PARSE LOG\n";
  84. print " $log_file\n";
  85. }
  86. close FILE;
  87. }
  88. else {
  89. print "NO LOG FOUND\n";
  90. }
  91. }
  92. }
  93. }
  94. print "\n";
  95. }
  96. }