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.

93 lines
2.5 KiB

  1. #
  2. # Create two mapping files, one for the Main view, the other for the Branch View.
  3. #
  4. use Cwd;
  5. ################################################################################
  6. @PrivArray = (
  7. [ "-//depot/lab04_n/admin/pchealth/Restore/..." , "pchealth/Restore/..." ],
  8. [ "//depot/private/pch_m1/admin/pchealth/dirs" , "pchealth/dirs" ],
  9. [ "//depot/private/pch_m1/admin/pchealth/authtools/...", "pchealth/authtools/..."],
  10. [ "//depot/private/pch_m1/admin/pchealth/Client/..." , "pchealth/Client/..." ],
  11. [ "//depot/private/pch_m1/admin/pchealth/build/..." , "pchealth/build/..." ],
  12. [ "//depot/private/pch_m1/admin/pchealth/core/..." , "pchealth/core/..." ],
  13. [ "//depot/private/pch_m1/admin/pchealth/helpctr/..." , "pchealth/helpctr/..." ],
  14. [ "//depot/private/pch_m1/admin/pchealth/pchmars/..." , "pchealth/pchmars/..." ],
  15. [ "//depot/private/pch_m1/admin/pchealth/redist/..." , "pchealth/redist/..." ],
  16. [ "//depot/private/pch_m1/admin/pchealth/setup/..." , "pchealth/setup/..." ],
  17. [ "//depot/private/pch_m1/admin/pchealth/sr/..." , "pchealth/sr/..." ],
  18. [ "//depot/private/pch_m1/admin/pchealth/SysInfo/..." , "pchealth/Sysinfo/..." ],
  19. [ "//depot/private/pch_m1/admin/pchealth/upload/..." , "pchealth/upload/..." ]
  20. );
  21. foreach $in ( @PrivArray )
  22. {
  23. $depot = $$in[0];
  24. $path = $$in[1];
  25. $PrivLookup{$depot} = $path;
  26. }
  27. ################################################################################
  28. chdir( "$ENV{SDXROOT}\\admin" );
  29. open ORIG_MAP, ">$ENV{INIT}\\pchealth.orig.mapping";
  30. open PRIV_MAP, ">$ENV{INIT}\\pchealth.priv.mapping";
  31. open CLIENT , "sd client -o 2>&1|";
  32. while(<CLIENT>)
  33. {
  34. chop;
  35. if(/^Client:\t(.*)/io)
  36. {
  37. $SDClient = $1;
  38. }
  39. unless($fView)
  40. {
  41. print ORIG_MAP "$_\n";
  42. print PRIV_MAP "$_\n";
  43. }
  44. if(/^View:/io)
  45. {
  46. last;
  47. }
  48. }
  49. while(<CLIENT>)
  50. {
  51. if(/([^\s]*)\s*\/\/\Q$SDClient\E\/([^\s]*)\s*/i)
  52. {
  53. next if($PrivLookup{$1});
  54. push @lookup, [ $1, $2 ];
  55. }
  56. }
  57. foreach $arr ( @lookup )
  58. {
  59. $depot = $arr->[0];
  60. $path = $arr->[1];
  61. print ORIG_MAP "\t$depot\t//$SDClient/$path\n";
  62. print PRIV_MAP "\t$depot\t//$SDClient/$path\n";
  63. }
  64. foreach $arr ( @PrivArray )
  65. {
  66. $depot = $arr->[0];
  67. $path = $arr->[1];
  68. print PRIV_MAP "\t$depot\t//$SDClient/$path\n";
  69. }
  70. print ORIG_MAP "\n";
  71. print PRIV_MAP "\n";
  72. close(CLIENT);
  73. close(PRIV_MAP);
  74. close(ORIG_MAP);