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.

111 lines
3.1 KiB

  1. @echo off
  2. REM -----------------------------------------------------------------------
  3. REM genInfList.cmd
  4. REM USAGE: genInfList.cmd
  5. REM It generates %SKU%_inf.txt in _NTPostBld\build_logs dir
  6. REM containing the names of all the inf files valid for that SKU
  7. REM AUTHOR: Surajp
  8. REM -----------------------------------------------------------------------
  9. @perl -x "%~f0" %*
  10. @goto :EOF
  11. #!perl
  12. use strict;
  13. use lib $ENV{RAZZLETOOLPATH} . "\\PostBuildScripts";
  14. use lib $ENV{RAZZLETOOLPATH};
  15. use PbuildEnv;
  16. use ParseArgs;
  17. use cksku;
  18. use Logmsg;
  19. sub Usage { print<<USAGE; exit(1) }
  20. genInfList.cmd
  21. USAGE
  22. parseargs('?' => \&Usage);
  23. my( @FileLine,$KeyLine,$Left,$Right,$One,$Two,@Rest);
  24. my($nttree,%CDDataSKUs,$TempDir);
  25. unless (open INPUT_FILE,"$ENV{TMP}\\cddata.txt") {logmsg "ERROR OPENING FILE";} ;
  26. @FileLine=<INPUT_FILE> ;
  27. close FILE ;
  28. &OpenFilesForOutput();
  29. foreach $KeyLine (@FileLine) {
  30. ($Left, $Right)= split(/=/ ,$KeyLine);
  31. if ( $Left =~ /\.inf\b/){
  32. ($One,$Two,@Rest)=split (/\:/ ,$Right);
  33. if ($Two =~ /w/){
  34. print OUTPUT_FILE_PRO "$Left \n";
  35. }
  36. if ($Two =~ /p/){
  37. print OUTPUT_FILE_PER "$Left \n";
  38. }
  39. if ($Two =~ /b/){
  40. print OUTPUT_FILE_BLA "$Left \n";
  41. }
  42. if ($Two =~ /l/){
  43. print OUTPUT_FILE_SBS "$Left \n";
  44. }
  45. if ($Two =~ /s/){
  46. print OUTPUT_FILE_SRV "$Left \n";
  47. }
  48. if ($Two =~ /e/){
  49. print OUTPUT_FILE_ADS "$Left \n";
  50. }
  51. if ($Two =~ /d/){
  52. print OUTPUT_FILE_DTC "$Left \n";
  53. }
  54. }else{
  55. next;
  56. }
  57. }
  58. sub OpenFilesForOutput {
  59. %CDDataSKUs = map({uc$_ => cksku::CkSku($_, $ENV{lang}, $ENV{_BuildArch})} qw(PRO PER SRV BLA SBS ADS DTC));
  60. $nttree = $ENV{"_NTPostBld"};
  61. if ($CDDataSKUs{'PRO'} ) {
  62. unless ( open OUTPUT_FILE_PRO ,">$nttree\\build_logs\\pro_inf.txt" ){ logmsg ("ERROR IN OPENING pro_inf.txt");
  63. exit(1);
  64. }
  65. }
  66. if ($CDDataSKUs{'PER'} ) {
  67. unless ( open OUTPUT_FILE_PER ,">$nttree\\build_logs\\per_inf.txt" ){ logmsg ("ERROR IN OPENING per_inf.txt");
  68. exit(1);
  69. }
  70. }
  71. if ($CDDataSKUs{'SRV'} ) {
  72. unless ( open OUTPUT_FILE_SRV ,">$nttree\\build_logs\\srv_inf.txt" ){ logmsg ("ERROR IN OPENING srv_inf.txt");
  73. exit(1);
  74. }
  75. }
  76. if ($CDDataSKUs{'BLA'} ) {
  77. unless ( open OUTPUT_FILE_BLA ,">$nttree\\build_logs\\bla_inf.txt" ){ logmsg ("ERROR IN OPENING bla_inf.txt");
  78. exit(1);
  79. }
  80. }
  81. if ($CDDataSKUs{'SBS'} ) {
  82. unless ( open OUTPUT_FILE_SBS ,">$nttree\\build_logs\\sbs_inf.txt" ){ logmsg ("ERROR IN OPENING sbs_inf.txt");
  83. exit(1);
  84. }
  85. }
  86. if ($CDDataSKUs{'ADS'} ) {
  87. unless ( open OUTPUT_FILE_ADS ,">$nttree\\build_logs\\ads_inf.txt" ){ logmsg ("ERROR IN OPENING ads_inf.txt");
  88. exit(1);
  89. }
  90. }
  91. if ($CDDataSKUs{'DTC'} ) {
  92. unless ( open OUTPUT_FILE_DTC ,">$nttree\\build_logs\\dtc_inf.txt" ){ logmsg ("ERROR IN OPENING dtc_inf.txt");
  93. exit(1);
  94. }
  95. }
  96. }
  97. __END__