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

[SCM] Debian package checker branch, lab-refactor, updated. 2.5.3-80-g7e86c05



The following commit has been merged in the lab-refactor branch:
commit 7e86c05da6ad60f4925c2ec92fc99c3420fc9256
Author: Niels Thykier <niels@thykier.net>
Date:   Wed Sep 28 14:36:26 2011 +0200

    Migrated reporting/html_reports to Lintian::Lab::Manifest
    
    It has an implicit assumption that there is only one entry of each
    type with the same name.  For now it just picks one of them (as
    determined by visit_all).  It should not be a huge issue as long as
    lintian.d.o-like setups do not support multiple architectures.
    
    Signed-off-by: Niels Thykier <niels@thykier.net>

diff --git a/reporting/html_reports b/reporting/html_reports
index eeffac6..19a4eb4 100755
--- a/reporting/html_reports
+++ b/reporting/html_reports
@@ -55,7 +55,7 @@ $ENV{'LINTIAN_ROOT'} = $LINTIAN_ROOT;
 # Import Lintian Perl libraries.
 use lib "$ENV{LINTIAN_ROOT}/lib";
 use Lintian::Tag::Info ();
-use Lintian::Internal::PackageList;
+use Lintian::Lab::Manifest;
 use Text_utils;
 use Util;
 
@@ -110,21 +110,22 @@ for my $template (qw/head foot clean index maintainer maintainers packages tag
 # Read the package lists.
 #
 
-my $binary_info = Lintian::Internal::PackageList->new('binary');
-my $udeb_info   = Lintian::Internal::PackageList->new('udeb');
-my $source_info = Lintian::Internal::PackageList->new('source');
+my $binary_info = Lintian::Lab::Manifest->new ('binary');
+my $udeb_info   = Lintian::Lab::Manifest->new ('udeb');
+my $source_info = Lintian::Lab::Manifest->new ('source');
 my %bin_src_ref;
 
 $binary_info->read_list("$LINTIAN_LAB/info/binary-packages");
 $udeb_info->read_list("$LINTIAN_LAB/info/udeb-packages");
 $source_info->read_list("$LINTIAN_LAB/info/source-packages");
 
-foreach my $source ($source_info->get_all){
-    foreach my $binary (split m/\s*,\s++/o, $source_info->get($source)->{'binary'}) {
+$source_info->visit_all (sub {
+    my ($entry) = @_;
+    my $source = $entry->{'source'};
+    foreach my $binary (split m/\s*,\s*+/o, $entry->{'binary'}) {
         $bin_src_ref{$binary} = $source;
     }
-}
-
+});
 
 # Create output directories.
 mkdir($HTML_TMP_DIR, 0777)
@@ -241,7 +242,8 @@ while (<>) {
     # there is any.
     my ($source, $version, $area, $source_version, $maintainer, $uploaders);
     if ($type eq 'source') {
-        my $srcdata = $source_info->get($source);
+        my $srcdata;
+        $source_info->visit_all (sub { $srcdata = $_[0] });
         $source = $package;
         if (defined $srcdata) {
             $version = $srcdata->{version};
@@ -255,7 +257,7 @@ while (<>) {
         my $srcdata;
         my $bindata;
         $source = $bin_src_ref{$package};
-        $srcdata = $source_info->get($source) if $source;
+        $source_info->visit_all (sub { $srcdata = $_[0] }) if $source;
         if (defined $srcdata) {
             $maintainer = $srcdata->{maintainer};
             $uploaders = $srcdata->{uploaders};
@@ -265,9 +267,9 @@ while (<>) {
             $maintainer = undef;
         }
         if ($type eq 'binary') {
-            $bindata = $binary_info->get($package);
+            $binary_info->visit_all (sub { $bindata = $_[0] });
         } elsif ($type eq 'udeb') {
-            $bindata = $udeb_info->get($package);
+            $udeb_info->visit_all (sub { $bindata = $_[0] });
         } else {
             fail "Unknown type or unhandled case ($type).\n";
         }
@@ -332,11 +334,12 @@ while (<>) {
 # this later to generate stub pages for maintainers whose packages are all
 # Lintian-clean.
 my %clean;
-for my $source ($source_info->get_all) {
-    my $maintainer = $source_info->get($source)->{maintainer};
+$source_info->visit_all (sub {
+    my ($srcdata) = @_;
+    my $maintainer = $srcdata->{maintainer};
     my $id = maintainer_url ($maintainer);
     $clean{$id} = $maintainer;
-}
+});
 
 # Now, walk through the tags by source package (sorted by maintainer).  Output
 # a summary page of errors and warnings for each maintainer, output a full

-- 
Debian package checker


Reply to: