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.

69 lines
1.5 KiB

  1. @echo off
  2. REM ------------------------------------------------------------------
  3. REM
  4. REM SkuSize.cmd
  5. REM Calculate the size of the SKUs
  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 cksku;
  19. sub Usage { print<<USAGE; exit(1) }
  20. Calculate CD sizes
  21. USAGE
  22. parseargs('?' => \&Usage);
  23. #
  24. # Get the skus we want
  25. #
  26. my @SkuList = grep {cksku::CkSku($_, $ENV{LANG}, $ENV{_BuildArch})} qw(PRO PER SRV BLA ADS );
  27. #
  28. # Read recursive dir into an array.
  29. # Then get rid everything except files.
  30. #
  31. my $StartPath=$ENV{_NTPostBld};
  32. my $PathRegex=quotemeta $StartPath;
  33. my $LogFile="$StartPath\\build_logs\\SkuSize.$ENV{_BuildBranch}.$ENV{_BuildArch}$ENV{_BuildType}.log";
  34. my $Destination="\\\\winwebshares\\warteam";
  35. if (-e $LogFile) {
  36. unlink $LogFile;
  37. }
  38. open OUTFILE , ">$LogFile";
  39. foreach my $Sku ( @SkuList ) {
  40. my @RecursiveDir= `dir /s $StartPath\\$Sku`;
  41. my $Path="";
  42. foreach my $DirLine (@RecursiveDir) {
  43. if ($DirLine =~ /^\d+\/\d+\/\d+\s+\d+:\d+\s+(?:AM|PM)\s+([\d,]+)\s+(.+)$/) {
  44. my $File=$2;
  45. my $Size=$1;
  46. $Size =~ tr/,//d;
  47. print OUTFILE ("$Sku,$Path$File,$Size\n");
  48. }
  49. elsif ($DirLine =~ /$PathRegex\\$Sku\\(.+)/i) {
  50. $Path="$1\\";
  51. }
  52. }
  53. }
  54. close OUTFILE;
  55. # 'copy $LogFile $Destination`;