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.

61 lines
1.3 KiB

  1. use lib $ENV{RAZZLETOOLPATH};
  2. use Logmsg;
  3. $sed_file = $ARGV[0];
  4. $temp_dir = $ARGV[1];
  5. open(F, "< $sed_file");
  6. my %file_array;
  7. my %location_array;
  8. my $dir_array;
  9. my $source_dir;
  10. while ($line = <F>)
  11. {
  12. chop $line;
  13. if ($line =~ m/FILE\d+=/)
  14. {
  15. @fields = split(/=/, $line);
  16. #print "$fields[0] $fields[1]\n";
  17. $file_array{$fields[0]} = $fields[1];
  18. }
  19. if ($line =~ m/SourceFiles\d+=/)
  20. {
  21. @fields = split(/=/, $line);
  22. #print "$fields[0] $fields[1]\n";
  23. $dir_array{$fields[0]} = $fields[1];
  24. }
  25. if ($line =~ m/\[SourceFiles(\d+)\]/)
  26. {
  27. $source_dir = "SourceFiles$1";
  28. while ($line = <F>)
  29. {
  30. chop $line;
  31. if ($line =~ m/\[SourceFiles(\d+)\]/)
  32. {
  33. $source_dir = "SourceFiles$1";
  34. }
  35. if ($line =~ m/%(FILE\d+)%/)
  36. {
  37. $location_array{$1} = $dir_array{$source_dir};
  38. }
  39. else
  40. {
  41. break;
  42. }
  43. }
  44. }
  45. }
  46. my @file_keys = keys(%location_array);
  47. my $source_file;
  48. my $dest_file;
  49. foreach(@file_keys)
  50. {
  51. $source_file = join("", $location_array{$_}, "\\", $file_array{$_});
  52. $dest_file = join("", $temp_dir, "\\", $file_array{$_});
  53. logmsg ("$source_file -> $dest_file \n");
  54. `copy $source_file $dest_file`;
  55. }