cvs-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Cvs-cvs] ccvs/contrib ChangeLog log_accum.pl


From: Derek Robert Price
Subject: [Cvs-cvs] ccvs/contrib ChangeLog log_accum.pl
Date: Mon, 05 Jun 2006 14:58:44 +0000

CVSROOT:        /cvsroot/cvs
Module name:    ccvs
Changes by:     Derek Robert Price <dprice>     06/06/05 14:58:44

Modified files:
        contrib        : ChangeLog log_accum.pl 

Log message:
        * log_accum.pl: Print warm fuzzies.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/ccvs/contrib/ChangeLog?cvsroot=cvs&r1=1.203&r2=1.204
http://cvs.savannah.gnu.org/viewcvs/ccvs/contrib/log_accum.pl?cvsroot=cvs&r1=1.39&r2=1.40

Patches:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/cvs/ccvs/contrib/ChangeLog,v
retrieving revision 1.203
retrieving revision 1.204
diff -u -b -r1.203 -r1.204
--- ChangeLog   5 Jun 2006 13:16:13 -0000       1.203
+++ ChangeLog   5 Jun 2006 14:58:44 -0000       1.204
@@ -1,6 +1,6 @@
 2006-06-05  Derek Price  <address@hidden>
 
-       * log_accum.pl: Restore #! @PERL@ -T line.
+       * log_accum.pl: Restore #! @PERL@ -T line.  Print warm fuzzies.
 
 2006-05-23  Derek Price  <address@hidden>
 

Index: log_accum.pl
===================================================================
RCS file: /cvsroot/cvs/ccvs/contrib/log_accum.pl,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -b -r1.39 -r1.40
--- log_accum.pl        5 Jun 2006 13:16:14 -0000       1.39
+++ log_accum.pl        5 Jun 2006 14:58:44 -0000       1.40
@@ -657,7 +657,7 @@
 
 
 
-sub mail_notification
+sub send_mail
 {
     my ($addr_list, $module, $username, $fullname, $mailfrom,
        $subject, @text) = @_;
@@ -688,7 +688,21 @@
     print MAIL "\n";
     print MAIL join "\n", @text;
 
-    close MAIL or warn "child exited $?";
+    my $status = close MAIL;
+    warn "child exited $?" unless $status;
+    return $status;
+}
+
+
+
+# Wrapper for send_mail that prints a warm fuzzy message.
+sub mail_notification
+{
+    print "Mailing notification to "
+         . join (", ", @{$_[0]})
+         . "... ";
+    print "sent.\n" if send_mail @_;
+    # else "warn" should have printed a message.
 }
 
 
@@ -697,6 +711,8 @@
 {
     my ($mail_to, $module, $branch, $username, $fullname, $mailname,
        $header, @diffs) = @_;
+    my $count = 0;
+    my $errors;
 
     # Sample diff:
 # Index: subdir/subfile3
@@ -711,6 +727,10 @@
 # -original line
 # +new line
       
+    print "Mailing diffs to "
+         . join (", ", @$mail_to)
+         . "... ";
+
     while (@diffs)
     {
        my ($subject, @onediff);
@@ -733,9 +753,16 @@
        } while @diffs and $diffs[0] !~ /^Index: /;
 
        # Send the curent diff.
-       mail_notification $mail_to, $module, $username, $fullname,
+       $count++;
+       $errors++ unless
+           send_mail $mail_to, $module, $username, $fullname,
                          $mailname, $subject, @$header, @onediff;
     }
+
+    print "$count sent"
+         . ($errors ? (" ($errors error" . ($errors == 1 ? "" : "s") . ")")
+                    : "")
+         . ".\n";
 }
 
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]