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

[SCM] Debian package checker branch, lab-refactor, updated. 2.5.3-139-ga093e64



The following commit has been merged in the lab-refactor branch:
commit b445ee40d669d95afaebda5df1a47c855bbda0b3
Merge: d24b54953f84a696d8b9b8142282b3f8f1e4126e 4c198a6453f579f430b4a8fe3025106cd93fa25a
Author: Niels Thykier <niels@thykier.net>
Date:   Sun Oct 23 15:50:15 2011 +0200

    Merge branch 'master' into lab-refactor

diff --combined reporting/html_reports
index 29ec7d8,9499466..b8ad6aa
--- a/reporting/html_reports
+++ b/reporting/html_reports
@@@ -51,7 -51,7 +51,7 @@@ $ENV{'LINTIAN_ROOT'} = $LINTIAN_ROOT
  # Import Lintian Perl libraries.
  use lib "$ENV{LINTIAN_ROOT}/lib";
  use Lintian::Tag::Info ();
 -use Read_pkglists;
 +use Lintian::Lab::Manifest;
  use Text_utils;
  use Util;
  
@@@ -106,22 -106,17 +106,22 @@@ for my $template (qw/head foot clean in
  # Read the package lists.
  #
  
 -my %binary_info = %{ read_bin_list("$LINTIAN_LAB/info/binary-packages"); };
 -my %udeb_info = %{ read_bin_list("$LINTIAN_LAB/info/udeb-packages"); };
 -my %source_info = %{ read_src_list("$LINTIAN_LAB/info/source-packages"); };
 +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;
  
 -for my $source (keys %source_info) {
 -    for my $binary (split(/,\s+/o,$source_info{$source}->{'binary'})) {
 +$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");
 +
 +$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)
@@@ -238,40 -233,34 +238,40 @@@ while (<>) 
      # there is any.
      my ($source, $version, $area, $source_version, $maintainer, $uploaders);
      if ($type eq 'source') {
 +        my $srcdata;
 +        $source_info->visit_all (sub { $srcdata = $_[0] });
          $source = $package;
 -        if (exists $source_info{$source}) {
 -            $version = $source_info{$source}->{version};
 -            $area = $source_info{$source}->{area};
 -            $maintainer = $source_info{$source}->{maintainer};
 -            $uploaders = $source_info{$source}->{uploaders};
 +        if (defined $srcdata) {
 +            $version = $srcdata->{version};
 +            $area = $srcdata->{area};
 +            $maintainer = $srcdata->{maintainer};
 +            $uploaders = $srcdata->{uploaders};
          } else {
              warn "source package $package not listed!\n";
          }
      } else {
 +        my $srcdata;
 +        my $bindata;
          $source = $bin_src_ref{$package};
 -        if ($source and exists $source_info{$source}) {
 -            $maintainer = $source_info{$source}->{maintainer};
 -            $uploaders = $source_info{$source}->{uploaders};
 +        $source_info->visit_all (sub { $srcdata = $_[0] }) if $source;
 +        if (defined $srcdata) {
 +            $maintainer = $srcdata->{maintainer};
 +            $uploaders = $srcdata->{uploaders};
          } else {
              warn "source for package $package not found!\n";
              $source = $package;
              $maintainer = undef;
          }
          if ($type eq 'binary') {
 -            $version = $binary_info{$package}->{version};
 -            $area = $binary_info{$source}->{area};
 -            $source_version = $binary_info{$package}->{'source-version'};
 +            $binary_info->visit_all (sub { $bindata = $_[0] });
          } elsif ($type eq 'udeb') {
 -            $version = $udeb_info{$package}->{version};
 -            $area = $udeb_info{$source}->{area};
 -            $source_version = $udeb_info{$package}->{'source-version'};
 +            $udeb_info->visit_all (sub { $bindata = $_[0] });
 +        } else {
 +            fail "Unknown type or unhandled case ($type).\n";
          }
 +        $version = $bindata->{version};
 +        $area = $bindata->{area};
 +        $source_version = $bindata->{'source-version'};
      }
      $maintainer ||= '(unknown)';
      $area ||= 'main';
@@@ -330,12 -319,11 +330,12 @@@
  # this later to generate stub pages for maintainers whose packages are all
  # Lintian-clean.
  my %clean;
 -for my $source (keys %source_info) {
 -    my $maintainer = $source_info{$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
@@@ -677,7 -665,15 +677,15 @@@ sub output_template 
  
  # Sort function for sorting lists of tags.  Sort by package, version, area,
  # type, tag, and then any extra data.  This will produce the best HTML output.
+ #
+ # Note that source tags must come before all other tags, hench the "unfair"
+ # priority for those.  This is because the first tags listed are assumed to
+ # be source package tags.
  sub by_tag {
+     if ($a->{type} ne $b->{type}) {
+         return -1 if $a->{type} eq 'source';
+         return  1 if $b->{type} eq 'source';
+     }
      return $a->{package} cmp $b->{package}
          || $a->{version} cmp $b->{version}
          || $a->{area}    cmp $b->{area}

-- 
Debian package checker


Reply to: