r9580 - /scripts/qa/DebianQA/Classification.pm

tincho-guest at users.alioth.debian.org tincho-guest at users.alioth.debian.org
Mon Nov 19 04:27:51 UTC 2007


Author: tincho-guest
Date: Mon Nov 19 04:27:51 2007
New Revision: 9580

URL: http://svn.debian.org/wsvn/?sc=1&rev=9580
Log:
More interesting data

Modified:
    scripts/qa/DebianQA/Classification.pm

Modified: scripts/qa/DebianQA/Classification.pm
URL: http://svn.debian.org/wsvn/scripts/qa/DebianQA/Classification.pm?rev=9580&op=diff
==============================================================================
--- scripts/qa/DebianQA/Classification.pm (original)
+++ scripts/qa/DebianQA/Classification.pm Mon Nov 19 04:27:51 2007
@@ -20,7 +20,7 @@
 use DebianQA::Cache;
 #use DebianQA::Common;
 #use DebianQA::Config '%CFG';
-#use DebianQA::DebVersions;
+use DebianQA::DebVersions;
 
 # Takes a list of packages to process.
 # Returns an unique hash ready to use in reporting, keyed by package name.
@@ -31,12 +31,11 @@
 #       invalid_svn_version => 1,
 #       ...
 #   },
-#   problem => {                # Hash, ditto (%todo)
-#       repo => 1,
-#       archive => 1,
-#       upstream => 1,
-#       bugs => 1
-#   },
+#   notes => [ ... ],
+#   svnpath => "...",
+#   upstream_url => "...",
+#   bugs => [ ... ],            # Already extracted data for ease of use
+#
 #   bts => {},
 #   archive => {},
 #   svn => {},
@@ -49,25 +48,22 @@
 
     foreach my $pkg (@pkglist) {
         next if($pkg =~ /^\//);
-        my(%problem, %status);
+        my(%status, @notes);
         # SVN versus archive
         my $archive_ver = $data->{archive}{$pkg}{most_recent};
         my $svn_ver = $data->{svn}{$pkg}{version};
         if(not $svn_ver or not $archive_ver) {
             if(not $svn_ver) {
                 $status{not_finished} = 1;
-                $problem{repo} = "Not finished";
             }
             if(not $archive_ver) {
                 $status{never_uploaded} = 1;
-                $problem{archive} = "Never uploaded";
             }
         } elsif(deb_compare($archive_ver, $svn_ver) > 0) {
             $status{repo_ancient} = 1;
-            $problem{repo} = "Ancient version in repository";
+            push @notes, "$archive_ver > $svn_ver";
         } elsif(deb_compare($archive_ver, $svn_ver) != 0) {
             $status{needs_upload} = 1;
-            $problem{archive} = "Needs upload";
         }
         # SVN versus upstream
         my $repo_mangled_ver = $data->{svn}{$pkg}{mangled_ver};
@@ -76,33 +72,30 @@
         # watch_error from svn is not needed, as Watch.pm copies it
         my $watch_error = $data->{watch}{$pkg}{error};
         if($watch_error and $watch_error eq "Native") {
-            $status{native} = 1;
+            #$status{native} = 1;
         } elsif($watch_error) {
             $status{watch_error} = 1;
-            $problem{upstream} = $watch_error;
+            push @notes, "Watch problem: $watch_error";
         } elsif((not $repo_mangled_ver and not $repo_unrel_mangled_ver)
                 or not $upstream_mangled_ver) {
-            $status{watch_error} = 1;
-            $problem{upstream} = "Watchfile problem"; # Should not happen
+            $status{watch_error} = 1; # Should not happen
+            push @notes, "Unexpected watchfile problem";
         } elsif($repo_mangled_ver) { # Will not check if UNRELEASED (?)
             if(deb_compare($repo_mangled_ver, $upstream_mangled_ver) > 0) {
-                $problem{repo} = "Ancient version in upstream?";
                 $status{upstream_ancient} = 1;
+                push @notes, "$repo_mangled_ver > $upstream_mangled_ver";
             }
             if(deb_compare($repo_mangled_ver, $upstream_mangled_ver) < 0) {
-                $problem{upstream} = "Newer upstream version";
                 $status{needs_upgrade} = 1;
             }
         }
         # Archive
         my $archive_latest = $data->{archive}{$pkg}{most_recent_src} || "";
         if($archive_latest =~ /new|incoming/) {
-            $problem{archive} = "Waiting to hit the archive";
             $status{archive_waiting} = 1;
         }
         my @bugs = sort keys %{$data->{bts}{$pkg}};
         if(@bugs) {
-            $problem{bts} = "Outstanding bugs";
             $status{has_bugs} = 1;
         }
 
@@ -114,12 +107,14 @@
             #
             svnpath => $data->{svn}{$pkg}{dir},
             upstream_url => $data->{watch}{$pkg}{upstream_url},
+            bugs    => \@bugs,
+            status  => \%status,
+            notes   => \@notes
         };
 
         use Data::Dumper;
         print "$pkg\n";
-        print Dumper \%problem;
-        print Dumper \%status;
+        print Dumper $res{$pkg};
         print "\n";
     }
 }




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