/[cvs]/ccvs/contrib/log_accum.in
ViewVC logotype

Diff of /ccvs/contrib/log_accum.in

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.12 by dprice, Thu Oct 6 16:38:51 2005 UTC revision 1.13 by dprice, Thu Oct 6 17:03:42 2005 UTC
# Line 123  $ADDED_FILE    = "$TMPDIR/${FILE_PREFIX} Line 123  $ADDED_FILE    = "$TMPDIR/${FILE_PREFIX}
123  $REMOVED_FILE  = "$TMPDIR/${FILE_PREFIX}files.removed";  $REMOVED_FILE  = "$TMPDIR/${FILE_PREFIX}files.removed";
124  $LOG_FILE      = "$TMPDIR/${FILE_PREFIX}files.log";  $LOG_FILE      = "$TMPDIR/${FILE_PREFIX}files.log";
125  $BRANCH_FILE   = "$TMPDIR/${FILE_PREFIX}files.branch";  $BRANCH_FILE   = "$TMPDIR/${FILE_PREFIX}files.branch";
 $MLIST_FILE    = "$TMPDIR/${FILE_PREFIX}files.mlist";  
126  $SUMMARY_FILE  = "$TMPDIR/${FILE_PREFIX}files.summary";  $SUMMARY_FILE  = "$TMPDIR/${FILE_PREFIX}files.summary";
127    
128  $CVSROOT       = $ENV{'CVSROOT'};  $CVSROOT       = $ENV{'CVSROOT'};
# Line 401  sub build_header { Line 400  sub build_header {
400  #                       $hour, $min, $sec);  #                       $hour, $min, $sec);
401  }  }
402    
 # !!! Destination Mailing-list and history file mappings here !!!  
   
 #sub mlist_map  
 #{  
 #    local($path) = @_;  
 #    my $domain = "nongnu.org";  
 #      
 #    if ($path =~ /^([^\/]+)/) {  
 #        return "cvs\@$1.$domain";  
 #    } else {  
 #        return "cvs\@$domain";  
 #    }  
 #}      
403    
404  sub derive_subject_from_changes_file ()  sub derive_subject_from_changes_file ()
405  {  {
# Line 551  sub process_argv Line 537  sub process_argv
537          $arg = shift @argv;          $arg = shift @argv;
538          if ($arg eq '-u' && !defined($cvs_user)) {          if ($arg eq '-u' && !defined($cvs_user)) {
539              $cvs_user = shift @argv;              $cvs_user = shift @argv;
540            } elsif ($arg eq '-m') {
541                push @mailto, split (/[ ,]+/, shift @argv);
542          } elsif ($arg eq '-r') {          } elsif ($arg eq '-r') {
543              $have_r_opt = 1;              $have_r_opt = 1;
544              $onlytag = shift @argv;              $onlytag = shift @argv;
# Line 569  sub process_argv Line 557  sub process_argv
557          }          }
558      }      }
559    
560        # Sanity checks.
561        die "No email destination specified.\n" unless @mailto;
562    
563      return @files;      return @files;
564  }  }
565    
# Line 598  $have_r_opt = 0;               # Whether -r was seen Line 589  $have_r_opt = 0;               # Whether -r was seen
589  $onlytag = "";                  # With $have_r_opt, only send mail for changes  $onlytag = "";                  # With $have_r_opt, only send mail for changes
590                                  # on this branch.                                  # on this branch.
591  $branch = "";                   # The branch being processed.  $branch = "";                   # The branch being processed.
592    @mailto = ();                   # Email addresses to send mail to.
593  @files = process_argv(@ARGV);  @files = process_argv(@ARGV);
594  @path = split('/', $files[0]);  @path = split('/', $files[0]);
595  if ($#path == 0) {  if ($#path == 0) {
# Line 612  if ($#path == 0) { Line 604  if ($#path == 0) {
604  #print("dir   - ", $dir, "\n");  #print("dir   - ", $dir, "\n");
605  #print("id    - ", $id, "\n");  #print("id    - ", $id, "\n");
606    
 #  
 # Map the repository directory to an email address for commitlogs to be sent  
 # to.  
 #  
 #$mlist = &mlist_map($files[0]);  
607    
608  ##########################  ##########################
609  #  #
# Line 629  if ($new_directory) { Line 616  if ($new_directory) {
616      push(@text, $header);      push(@text, $header);
617      push(@text, "");      push(@text, "");
618      push(@text, "  ".$files[0]." - New directory");      push(@text, "  ".$files[0]." - New directory");
619      &mail_notification([ $mlist ], @text);      &mail_notification ([@mailto], @text);
620      exit 0;      exit 0;
621  }  }
622    
# Line 712  for ($i = 0; ; $i++) { Line 699  for ($i = 0; ; $i++) {
699  &append_to_file("$ADDED_FILE.$i.$id.$cvs_user",   $dir, @added_files);  &append_to_file("$ADDED_FILE.$i.$id.$cvs_user",   $dir, @added_files);
700  &append_to_file("$CHANGED_FILE.$i.$id.$cvs_user", $dir, @changed_files);  &append_to_file("$CHANGED_FILE.$i.$id.$cvs_user", $dir, @changed_files);
701  &append_to_file("$REMOVED_FILE.$i.$id.$cvs_user", $dir, @removed_files);  &append_to_file("$REMOVED_FILE.$i.$id.$cvs_user", $dir, @removed_files);
 &append_line("$MLIST_FILE.$i.$id.$cvs_user", $mlist);  
