r13951 - in /scripts/qa: DebianQA/Classification.pm DebianQA/Config.pm debianqa.conf-sample qareport.cgi templates/by_category

tincho-guest at users.alioth.debian.org tincho-guest at users.alioth.debian.org
Fri Feb 1 10:15:44 UTC 2008


Author: tincho-guest
Date: Fri Feb  1 10:15:44 2008
New Revision: 13951

URL: http://svn.debian.org/wsvn/?sc=1&rev=13951
Log:
Move group_email to common, and the logic of verifying group maintenance to
Classification.

Modified:
    scripts/qa/DebianQA/Classification.pm
    scripts/qa/DebianQA/Config.pm
    scripts/qa/debianqa.conf-sample
    scripts/qa/qareport.cgi
    scripts/qa/templates/by_category

Modified: scripts/qa/DebianQA/Classification.pm
URL: http://svn.debian.org/wsvn/scripts/qa/DebianQA/Classification.pm?rev=13951&op=diff
==============================================================================
--- scripts/qa/DebianQA/Classification.pm (original)
+++ scripts/qa/DebianQA/Classification.pm Fri Feb  1 10:15:44 2008
@@ -19,7 +19,7 @@
 
 use DebianQA::Cache;
 #use DebianQA::Common;
-#use DebianQA::Config '%CFG';
+use DebianQA::Config '%CFG';
 use DebianQA::DebVersions;
 
 # Takes a list of packages to process.
@@ -49,13 +49,19 @@
     archive_waiting => "archive",
     needs_upload => "archive",
     never_uploaded => "archive",
+    archive_foreign => "archive",
     has_bugs => "bts",
     not_finished => "svn",
     repo_ancient => "svn",
+    svn_foreign => "svn",
     needs_upgrade => "upstream",
     upstream_ancient => "upstream",
     watch_error => "upstream",
 #    native => "",
+);
+my %warn_hilight = (
+    archive_nonmaint => "archive",
+    svn_nonmaint => "svn",
 );
 
 sub classify(@) {
@@ -116,13 +122,34 @@
         if($data->{bts}{$pkg} and %{$data->{bts}{$pkg}}) {
             $status{has_bugs} = 1;
         }
-        my %hilight;
+        if($CFG{common}{group_email}
+                and $data->{archive}{$pkg}{control}{maintainer}
+                and $data->{archive}{$pkg}{control}{uploaders}) {
+            $status{archive_foreign} = 1 unless(
+                grep({ /<\Q$CFG{common}{group_email}\E>/ } (
+                        @{$data->{archive}{$pkg}{control}{maintainer}},
+                        @{$data->{archive}{$pkg}{control}{uploaders}}
+                    )));
+        }
+        if($CFG{common}{group_email}
+                and $data->{svn}{$pkg}{maintainer}
+                and $data->{svn}{$pkg}{uploaders}) {
+            $status{svn_foreign} = 1 unless(
+                grep({ /<\Q$CFG{common}{group_email}\E>/ } (
+                        @{$data->{svn}{$pkg}{maintainer}},
+                        @{$data->{svn}{$pkg}{uploaders}}
+                    )));
+        }
+        my(%hilight, %warning);
         foreach(keys %status) {
             die "Internal error: $_ is not a valid status" unless(
-                $error_hilight{$_});
-            $hilight{$error_hilight{$_}}{$_} = 1;
+                $error_hilight{$_} or $warn_hilight{$_});
+            $hilight{$error_hilight{$_}}{$_} = 1 if($error_hilight{$_});
+            $warning{$warn_hilight{$_}}{$_} = 1 if($warn_hilight{$_});
         }
         $res{$pkg} = {
+            name    => $pkg,
+            #
             watch   => $data->{watch}{$pkg},
             archive => $data->{archive}{$pkg},
             svn     => $data->{svn}{$pkg},
@@ -133,7 +160,8 @@
             #
             status  => \%status,
             notes   => \@notes,
-            hilight => \%hilight
+            hilight => \%hilight,
+            warning => \%warning
         };
     }
     return \%res;

