[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[SCM] Debian package checker branch, master, updated. 2.5.11-40-g1f3e632



The following commit has been merged in the master branch:
commit 75360d593ddb899a60e6f7cd5fcfe4fd6505a3f8
Author: Niels Thykier <niels@thykier.net>
Date:   Tue Jan 1 13:37:15 2013 +0100

    harness: Use the Lab's lab_query
    
    Signed-off-by: Niels Thykier <niels@thykier.net>

diff --git a/reporting/harness b/reporting/harness
index ece233a..2e748d8 100755
--- a/reporting/harness
+++ b/reporting/harness
@@ -71,8 +71,6 @@ my %opthash = (
     'help|h' => \&usage,
 );
 
-my %group_cache;
-
 # init commandline parser
 Getopt::Long::config('bundling', 'no_getopt_compat', 'no_auto_abbrev');
 
@@ -293,38 +291,37 @@ unless ($opt{'reports-only'}) {
     # from group 2 will not be procesed with their (full) group
     # (particularly without the source package).
 
-    _build_group_cache ();
-
     if ($opt{'full-mode'}) {
         # for full run, just replace %dirty_groups with "<all groups in lab>".
-        %dirty_groups = %group_cache;
+        $LAB->visit_packages (sub {
+            my ($entry) = @_;
+            $dirty_groups{$entry->pkg_src}->{$entry->pkg_src_version} = 1;
+        });
     }
 
     # Sort so that the worklist is also sorted (makes it easier to review).
     my $comparator = sub { versions_lt ($a, $b) ? -1 : 1; };
     foreach my $gname (sort keys %dirty_groups) {
-        next unless exists $group_cache{$gname};
         my $dver = $dirty_groups{$gname};
-        my $kver = $group_cache{$gname};
         foreach my $gversion (sort $comparator keys %$dver) {
-            next unless exists $kver->{$gversion};
-            # Group is still in the Lab - reprocess it together
             my $query = "GROUP:${gname}/${gversion}";
-            foreach my $entry (@{ $kver->{$gversion} } ) {
-                # Remove old log entry for all entries in this group
-                # NB: This part is unable to replace the update to %skip
-                # in the "foreach removed-entry in diff" above.  In case
-                # the entire group is removed, we will enter this loop,
-                # but we will see each of the entries removed in the
-                # loop above.
-                $skip{$entry->identifier} = 1;
+            my @res = $LAB->lab_query ($query);
+            if (@res) {
+                # Group is still in the Lab - reprocess it together
+                foreach my $entry (@res) {
+                    # Remove old log entry for all entries in this group
+                    # NB: This part is unable to replace the update to %skip
+                    # in the "foreach removed-entry in diff" above.  In case
+                    # the entire group is removed, we will enter this loop,
+                    # but we will see each of the entries removed in the
+                    # loop above.
+                    $skip{$entry->identifier} = 1;
+                    push @worklist, $query;
+                }
             }
-            push @worklist, $query;
         }
     }
 
-    _clear_group_cache ();
-
     # Flushes the changed manifest to the file system - croaks on
     # error
     # - no need to check dry-run here as nothing changed and it frees
@@ -491,21 +488,6 @@ sub _trim_split {
     return split m/\s*+,\s*+/o, $val;
 }
 
-#FIXME: Lab should handle this (frontend/lintian uses something similar)
-sub _build_group_cache {
-    # Globals %group_cache and $LAB
-    $LAB->visit_packages (sub {
-        my ($entry) = @_;
-        my $src = $entry->pkg_src;
-        my $src_version = $entry->pkg_src_version;
-        push @{ $group_cache{$src}->{$src_version} }, $entry;
-    });
-}
-
-sub _clear_group_cache {
-    undef %group_cache;
-}
-
 # local_mirror_manifests ($mirdir, $dists, $areas, $archs)
 #
 # Returns a list of manifests that represents what is on the local mirror

-- 
Debian package checker


Reply to: