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

[SCM] Debian package checker branch, master, updated. 2.5.10-137-gaafc722



The following commit has been merged in the master branch:
commit aafc72244056af22686add5dc63877b6640efb7b
Author: Niels Thykier <niels@thykier.net>
Date:   Sun Sep 9 12:32:36 2012 +0200

    L::Unpacker: Reduce unpack jobs for new entries
    
    The unpacker by default runs all collections on new entries, but this
    is way too much with (e.g.) "-o -C control-files", where a simple
    "bin-pkg-control" would suffice.
    
    To solve this, strip out all nodes of the (cloned) collmap that will
    never be needed.  It is not a perfect solution, but it reasonable in
    practise.
    
    Signed-off-by: Niels Thykier <niels@thykier.net>

diff --git a/lib/Lintian/Unpacker.pm b/lib/Lintian/Unpacker.pm
index 4d319a4..b2d9617 100644
--- a/lib/Lintian/Unpacker.pm
+++ b/lib/Lintian/Unpacker.pm
@@ -27,6 +27,7 @@ use Scalar::Util qw(blessed);
 use base 'Class::Accessor';
 
 use Lintian::Command::Simple;
+use Lintian::Util qw(fail);
 
 =head1 NAME
 
@@ -118,6 +119,31 @@ sub new {
             $req_table->{$_} = 1 for $check->needs_info;
         }
     }
+    if (defined $req_table) {
+        # For new entries we take everything in the collmap, which is
+        # a bit too much in some cases.  Since we have cloned collmap,
+        # we might as well prune the nodes we will not need in our
+        # copy.  While not perfect, it reduces the unnecessary work
+        # rather well.
+        #
+        #  Known issue: "lintian -oC files some.dsc" should not need
+        #  to do anything because "files" is "binary, udeb"-only.
+        my %needed = ();
+        my @check = keys %$req_table;
+        while ( my $coll = pop @check ) {
+            $needed{$coll} = 1;
+            push @check,
+                grep { ! exists $needed{$_} } $ccmap->parents ($coll);
+        }
+        # remove unneeded nodes in our copy
+        foreach my $node ($collmap->known) {
+            next if $needed{$node};
+            $ccmap->unlink ($node);
+        }
+        # ccmap should not be inconsistent by this change.
+        fail "Inconsistent collmap after deletion"
+            if $ccmap->missing;
+    }
     $self->{'requested'} = $req_table;
 
     # Initialise our copy

-- 
Debian package checker


Reply to: