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.

59 lines
1.6 KiB

  1. @REM -----------------------------------------------------------------
  2. @REM
  3. @REM spfilelist.cmd - JeremyD
  4. @REM Create lists of files used by SP scripts.
  5. @REM
  6. @REM Copyright (c) Microsoft Corporation. All rights reserved.
  7. @REM
  8. @REM -----------------------------------------------------------------
  9. @perl -x "%~f0" %*
  10. @goto :EOF
  11. #!perl
  12. #line 12
  13. use strict;
  14. use warnings;
  15. use lib $ENV{RAZZLETOOLPATH} . "\\PostBuildScripts";
  16. use lib $ENV{RAZZLETOOLPATH};
  17. use lib $ENV{RAZZLETOOLPATH} . "\\PostBuildScripts\\svcpack";
  18. use PbuildEnv;
  19. use ParseArgs;
  20. use IO::File;
  21. use SP;
  22. use Utils;
  23. sub Usage { print<<USAGE; exit(1) }
  24. spfilelist.cmd [-l <language>]
  25. Creates file lists used by other SP scripts.
  26. build_logs\\spfiles.txt
  27. Files in the cd image that differ from the gold version
  28. build_logs\\spdrivers.txt
  29. Files in driver.cab that differ from the gold version
  30. USAGE
  31. parseargs('?' => \&Usage);
  32. for my $sku (SP::sp_skus()) {
  33. Utils::mkdir("$ENV{_NTPOSTBLD}\\SP\\data\\$sku");
  34. my $out_fh = IO::File->new("$ENV{_NTPOSTBLD}\\SP\\data\\$sku\\driver_info.txt", 'w');
  35. for my $driver (get_drivers($sku)) {
  36. print $out_fh join ("\t", Utils::file_info($driver, $ENV{_NTPOSTBLD})), "\n";
  37. }
  38. }
  39. sub get_drivers {
  40. my $sku = shift;
  41. my @files;
  42. for my $file ("$ENV{TEMP}\\commondrivers.txt", "$ENV{TEMP}\\${sku}drivers.txt") {
  43. my $fh = IO::File->new($file, 'r') or die "drivercab data file missing ($file): $!";
  44. push @files, $fh->getlines;
  45. }
  46. chomp(@files);
  47. return map {"$ENV{_NTPOSTBLD}\\$_"} @files;
  48. }