Modified: scripts/qa/DebianQA/Config.pm
URL: http://svn.debian.org/wsvn/scripts/qa/DebianQA/Config.pm?rev=13951&op=diff
==============================================================================
--- scripts/qa/DebianQA/Config.pm (original)
+++ scripts/qa/DebianQA/Config.pm Fri Feb  1 10:15:44 2008
@@ -23,7 +23,6 @@
         templates_path => "templates",
         default_template => "by_category",
         group_name => "Unnamed Packaging Group",
-        group_email => undef,
         group_url => "http://www.debian.org/",
         wsvn_url => undef,
     },
@@ -61,7 +60,8 @@
         # Should be 1 by default, 0 for quiet mode
         verbose => 1,
         # Prepend syslog-style format?
-        formatted_log => 1
+        formatted_log => 1,
+        group_email => undef,
     }
 );
 our %CFG = %defaults; # Global configuration

Modified: scripts/qa/debianqa.conf-sample
URL: http://svn.debian.org/wsvn/scripts/qa/debianqa.conf-sample?rev=13951&op=diff
==============================================================================
--- scripts/qa/debianqa.conf-sample (original)
+++ scripts/qa/debianqa.conf-sample Fri Feb  1 10:15:44 2008
@@ -9,9 +9,6 @@
 default_template = by_category
 group_name = Debian Foo Group
 group_url = http://pkg-foo.alioth.debian.org/
-; if present, will be used to check that packages are in fact maintained by the
-; group
-group_email = pkg-foo-maintainers at lists.debian.org
 ; sprintf format for the package wsvn location, takes one parameter, the
 ; package directory.
 ;wsvn_url = http://svn.debian.org/wsvn/pkg-perl/trunk/%s
@@ -54,3 +51,6 @@
 verbose = 1
 ; Prepend syslog-style format?
 formatted_log => 1
+; if present, will be used to check that packages are in fact maintained by the
+; group
+group_email = pkg-foo-maintainers at lists.debian.org

Modified: scripts/qa/qareport.cgi
URL: http://svn.debian.org/wsvn/scripts/qa/qareport.cgi?rev=13951&op=diff
==============================================================================
--- scripts/qa/qareport.cgi (original)
+++ scripts/qa/qareport.cgi Fri Feb  1 10:15:44 2008
@@ -57,13 +57,6 @@
     my $data = $cls->{$pkg};
 
     my $dest;   # like "destiny" :)
-    my %info = (
-        name => $pkg,
-        map(
-            ($_=>$data->{$_}),
-            qw( watch archive svn bts notes hilight ),
-        ),
-    );
     my $status = $data->{status};   # to save some typing
 
     $dest ||= \@for_upgrade if $status->{needs_upgrade};
@@ -74,10 +67,12 @@
     $dest ||= \@wip if $status->{watch_error};
     $dest ||= \@waiting if $status->{archive_waiting};
     $dest ||= \@with_bugs if $status->{has_bugs};
+    $dest ||= \@wip if $status->{archive_foreign};
+    # $dest ||= \@wip if $status->{svn_foreign};
     $dest ||= \@no_prob;
 
-    push @$dest, \%info;
-    push @all, \%info;
+    push @$dest, $data;
+    push @all, $data;
 }
 
 if( $ENV{GATEWAY_INTERFACE} )
