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'}; |
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 |
{ |
{ |
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; |
557 |
} |
} |
558 |
} |
} |
559 |
|
|
560 |
|
# Sanity checks. |
561 |
|
die "No email destination specified.\n" unless @mailto; |
562 |
|
|
563 |
return @files; |
return @files; |
564 |
} |
} |
565 |
|
|
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) { |
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 |
# |
# |
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 |
|
|
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 |
} |
} |
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++) { |
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, " "); |
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; |