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.

213 lines
7.5 KiB

  1. ##
  2. ## DIFF.PL
  3. ## Sub-routines used to windiff CD Trees
  4. ## Created by: Robert E. Blue (a-robebl) 09/08/99
  5. ##
  6. sub tree_diff {
  7. if ( $platform eq "x86" ) {
  8. $platdir = "i386";
  9. } else {
  10. $platdir = $platform;
  11. }
  12. `ECHO \@ECHO OFF > $log_path\\wind.cmd`;
  13. if ( $product =~ /CD2/i ) {
  14. $local = "$drive\\$lang\\cd2" unless $local; ### For wind.bat
  15. @cd2_plats = ( 'x86' );
  16. push @cd2_plats, 'nec98' if $lang =~ /JPN/i;
  17. foreach $cd2_plat ( @cd2_plats ) {
  18. $bld_root{$cd2_plat} = find_bldsrv( $bld_plat{uc $cd2_plat} ) or die "ERROR: No release shares found for $cd2_plat!\n\n";
  19. }
  20. &wind_cmd( "dbg.htm", "\\\\nighthawk\\nec\\review\\scratch\\w2ktool\\dbg.htm", "dbg.htm-cd2" );
  21. &wind_cmd( "autorun.inf", "$bld_root{'x86'}\\fre.wks\\symbolcd\\cd\\autorun.inf", "autorun.inf-cd2" );
  22. &wind_cmd( "setup\\gifs", "$bld_root{'x86'}\\fre.wks\\symbolcd\\cd\\setup\\gifs", "gifs-setup-cd2" ) unless $cd2_plat =~ /nec98/i;
  23. foreach $cd2_plat ( @cd2_plats ) {
  24. if ( $cd2_plat =~ /x86/i ) { $plat_dir = 'i386'; } else { $plat_dir = $cd2_plat; }
  25. &wind_cmd( "symbols\\$plat_dir\\retail", "$bld_root{$cd2_plat}\\fre.wks\\symbolcd\\cd\\symbols\\$plat_dir\\retail", "$cd2_plat\-fre-cd2" );
  26. &wind_cmd( "symbols\\$plat_dir\\debug", "$bld_root{$cd2_plat}\\chk.wks\\symbolcd\\cd\\symbols\\$plat_dir\\debug", "$cd2_plat\-chk-cd2" );
  27. &wind_cmd( "tools\\$plat_dir", "$bld_root{$cd2_plat}\\fre.wks\\symbolcd\\cd\\tools\\$plat_dir", "$cd2_plat\-tools-cd2" ) unless $cd2_plat =~ /nec98/i;
  28. &wind_cmd( "setup\\$plat_dir", "$bld_root{$cd2_plat}\\fre.wks\\symbolcd\\cd\\setup\\$plat_dir", "$cd2_plat\-setup-cd2" ) unless $cd2_plat =~ /nec98/i;
  29. }
  30. `$log_path\\wind.cmd`;
  31. `del $log_path\\wind.cmd`;
  32. ### Check windiff logs
  33. print "\nChecking windiff logs...\n\n";
  34. wdfcheck "dbg.htm-cd2";
  35. wdfcheck "autorun.inf-cd2";
  36. wdfcheck "gifs-setup-cd2";
  37. foreach $cd2_plat ( @cd2_plats ) {
  38. wdfcheck "$cd2_plat\-fre-cd2";
  39. wdfcheck "$cd2_plat\-chk-cd2";
  40. wdfcheck "$cd2_plat\-tools-cd2" unless $cd2_plat =~ /nec98/i;
  41. wdfcheck "$cd2_plat\-setup-cd2" unless $cd2_plat =~ /nec98/i;
  42. }
  43. } else {
  44. $bld_root{$platform} = find_bldsrv( $bld_plat{uc $platform} ) or die "ERROR: No release shares found for $platform!\n\n";
  45. $ntbuilds = "$bld_root{$platform}\\$fre.$product";
  46. $local = "$drive\\$lang\\$fre.$product\\$platform" unless $local;
  47. ### Platform Directory.
  48. &wind_cmd( $platdir, $ntbuilds, $platdir );
  49. ### WINNTUPG
  50. &wind_cmd( "$platdir\\winntupg", "$ntbuilds\\winnt32\\winntupg", "winntupg" );
  51. ### WIN9XUPG
  52. &wind_cmd( "$platdir\\win9xupg", "$ntbuilds\\winnt32\\win9xupg", "win9xupg" ) if $platform =~ /x86/i;
  53. ### COMPDATA
  54. &wind_cmd( "$platdir\\compdata", "$ntbuilds\\winnt32\\compdata", "compdata" );
  55. if ( $lang =~ /USA/i ) {
  56. ### SUPPORT
  57. &wind_cmd( "support", "$ntbuilds\\support", "support" );
  58. ### VALUEADD
  59. &wind_cmd( "valueadd", "$bld_root{$platform}\\$fre.wks\\valueadd", "valueadd" );
  60. ### DISCOVER
  61. &wind_cmd( "discover", "$bld_root{$platform}\\$fre.wks\\discover", "discover" ) if $product =~ /wks/i;
  62. } else {
  63. ### SUPPORT
  64. &wind_cmd( "support", "\\\\intlrel\\nt5media\\$lang\\$product\\x86\\support", "support" );
  65. ### VALUEADD
  66. &wind_cmd( "valueadd", "\\\\intlrel\\nt5media\\$lang\\$product\\x86\\valueadd", "valueadd" );
  67. ### DISCOVER
  68. &wind_cmd( "discover", "\\\\rastaman\\external\\src\\nt5\\discover\\$lang\\content", "discover" ) if $product =~ /wks/i;
  69. }
  70. ### PRINTERS
  71. if ( $product =~ /(SRV|ENT|DTC)/i ) {
  72. &wind_cmd( "printers", "$ntbuilds\\printers", "printers" );
  73. &wind_cmd( "clients", "$ntbuilds\\clients", "clients" );
  74. }
  75. `$log_path\\wind.cmd`;
  76. `del $log_path\\wind.cmd`;
  77. ### Check windiff logs
  78. print "\nChecking windiff logs...\n\n";
  79. wdfcheck "$platdir";
  80. wdfcheck "winntupg";
  81. wdfcheck "support";
  82. wdfcheck "msreport";
  83. wdfcheck "win9xupg" if $platform =~ /x86/i;
  84. wdfcheck "reskit";
  85. wdfcheck "discover" if $product =~ /wks/i;
  86. wdfcheck "valueadd";
  87. wdfcheck "compdata";
  88. if ( $product =~ /(SRV|ENT|DTC)/i ) {
  89. wdfcheck "printers";
  90. wdfcheck "clients";
  91. }
  92. }
  93. }
  94. ####################################################################
  95. ### Create the wind.cmd file to be executed by &runwindiff()
  96. ###
  97. sub wind_cmd {
  98. my $cmplcl = $_[0];
  99. my $cmpsrc = $_[1];
  100. my $cmpname = uc $_[2];
  101. print "Windiffing $cmplcl...\n";
  102. `echo start windiff $local\\$cmplcl $cmpsrc -T -Sdx $log_path\\$build-$platform-$fre-$product-$cmpname.wdf >> $log_path\\wind.cmd`;
  103. `echo sleep 1 >> $log_path\\wind.cmd`;
  104. }
  105. #####################################################################
  106. ### Check the windiff logs to find if any files did not match and
  107. ### attempt to fix them if they do not.
  108. ###
  109. sub wdfcheck {
  110. $wdf_log = "$log_path\\$build-$platform-$fre-$product-$_[0].wdf";
  111. $fix_files = 1 if $_[0] =~ /fix/i;
  112. print "Checking $wdf_log for errors\n";
  113. if ( -e $wdf_log ) {
  114. $wdf_list = `type $wdf_log`;
  115. unless ( $wdf_list =~ /-- 0 files listed/g ) {
  116. while ( $wdf_list =~ /\.\\(\S+)/g ) {
  117. $problem_files++ unless $1 =~ /(setupp.ini|2000rkst.msi|different in blanks)/i;
  118. push @bad_files, $1;
  119. $wdf_count++
  120. }
  121. if ( $problem_files ) {
  122. $wdf_brk++;
  123. print "Found problem files in $build $platform $fre.$product \\$_[0]\n";
  124. system "start notepad $wdf_log";
  125. ### Let's make it easier to check for different in blanks only (CD media only).
  126. if ( $problem_files <= 25 && $goldcheck_ver ) {
  127. $wdf_list =~ /-- (.*) : (.*) --/;
  128. $wdf_local = $1;
  129. $wdf_remote = $2;
  130. foreach $pf ( @bad_files ) {
  131. next if $pf =~ /(setupp.ini|2000rkst.msi)/i;
  132. $counter++;
  133. print " `--> Checking if $pf is different in blanks only.\n";
  134. ### We only want to start 5 at a time.
  135. $dibo[$dibo_counter] .= "start windiff $wdf_local\\$pf $wdf_remote\\$pf && ";
  136. if ( $counter == 5 ) {
  137. $dibo_counter++;
  138. $counter = 0;
  139. }
  140. }
  141. ### Execute the windiff.
  142. foreach $dibo_wdf ( @dibo ) {
  143. `$dibo_wdf ECHO.`;
  144. }
  145. }
  146. if ( $fix_files ) {
  147. print " `-- Would you like to start Share Fixer now? [Y/N] ";
  148. $verify = <STDIN> ;
  149. if ( $verify =~ ( /^Y/i ) ) {
  150. print " `-- Fixing problem files found in \\$_[0]...\n";
  151. `start sharefix $wdf_log`;
  152. } else {
  153. print " `-- Ok, not fixing problem files found in \\$_[0]...\n";
  154. }
  155. }
  156. }
  157. }
  158. }
  159. }
  160. return 1;