@@ -127,9 +122,9 @@
     $template,
     {
         data        => $cls,
+        group_email => $CFG{common}{group_email},
         group_name  => $CFG{qareport_cgi}{group_name},
         group_url   => $CFG{qareport_cgi}{group_url},
-        group_email => $CFG{qareport_cgi}{group_email},
         wsvn_url    => $CFG{qareport_cgi}{wsvn_url},
         (
             ( ($cgi->param('format')||'') eq 'list' )

Modified: scripts/qa/templates/by_category
URL: http://svn.debian.org/wsvn/scripts/qa/templates/by_category?rev=13951&op=diff
==============================================================================
--- scripts/qa/templates/by_category (original)
+++ scripts/qa/templates/by_category Fri Feb  1 10:15:44 2008
@@ -15,7 +15,7 @@
     myemail = matches.1 | uri;
 %]<a href="mailto:$myemail">$myname</a>[% END %]
 
-[% BLOCK show_maint %]
+[% MACRO show_maint(data) BLOCK %]
 [%
     mymaint = [];
     FOREACH m IN data.maintainer;
@@ -34,40 +34,34 @@
 [% END #IF %]
 [% END #BLOCK %]
 
-[% BLOCK check_maint %]
-[% IF group_email.length AND data.maintainer
-   AND data.uploaders %]
-[% IF ! data.maintainer.grep(quote("<$group_email>")).size %]
-[% IF ! data.uploaders.grep(quote("<$group_email>")).size %]
+[% MACRO check_maint(pkg, s) BLOCK %]
+[% ngkey = "${s}_foreign" %]
+[% nmkey = "${s}_nonmaint" %]
+[% IF pkg.status.$ngkey OR pkg.status.$nmkey %]
 <span class="popup">
-    <span class="non-group">[NG]</span>
+    <span class="non-group">
+        [% IF pkg.status.$ngkey %][NG][% ELSE %][NM][% END %]
+    </span>
     <span class="balloon">
         <div style="margin-bottom: 1em;">
+            [% IF pkg.status.$ngkey %]
             The group is not maintainer nor uploader of this
             package
+            [% ELSE %]
+            The group is not maintainer (but uploader) of this
+            package
+            [% END %]
         </div>
-        [% PROCESS show_maint data = data %]
+        [% show_maint(pkg.$s) %]
     </span>
 </span>
-[% ELSE #maint %]
-<span class="popup">
-    <span class="non-maint">[NM]</span>
-    <span class="balloon">
-        <div style="margin-bottom: 1em;">
-            The group is not maintainer (but uploader) of this
-            package
-        </div>
-        [% PROCESS show_maint data = data %]
-    </span>
-</span>
-[% END #maint %]
-[% END #upldr %]
-[% END #email %]
+[% END #IF %]
 [% END #BLOCK %]
 
 [% BLOCK bts_link %]
 [% IF pkg.bts.size %]
-<div class="bts-info"><div class=" popup"><a href="http://bugs.debian.org/$pkg.name"
+<div class="bts-info"><div class="popup"><a
+href="http://bugs.debian.org/$pkg.name"
 >$pkg.bts.keys.size</a>
 <!-- span class="paren">[</span -->
 <table class="bts-info-details balloon">
@@ -119,7 +113,7 @@
             [% IF pkg.svn.section AND pkg.svn.section != "main" %]
             <span class="section-$pkg.svn.section">[$pkg.svn.section]</span>
             [% END #IF %]
-            [% PROCESS check_maint data = pkg.svn %]
+            [% check_maint(pkg, "svn") %]
             [% IF ! hide_binaries
                 AND pkg.svn.binaries AND pkg.svn.binaries.size
                 AND (
@@ -162,11 +156,11 @@
             [% IF pkg.archive.control.dm_allowed %]
             <span class="popup"><span class="dm-enabled">[DMUA]</span>
                 <span class="balloon">
-                    [% PROCESS show_maint data = pkg.archive.control %]
+                    [% show_maint(pkg.archive.control) %]
                 </span>
             </span>
             [% END #IF %]
-            [% PROCESS check_maint data = pkg.archive.control %]
+            [% check_maint(pkg, "archive") %]
         </td>
 
         <td>[% INCLUDE bts_link pkg=pkg %]</td>




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