702  if ($rcsidinfo) {  if ($rcsidinfo) {
703      &change_summary("$SUMMARY_FILE.$i.$id.$cvs_user", (@changed_files, @added_files));      &change_summary("$SUMMARY_FILE.$i.$id.$cvs_user", (@changed_files, @added_files));
704  }  }
# Line 741  $header = &build_header; Line 727  $header = &build_header;
727  # Produce the final compilation of the log messages  # Produce the final compilation of the log messages
728  #  #
729  @text = ();  @text = ();
 @mlist_list = ();  
730  push(@text, $header);  push(@text, $header);
731  push(@text, "");  push(@text, "");
732  for ($i = 0; ; $i++) {  for ($i = 0; ; $i++) {
# Line 752  for ($i = 0; ; $i++) { Line 737  for ($i = 0; ; $i++) {
737      push(@text, &read_file("$REMOVED_FILE.$i.$id.$cvs_user", "Removed:"));      push(@text, &read_file("$REMOVED_FILE.$i.$id.$cvs_user", "Removed:"));
738      push(@text, "  Log:");      push(@text, "  Log:");
739      push(@text, &read_logfile("$LOG_FILE.$i.$id.$cvs_user", "  "));      push(@text, &read_logfile("$LOG_FILE.$i.$id.$cvs_user", "  "));
     push(@mlist_list, &read_file_lines("$MLIST_FILE.$i.$id.$cvs_user"));  
740      if ($rcsidinfo == 2) {      if ($rcsidinfo == 2) {
741          if (-e "$SUMMARY_FILE.$i.$id.$cvs_user") {          if (-e "$SUMMARY_FILE.$i.$id.$cvs_user") {
742              push(@text, "  ");              push(@text, "  ");
# Line 782  if ($rcsidinfo == 1) { Line 766  if ($rcsidinfo == 1) {
766      }      }
767  }  }
768    
 %mlist_hash = ();  
769    
 foreach (@mlist_list) { $mlist_hash{ $_ } = 1; }  
770    
771  #  #
772  # Mail out the notification.  # Mail out the notification.
773  #  #
774  if (! $have_r_opt || $onlytag eq $branch) {  if (!$have_r_opt || $onlytag eq $branch) {
775      &mail_notification([ keys(%mlist_hash) ], @text);      &mail_notification ([@mailto], @text);
776  }  }
777  &cleanup_tmpfiles;  &cleanup_tmpfiles;
778  exit 0;  exit 0;

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.13

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26