r8949 - /scripts/qa/qareport.cgi

dmn at users.alioth.debian.org dmn at users.alioth.debian.org
Wed Nov 7 10:02:20 UTC 2007


Author: dmn
Date: Wed Nov  7 10:02:20 2007
New Revision: 8949

URL: http://svn.debian.org/wsvn/?sc=1&rev=8949
Log:
Add bug numbers

Modified:
    scripts/qa/qareport.cgi

Modified: scripts/qa/qareport.cgi
URL: http://svn.debian.org/wsvn/scripts/qa/qareport.cgi?rev=8949&op=diff
==============================================================================
--- scripts/qa/qareport.cgi (original)
+++ scripts/qa/qareport.cgi Wed Nov  7 10:02:20 2007
@@ -15,6 +15,7 @@
 use DebianQA::Config;
 use DebianQA::DebVersions;
 use DebianQA::Svn;
+use DebianQA::BTS qw( bts_get );
 use CGI ();
 use CGI::Carp qw(fatalsToBrowser);
 use POSIX qw(locale_h);
@@ -29,6 +30,7 @@
 my $cgi = new CGI;
 
 my $data = read_cache(consolidated => "");
+my $bts = bts_get();
 my $script_date = '$Date$';
 $script_date = join( ' ', (split(/ /, $script_date))[1..3] );
 my @modified = sort(
@@ -42,6 +44,8 @@
 my @pkglist = get_pkglist();
 
 my( @for_upload, @for_upgrade, @waiting, @wip, @with_bugs );
+my %bugs_by_severity;
+
 foreach my $pkg (sort @pkglist)
 {
     next if($pkg =~ /^\//);
@@ -55,8 +59,12 @@
     my $archsuit = $data->{archive}{$pkg}{most_recent_src} || 0;
     my $uver = $data->{watch}{$pkg}{upstream_ver};
     my $m_uver = $data->{watch}{$pkg}{upstream_mangled};
-    my @bugs = @{$data->{bts}{$pkg}};
-    @bugs = map({ "#$_" } @bugs);
+    my @bugs = sort @{$data->{bts}{$pkg}};
+
+    #use Data::Dumper;
+    #die Dumper($bts->{$pkg});
+
+    push @{ $bugs_by_severity{$pkg}{$bts->{$pkg}{$_}{severity}}||=[] }, $_ foreach @bugs;
 
     my $note;
     if(! $dver) {
@@ -133,6 +141,7 @@
         waiting => \@waiting,
         wip => \@wip,
         with_bugs   => \@with_bugs,
+        bugs_by_severity    => \%bugs_by_severity,
     },
 ) || die $tt->error;
 
@@ -143,8 +152,14 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 
- [% BLOCK bts_link %]
-[% IF data.bts.$pkg.size %]<a style="float:right; margin-left: 2pt;" href="http://bugs.debian.org/$pkg">BTS</a>[% END #IF bugs %]
+[% BLOCK bts_link %]
+[% IF data.bts.$pkg.size %]<div class="bts-info"><a 
+href="http://bugs.debian.org/$pkg">bugs:</a>
+[% FOREACH s IN bugs_by_severity.$pkg %]
+[% FOREACH b IN s.value %]<a class="bts-$s.key" href="http://bugs.debian.org/$b">$b</a> [% END %]
+[% END #FOREACH %]
+</div>
+[% END #IF bugs %]
 [% END #BLOCK bts_link %]
 
 [% BLOCK package %]
@@ -201,6 +216,31 @@
             background: #404040;
             color: white;
         }
+        .bts-info {
+            float: right;
+            margin: 0 0 1pt 2pt;
+            font-size: 75%;
+            border-bottom: 1px dashed black;
+            border-left: 1px dashed black;
+        }
+        .bts-info a, .bts-info a:visited {
+            text-decoration: none;
+        }
+        .bts-wishlist {
+            color: green;
+        }
+        .bts-minor {
+            color: darkgreen;
+        }
+        .bts-normal, .bts-important {
+        }
+        .bts-grave {
+            color: red;
+        }
+        .bts-critical {
+            color: red;
+            text-decoration: blink;
+        }
     </style>
     <script type="text/javascript">
         function toggle_visibility(id)




More information about the Pkg-perl-cvs-commits mailing list