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.

85 lines
2.5 KiB

  1. ########################
  2. # Cabinet Cache Manager
  3. ########################
  4. $RedistInfoLoc=$ARGV[0];
  5. $CabCacheTargetFile=$ARGV[1];
  6. $CabCacheFlag=$ARGV[2];
  7. $ProductTimeDate=$ARGV[3];
  8. $MyNTTREE=$ARGV[4];
  9. $Language=$ARGV[5];
  10. $LocalizedRoot=$ARGV[6];
  11. $RootDir=$ENV{DXROOT};
  12. $BuildType=$ENV{NTDEBUG};
  13. $AltSourceFiles=$ENV{_ALT_NTTREE};
  14. $MultiLocalizedDirectory="$LocalizedRoot\\multi";
  15. $LocalizedDirectory="$LocalizedRoot\\$Language";
  16. $BuildWarnMsg="nmake : warning CACMGR : ";
  17. $BuildErrMsg="nmake : error CACMGR : ";
  18. $WriteLockFile="wlfile.lck";
  19. open (WRITELOCK,">$WriteLockFile") || die "$BuildWrnMsg Time/Date process in use. Can't open $WriteLockFile";
  20. open (MAKEFLAG,">$CabCacheFlag") || die "$BuildErrMsg Problem creating flag file $CabCacheFlag";
  21. close (MAKEFLAG);
  22. $Path="$RootDir\\public\\sdk\\lib\\placefil.txt";
  23. open(PLACEFIL, $Path) || die "$BuildErrorMsg Unable to open placefil.txt at ".$Path." for input\n";
  24. @LocalizedFiles =grep(m/;localize/, <PLACEFIL>);
  25. close (PLACEFIL);
  26. $FileName=substr($CabCacheTargetFile,rindex($CabCacheTargetFile,"\\")+1);
  27. open (REDISTFILES,$RedistInfoLoc) || die "$BuildErrorMsg Unable to open nt51redist.dat at $RedistInfoLoc for input\n";
  28. ($FileConfiguration)=grep(m/$FileName/ig, <REDISTFILES>);
  29. close (REDISTFILES);
  30. ($FileName, $SubPath, $RedistTimeDate, $Filters) = split /,/,$FileConfiguration,4;
  31. $RedistTimeDate=~s/^\s*(.*?)\s*$/$1/;
  32. $FileName=~s/^\s*(.*?)\s*$/$1/;
  33. $SubPath=~s/^\s*(.*?)\s*$/$1/;
  34. #if (grep(m/$FileName/i, @LocalizedFiles))
  35. #{
  36. # if ($Filters=~m/SINGLELANGUAGE/ig )
  37. # {
  38. # $SubPath=($Language ne "eng")?$LocalizedDirectory:$SubPath;
  39. # }
  40. # else
  41. # {
  42. # $SubPath=$MultiLocalizedDirectory;
  43. # }
  44. #}
  45. if ($Filters=~m/SWITCHFILE/i){
  46. if ($BuildType eq "" || $BuildType eq "ntsdnodbg")
  47. {
  48. if ($Filters=~m/SWITCHFILER/i){
  49. $OriginalFile=$MyNTTREE."\\".$SubPath."\\".$FileName;
  50. }
  51. if ($Filters=~m/SWITCHFILED/i){
  52. $OriginalFile=$AltSourceFiles."\\".$SubPath."\\".$FileName;
  53. }
  54. } else {
  55. if ($Filters=~m/SWITCHFILER/i){
  56. $OriginalFile=$AltSourceFiles."\\".$SubPath."\\".$FileName;
  57. }
  58. if ($Filters=~m/SWITCHFILED/i){
  59. $OriginalFile=$MyNTTREE."\\".$SubPath."\\".$FileName;
  60. }
  61. }
  62. } else {
  63. $OriginalFile=$MyNTTREE."\\".$SubPath."\\".$FileName;
  64. }
  65. printf("\ncopying %s to \n %s\n\n",$OriginalFile, $CabCacheTargetFile);
  66. system "copy $OriginalFile,$CabCacheTargetFile";
  67. $TimeDateToUse=(($RedistTimeDate=~m/CURRENT DATE/i)||($RedistTimeDate eq ""))?$ProductTimeDate:$RedistTimeDate;
  68. system("touch /f /t $TimeDateToUse $CabCacheTargetFile\n");
  69. close (WRITELOCK);
  70. exit;