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.

111 lines
3.8 KiB

  1. #
  2. # FileName: sdout.cmd
  3. #
  4. # Usage = whocheckedin #days branch [branch...]
  5. #
  6. # This script generates a list of everyone who submitted a change to the specified
  7. # branches.
  8. #
  9. $Usage = "
  10. USAGE: $0 #days [branch [branch...]]
  11. #days how many days the report should be for.
  12. branch branches to search. if no branches are specified, use all VBLs\n";
  13. %depot_list = (("Admin" => "admindepot.sys-ntgroup.ntdev.microsoft.com:2002"),
  14. ("Base" => "basedepot.sys-ntgroup.ntdev.microsoft.com:2003"),
  15. ("COM" => "comdepot.sys-ntgroup.ntdev.microsoft.com:2004"),
  16. ("Drivers" => "driversdepot.sys-ntgroup.ntdev.microsoft.com:2005"),
  17. ("DS" => "dsdepot.sys-ntgroup.ntdev.microsoft.com:2006"),
  18. ("EndUser" => "enduserdepot.sys-ntgroup.ntdev.microsoft.com:2007"),
  19. ("InetCore" => "inetcoredepot.sys-ntgroup.ntdev.microsoft.com:2008"),
  20. ("InetSrv" => "inetsrvdepot.sys-ntgroup.ntdev.microsoft.com:2009"),
  21. ("MultiMedia" => "multimediadepot.sys-ntgroup.ntdev.microsoft.com:2010"),
  22. ("Net" => "netdepot.sys-ntgroup.ntdev.microsoft.com:2011"),
  23. ("PrintScan" => "printscandepot.sys-ntgroup.ntdev.microsoft.com:2012"),
  24. ("Root" => "rootdepot.sys-ntgroup.ntdev.microsoft.com:2001"),
  25. ("SdkTools" => "sdktoolsdepot.sys-ntgroup.ntdev.microsoft.com:2013"),
  26. ("Shell" => "shelldepot.sys-ntgroup.ntdev.microsoft.com:2014"),
  27. ("TermSrv" => "termsrvdepot.sys-ntgroup.ntdev.microsoft.com:2015"),
  28. ("Windows" => "windowsdepot.sys-ntgroup.ntdev.microsoft.com:2016"));
  29. $num_days = 0;
  30. %developers = ();
  31. @depot_list = ("Admin",
  32. "Base",
  33. "COM",
  34. "Drivers",
  35. "DS",
  36. "EndUser",
  37. "InetCore",
  38. "InetSrv",
  39. "MultiMedia",
  40. "Net",
  41. "PrintScan",
  42. "Root",
  43. "SdkTools",
  44. "Shell",
  45. "TermSrv",
  46. "Windows");
  47. @allvbls = ("Lab01_N",
  48. "Lab02_N",
  49. "Lab03_N",
  50. "Lab04_N",
  51. "Lab06_N",
  52. "Lab07_N");
  53. @vbl_list = ();
  54. @checkin_count = (); # indexed by VBL
  55. if (@ARGV) {
  56. $num_days = shift;
  57. if ($num_days == 0) {
  58. die $Usage;
  59. }
  60. # print "Analyzing checkins for the last $num_days days.\n";
  61. if (@ARGV) {
  62. for (@ARGV) {
  63. push (vbl_list,$_)
  64. }
  65. } else {
  66. @vbl_list = @allvbls
  67. }
  68. for $vbl (@vbl_list) {
  69. # print("Searching VBL $vbl\n");
  70. for $depot (@depot_list) {
  71. # print(" //depot/$vbl/$depot/...\n");
  72. foreach $line (`sd -p $depot_list{$depot} changes //depot/$vbl/$depot/...@-$num_days,`) {
  73. chomp $line;
  74. # note we can't use /w to find the account name, because of v-alias and a-alias
  75. $line =~ m/^Change .*? by (\w+)\\([-a-zA-Z_0-9]+)/;
  76. $domain = $1;
  77. $account = lc($2);
  78. $developers{$account} += 1;
  79. $checkin_count{$vbl} = $checkin_count{$vbl}+1;
  80. }
  81. }
  82. }
  83. #
  84. # print out list of developers
  85. #
  86. # @keys = sort (keys %developers);
  87. foreach $key (sort {$developers{$b} <=> $developers{$a}} keys %developers) {
  88. print "$key ($developers{$key})\n";
  89. }
  90. #
  91. # print out changes per VBL
  92. #
  93. for $vbl (@vbl_list) {
  94. printf("VBL $vbl had $checkin_count{$vbl} changes submitted\n");
  95. }
  96. } else {
  97. die $Usage;
  98. }