SVN: toys/fun/queue_notify.pl

sparky sparky at pld-linux.org
Sat Apr 24 17:39:20 CEST 2010


Author: sparky
Date: Sat Apr 24 17:39:19 2010
New Revision: 11343

Modified:
   toys/fun/queue_notify.pl
Log:
- ok and fail icons


Modified: toys/fun/queue_notify.pl
==============================================================================
--- toys/fun/queue_notify.pl	(original)
+++ toys/fun/queue_notify.pl	Sat Apr 24 17:39:19 2010
@@ -120,6 +120,8 @@
 					if $branch ne "HEAD";
 			}
 	
+			my $all_ok = 1;
+			my $some_fail = 0;
 			my $all_done = 1;
 			my $some_done = 0;
 			my @status;
@@ -130,8 +132,11 @@
 				push @status, "$builder: <span color='$color'>$status</span>";
 				if ( $status eq "?" ) {
 					$all_done = 0;
+					$all_ok = 0;
 				} else {
 					$some_done++;
+					$all_ok = 0 unless $status eq "OK";
+					$some_fail = 1 if $status =~ /^FAIL/;
 				}
 			}
 	
@@ -148,7 +153,10 @@
 				next if $ftime and $ftime == $some_done;
 			}
 	
-			system "notify-send", "-t", "8000", $pre, 
+			my @icon;
+			@icon = ( "--icon=ok" ) if $all_ok;
+			@icon = ( "--icon=cancel" ) if $some_fail;
+			system "notify-send", @icon, "-t", "8000", $pre, 
 				"<span color='green'>" . $requester . "</span> *\n" .
 				"$rpm<b>:</b>\n - " . ( join "\n - ", @status );
 		}


More information about the pld-cvs-commit mailing list