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.

61 lines
1.2 KiB

  1. #! /bin/perl
  2. #
  3. # Usage: UnlockXPFiles file ...
  4. # or UnlockXPFiles < filecontaininglist
  5. #
  6. @lockedfiles = ('LockedDB', 'LockedDrivers', 'LockedFiles');
  7. @list = @ARGV? @ARGV : <STDIN>;
  8. for (@list) {
  9. chomp;
  10. s/ //g;
  11. $inlist{lc $_}++;
  12. }
  13. $sdxroot = $ENV{'SDXROOT'};
  14. $popdir = "$sdxroot\\MergedComponents\\PopFilter";
  15. die "SDXROOT not defined\n" unless $sdxroot;
  16. for (@lockedfiles) {
  17. $fname{lc $_} = "$popdir\\$_";
  18. die "$_ not opened\n" unless -w $fname{lc $_};
  19. }
  20. for (@lockedfiles) {
  21. $t = $fname{lc $_};
  22. open IFD, '<' . $t or die "Could not open $t\n";
  23. open OFD, '>' . $t . '-NEW' or die "Could not open $t\n";
  24. for (<IFD>) {
  25. ($file) = split;
  26. $file = lc $file;
  27. do {$count{$file}++; next;} if $inlist{$file};
  28. print OFD $_;
  29. }
  30. close OFD;
  31. close IFD;
  32. }
  33. for (@list) {
  34. $fatal++, print "ERROR: $_ not found in files\n" if $count{lc $_} != 2;
  35. }
  36. exit 1 if $fatal;
  37. print "\nDO:\n";
  38. for (@lockedfiles) {
  39. $t = $fname{lc $_};
  40. print "copy $t-NEW\t$t\n";
  41. }
  42. print "\nRun 'sd submit $popdir\\Locked*' to check-in changes\n\n";
  43. exit 0;