SVN: toys/stbr/queue_parser.pl
sparky
sparky at pld-linux.org
Sat Oct 31 02:34:12 CET 2009
Author: sparky
Date: Sat Oct 31 02:34:12 2009
New Revision: 10903
Modified:
toys/stbr/queue_parser.pl
Log:
- include requester
- don't print HEAD branch
- more colours !
Modified: toys/stbr/queue_parser.pl
==============================================================================
--- toys/stbr/queue_parser.pl (original)
+++ toys/stbr/queue_parser.pl Sat Oct 31 02:34:12 2009
@@ -50,6 +50,7 @@
yellow => 7,
blue => 2,
magenta => 6,
+ cyan => 10,
"" => 0,
);
sub color_irc
@@ -65,6 +66,7 @@
yellow => 33,
blue => 34,
magenta => 35,
+ cyan => 36,
bold => 1,
"" => 0,
);
@@ -108,6 +110,7 @@
GROUP: foreach my $grp ( @group ) {
my ($time) = $grp =~ m{<time>(\d+)</time>};
next if $time <= $data->{last_time};
+ my ($requester) = $grp =~ m{<requester email='.*?'>(.*?)</requester>};
my @pkg = $grp =~ m{(<batch.*?</batch>)}gs;
foreach my $p ( @pkg ) {
@@ -119,17 +122,18 @@
}
my $e = color();
- my $c = color( "yellow" );
+ 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 =~ /^(.*)(-.*?-.*?)$/;
} else {
$p =~ m{<command flags="(.*?)">(.*?)</command>};
- $rpm = $1 ? "$2 ($c$1$e)" : $2;
+ $rpm = $1 ? "$c$2$e ($1)" : $2;
}
if ( $p =~ m{<branch>(.+?)</branch>} ) {
my $branch = $1;
- $rpm .= " ($c$branch$e)";
+ $rpm .= " (" . color( "yellow" ) . "$branch$e)" if $branch ne "HEAD";
}
my $all_done = 1;
@@ -162,7 +166,12 @@
if ( defined $print ) {
$printed{$id} = $print;
my $b = color( "bold" );
- print color( "yellow" ) ."$b$line$e: $rpm$b:$e " . ( join ", ", @status ) . "\n";
+
+ print color( "yellow" ) . "$b$line$e: "
+ . color( "green" ) . "$requester$e * "
+ . "$rpm$b:$e "
+ . ( join ", ", @status )
+ . "\n";
last GROUP if ++$printed_something > 4;
}
}
More information about the pld-cvs-commit
mailing list