Author: sparky
Date: Sat Oct 31 00:11:09 2009
New Revision: 10902

Modified:
   toys/stbr/queue_parser.pl
Log:
- command flagh in colour
- really limit to 5 lines


Modified: toys/stbr/queue_parser.pl
==============================================================================
--- toys/stbr/queue_parser.pl   (original)
+++ toys/stbr/queue_parser.pl   Sat Oct 31 00:11:09 2009
@@ -105,7 +105,7 @@
 my $printed_something = 0;
 my $done_so_far = 1;
 my @group = $xml =~ m{(<group.*?</group>)}gs;
-foreach my $grp ( @group ) {
+GROUP: foreach my $grp ( @group ) {
        my ($time) = $grp =~ m{<time>(\d+)</time>};
        next if $time <= $data->{last_time};
 
@@ -119,16 +119,16 @@
                }
 
                my $e = color();
+               my $c = color( "yellow" );
                my ($rpm) = $p =~ m{<src-rpm>(.*?)</src-rpm>};
                if ( $rpm ) {
                        $rpm =~ s/\.src\.rpm$//;
                } else {
                        $p =~ m{<command flags="(.*?)">(.*?)</command>};
-                       $rpm = $1 ? "($1) $2" : $2;
+                       $rpm = $1 ? "$2 ($c$1$e)" : $2;
                }
                if ( $p =~ m{<branch>(.+?)</branch>} ) {
                        my $branch = $1;
-                       my $c = color( "yellow" );
                        $rpm .= " ($c$branch$e)";
                }
 
@@ -161,13 +161,12 @@
 
                if ( defined $print ) {
                        $printed{$id} = $print;
-                       $printed_something++;
                        my $b = color( "bold" );
-                       print color( "yellow" ) ."$line$e: $rpm$b:$e " . ( join 
", ", @status ) . "\n";
+                       print color( "yellow" ) ."$b$line$e: $rpm$b:$e " . ( 
join ", ", @status ) . "\n";
+                       last GROUP if ++$printed_something > 4;
                }
        }
        $data->{last_time} = $time if $done_so_far;
-       last if $printed_something > 4;
 }
 
 $data->{printed} = \%printed;
_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to