SVN: toys/stbr/queue_parser.pl

sparky sparky at pld-linux.org
Sat Oct 31 17:20:18 CET 2009


Author: sparky
Date: Sat Oct 31 17:20:17 2009
New Revision: 10914

Modified:
   toys/stbr/queue_parser.pl
Log:
- inform about test builds


Modified: toys/stbr/queue_parser.pl
==============================================================================
--- toys/stbr/queue_parser.pl	(original)
+++ toys/stbr/queue_parser.pl	Sat Oct 31 17:20:17 2009
@@ -104,13 +104,24 @@
 
 my $now = time;
 
+my $color_e = color();
+my $color_b = color( "bold" );
+my $color_c = color( "cyan" );
 my $printed_something = 0;
 my $done_so_far = 1;
 my @group = $xml =~ m{(<group.*?</group>)}gs;
 GROUP: foreach my $grp ( @group ) {
 	my ($time) = $grp =~ m{<time>(\d+)</time>};
 	next if $time <= $data->{last_time};
+
+	my $pre = "$color_b$line";
+	if ( $grp =~ m{<group.*?flags="test-build">} ) {
+		$pre .= " $color_e(test)$color_b";
+	}
+	$pre .= ":$color_e ";
+
 	my ($requester) = $grp =~ m{<requester email='.*?'>(.*?)</requester>};
+	$pre .= color( "green" ) . "$requester$color_e * ";
 
 	my @pkg = $grp =~ m{(<batch.*?</batch>)}gs;
 	foreach my $p ( @pkg ) {
@@ -121,19 +132,17 @@
 			next;
 		}
 
-		my $e = color();
-		my $c = color( "cyan" );
 		my ($rpm) = $p =~ m{<src-rpm>(.*?)</src-rpm>};
 		if ( $rpm ) {
 			$rpm =~ s/\.src\.rpm$//;
-			$rpm = $c . $1 . $e . $2 if $rpm =~ /^(.*)(-.*?-.*?)$/;
+			$rpm = $color_c . $1 . $color_e . $2 if $rpm =~ /^(.*)(-.*?-.*?)$/;
 		} else {
 			$p =~ m{<command flags="(.*?)">(.*?)</command>};
-			$rpm = $1 ? "$c$2$e ($1)" : $2;
+			$rpm = $1 ? "$color_c$2$color_e ($1)" : $2;
 		}
 		if ( $p =~ m{<branch>(.+?)</branch>} ) {
 			my $branch = $1;
-			$rpm .= " (" . color( "yellow" ) . "$branch$e)" if $branch ne "HEAD";
+			$rpm .= " (" . color( "yellow" ) . "$branch$color_e)" if $branch ne "HEAD";
 		}
 
 		my $all_done = 1;
@@ -143,7 +152,7 @@
 		foreach my $b ( @builders ) {
 			my ( $status, $builder ) = $b =~ m{status='(.*?)'.*?>(.*?)</builder>};
 			my $color = $status_to_color{ $status } || "red";
-			push @status, "$builder: " . color($color) . "$status$e";
+			push @status, "$builder: " . color($color) . "$status$color_e";
 			if ( $status eq "?" ) {
 				$all_done = 0;
 			} else {
@@ -165,14 +174,12 @@
 
 		if ( defined $print ) {
 			$printed{$id} = $print;
-			my $b = color( "bold" );
 
-			print "$b$line:$e "
-				. color( "green" ) . "$requester$e * "
-				. "$rpm$b:$e "
+			print $pre
+				. "$rpm$color_b:$color_e "
 				. ( join ", ", @status )
 				. "\n";
-			last GROUP if ++$printed_something > 4;
+			last GROUP if not $term and ++$printed_something > 4;
 		}
 	}
 	$data->{last_time} = $time if $done_so_far;


More information about the pld-cvs-commit mailing list