Leaked source code of windows server 2003
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.

185 lines
7.4 KiB

  1. @echo off
  2. REM ------------------------------------------------------------------
  3. REM
  4. REM <<template_script.cmd>>
  5. REM <<purpose of this script>>
  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 BuildName;
  19. use Logmsg;
  20. sub Usage { print<<USAGE; exit(1) }
  21. Usage intltime.cmd -b:<BuildName> -t:<Timestamp> [-c] [-i]\
  22. -b:<BuildName> The full build name to snap
  23. -t:<Timestamp> The timestamp to sync the source tree
  24. -c Full clean build WILL DELETE %_NTTREE%, %_NTPOSTBLD%, SOURCES!
  25. -i Incremental build
  26. USAGE
  27. my ($Buildname, $Timestamp, $Clean, $Incremental);
  28. parseargs('?' => \&Usage,
  29. 'b:' => \$Buildname,
  30. 't:' => \$Timestamp,
  31. 'c' => \$Clean,
  32. 'i' => \$Incremental);
  33. if (! defined $Timestamp) {
  34. exit;
  35. }
  36. my $Buildno = build_number("$Buildname");
  37. my %commands = ();
  38. %commands = (
  39. 1 => 'echo Starting INCREMENTAL intl time...',
  40. 10 => 'echo Cleanup operations...NONE',
  41. 20 => 'echo SD mapping operations...',
  42. 21 => 'cd %_ntbindir%\tools& sd sync *',
  43. 22 => 'cd %_ntbindir%\tools\postbuildscripts& sd sync ...',
  44. 23 => 'cd %_ntbindir%\tools& perl intlmap.pl /q',
  45. 25 => 'cd %_ntbindir%\tools& perl intlmap.pl -l:' . "$ENV{Lang}" . ' /q',
  46. # 27 => 'cd %_ntbindir%\tools& intlsdop.cmd -d:%sdxroot% -t:' . "$Timestamp" . ' -f -o:s',
  47. 30 => 'echo SD syncing operations...',
  48. 31 => 'echo SD syncing root...',
  49. 32 => 'cd %_ntbindir%& sd sync *@'. "$Timestamp",
  50. 35 => 'echo SD syncing tools...',
  51. 36 => 'cd %_ntbindir%\tools& sd sync ...@'. "$Timestamp",
  52. 37 => 'cd %_ntbindir%\tools& sd sync *',
  53. 38 => 'cd %_ntbindir%\tools\postbuildscripts& sd sync ...',
  54. 42 => 'echo SD syncing base...',
  55. 43 => 'cd %_ntbindir%\base& sd sync ...@'. "$Timestamp",
  56. 44 => 'echo SD syncing developer...',
  57. 45 => 'cd %_ntbindir%\developer& sd sync ...@'. "$Timestamp",
  58. 46 => 'echo SD syncing drivers...',
  59. 47 => 'cd %_ntbindir%\drivers& sd sync ...@'. "$Timestamp",
  60. 48 => 'echo SD syncing ds...',
  61. 49 => 'cd %_ntbindir%\ds& sd sync ...@'. "$Timestamp",
  62. 50 => 'echo SD syncing mergedcomponents...',
  63. 51 => 'cd %_ntbindir%\mergedcomponents& sd sync ...@'. "$Timestamp",
  64. 52 => 'echo SD syncing net...',
  65. 53 => 'cd %_ntbindir%\net& sd sync ...@'. "$Timestamp",
  66. 54 => 'echo SD syncing public...',
  67. 55 => 'cd %_ntbindir%\public& sd sync ...@'. "$Timestamp",
  68. 56 => 'echo SD syncing published...',
  69. 57 => 'cd %_ntbindir%\published& sd sync ...@'. "$Timestamp",
  70. 58 => 'echo SD syncing sdktools...',
  71. 59 => 'cd %_ntbindir%\sdktools& sd sync ...@'. "$Timestamp",
  72. 60 => 'echo SD syncing termsrv...',
  73. 61 => 'cd %_ntbindir%\termsrv& sd sync ...@'. "$Timestamp",
  74. 65 => 'echo SD syncing loc project...',
  75. 66 => 'cd %_ntbindir%\loc\bin\\' . "$ENV{Lang}" . '& sd sync ...',
  76. 67 => 'cd %_ntbindir%\loc\res\\' . "$ENV{Lang}" . '& sd sync ...',
  77. # 69 => 'cd %_ntbindir%\tools& intlsdop.cmd -l:' . "$ENV{Lang}" . ' -f -o:s',
  78. # 70 => 'cd %_ntbindir%\tools\postbuildscripts& perl snapbin.pl -n:' . "$Buildno". ' -s:\\intblds10\release\usa\\' . "$Buildname" . ' -i',
  79. 80 => 'echo Compile common targets...',
  80. 81 => 'cd %_ntbindir%\tools& perl intlbld.pl -l:intl',
  81. 85 => 'echo Compile common lang targets...',
  82. 86 => 'cd %_ntbindir%\tools& perl copylang.pl -l:' . "$ENV{Lang}" . ' -i',
  83. 87 => 'cd %_ntbindir%\tools& perl intlbld.pl -l:' . "$ENV{Lang}",
  84. 90 => 'cd %_ntbindir%\tools& postbuild.cmd -l:' . "$ENV{Lang}" . ' -full',
  85. 99 => 'echo Finished INCREMENTAL intl time.',
  86. );
  87. if (defined $Clean)
  88. {
  89. %commands = (
  90. 1 => 'echo Starting CLEAN intl time...',
  91. 10 => 'echo Cleanup operations...',
  92. 11 => 'cd %_ntdrive%& rd /s/q %_nttree%',
  93. 12 => 'cd %_ntdrive%& rd /s/q %_ntpostbld%',
  94. # 13 => 'cd %_ntdrive%& rd /s/q %temp%',
  95. 14 => 'cd %_ntbindir%& perl tools\scorch.pl -scorch=%_ntbindir%',
  96. 20 => 'echo SD mapping operations...',
  97. 21 => 'cd %_ntbindir%\tools& sd sync -f *',
  98. 22 => 'cd %_ntbindir%\tools\postbuildscripts& sd sync -f ...',
  99. 23 => 'cd %_ntbindir%\tools& perl intlmap.pl /q',
  100. 25 => 'cd %_ntbindir%\tools& perl intlmap.pl -l:' . "$ENV{Lang}" . ' /q',
  101. # 27 => 'cd %_ntbindir%\tools& intlsdop.cmd -d:%sdxroot% -t:' . "$Timestamp" . ' -f -o:s',
  102. 30 => 'echo SD syncing operations...',
  103. 31 => 'echo SD syncing root...',
  104. 32 => 'cd %_ntbindir%& sd sync -f *@'. "$Timestamp",
  105. 35 => 'echo SD syncing tools...',
  106. 36 => 'cd %_ntbindir%\tools& sd sync -f ...@'. "$Timestamp",
  107. 37 => 'cd %_ntbindir%\tools& sd sync -f *',
  108. 38 => 'cd %_ntbindir%\tools\postbuildscripts& sd sync -f ...',
  109. 42 => 'echo SD syncing base...',
  110. 43 => 'cd %_ntbindir%\base& sd sync -f ...@'. "$Timestamp",
  111. 44 => 'echo SD syncing developer...',
  112. 45 => 'cd %_ntbindir%\developer& sd sync -f ...@'. "$Timestamp",
  113. 46 => 'echo SD syncing drivers...',
  114. 47 => 'cd %_ntbindir%\drivers& sd sync -f ...@'. "$Timestamp",
  115. 48 => 'echo SD syncing ds...',
  116. 49 => 'cd %_ntbindir%\ds& sd sync -f ...@'. "$Timestamp",
  117. 50 => 'echo SD syncing mergedcomponents...',
  118. 51 => 'cd %_ntbindir%\mergedcomponents& sd sync -f ...@'. "$Timestamp",
  119. 52 => 'echo SD syncing net...',
  120. 53 => 'cd %_ntbindir%\net& sd sync -f ...@'. "$Timestamp",
  121. 54 => 'echo SD syncing public...',
  122. 55 => 'cd %_ntbindir%\public& sd sync -f ...@'. "$Timestamp",
  123. 56 => 'echo SD syncing published...',
  124. 57 => 'cd %_ntbindir%\published& sd sync -f ...@'. "$Timestamp",
  125. 58 => 'echo SD syncing sdktools...',
  126. 59 => 'cd %_ntbindir%\sdktools& sd sync -f ...@'. "$Timestamp",
  127. 60 => 'echo SD syncing termsrv...',
  128. 61 => 'cd %_ntbindir%\termsrv& sd sync -f ...@'. "$Timestamp",
  129. 65 => 'echo SD syncing loc project...',
  130. 66 => 'cd %_ntbindir%\loc\bin\\' . "$ENV{Lang}" . '& sd sync -f ...',
  131. 67 => 'cd %_ntbindir%\loc\res\\' . "$ENV{Lang}" . '& sd sync -f ...',
  132. # 69 => 'cd %_ntbindir%\tools& intlsdop.cmd -l:' . "$ENV{Lang}" . ' -f -o:s',
  133. # 70 => 'cd %_ntbindir%\tools\postbuildscripts& perl snapbin.pl -n:' . "$Buildno". ' -s:\\\\intblds10\release\usa\\' . "$Buildname",
  134. 70 => 'cd %_ntbindir%\tools\postbuildscripts& perl snapbin.pl -n:' . "$Buildno",
  135. 80 => 'echo Compile common targets...',
  136. 81 => 'cd %_ntbindir%\tools& perl intlbld.pl -l:intl -c',
  137. 85 => 'echo Compile common lang targets...',
  138. 86 => 'cd %_ntbindir%\tools& perl copylang.pl -l:' . "$ENV{Lang}",
  139. 87 => 'cd %_ntbindir%\tools& perl intlbld.pl -l:' . "$ENV{Lang}" . ' -c',
  140. # 90 => 'cd %_ntbindir%\tools& postbuild.cmd -l:' . "$ENV{Lang}" . ' -full',
  141. 99 => 'echo Finished CLEAN intl time.',
  142. );
  143. }
  144. timemsg("Starting");
  145. my $step;
  146. my $result;
  147. foreach $step (sort keys %commands) {
  148. print "Step: " . $step . "=>" . $commands{$step} . "\n";
  149. $result = `$commands{$step}`;
  150. print "Result: " . $result . "\n";
  151. }
  152. timemsg("Finished");
  153. 1;