lintian: r875 - in trunk: debian reporting
Author: rra
Date: 2007-04-29 01:29:46 +0200 (Sun, 29 Apr 2007)
New Revision: 875
Modified:
trunk/debian/changelog
trunk/reporting/harness
trunk/reporting/html_reports
Log:
* reporting/harness:
+ [RA] Include overridden tags in the lintian output so that we can do
statistical reporting on them and see them in lintian.log.
* reporting/html_reports:
+ [RA] Create stub pages for maintainers with only lintian-clean
packages. (Closes: #305173)
+ [RA] Sort packages on each maintainer's page.
+ [RA] Report statistics on info tags as well.
+ [RA] Generate better file names for maintainer pages with weird
characters.
+ [RA] Fix Perl warnings.
Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog 2007-04-28 05:53:20 UTC (rev 874)
+++ trunk/debian/changelog 2007-04-28 23:29:46 UTC (rev 875)
@@ -90,8 +90,20 @@
file that cannot be satisfied by that package (including via
Provides). (Closes: #56440)
- -- Russ Allbery <rra@debian.org> Fri, 27 Apr 2007 22:46:06 -0700
+ * reporting/harness:
+ + [RA] Include overridden tags in the lintian output so that we can do
+ statistical reporting on them and see them in lintian.log.
+ * reporting/html_reports:
+ + [RA] Create stub pages for maintainers with only lintian-clean
+ packages. (Closes: #305173)
+ + [RA] Sort packages on each maintainer's page.
+ + [RA] Report statistics on info tags as well.
+ + [RA] Generate better file names for maintainer pages with weird
+ characters.
+ + [RA] Fix Perl warnings.
+ -- Russ Allbery <rra@debian.org> Sat, 28 Apr 2007 16:29:27 -0700
+
lintian (1.23.29) unstable; urgency=low
The "look at all the stuff that accumulated during the etch freeze"
Modified: trunk/reporting/harness
===================================================================
--- trunk/reporting/harness 2007-04-28 05:53:20 UTC (rev 874)
+++ trunk/reporting/harness 2007-04-28 23:29:46 UTC (rev 875)
@@ -115,7 +115,7 @@
if ($opt_f) { # check all packages
Log("Running Lintian over all packages...");
- my $cmd = "$lintian_cmd -I -v -a -U changelog-file >$lintian_log";
+ my $cmd = "$lintian_cmd -I -v -a --show-overrides -U changelog-file >$lintian_log";
Log("Executing $cmd");
my $res = (system($cmd) >> 8);
(($res == 0) or ($res == 1))
@@ -141,7 +141,7 @@
$pkgfile = "$LINTIAN_LAB/info/udeb-packages";
(-f $pkgfile) or Die("cannot find list of udeb packages $pkgfile");
read_udeb_list($pkgfile);
-
+
# read source packages files
$pkgfile = "$LINTIAN_LAB/info/source-packages";
(-f $pkgfile) or Die("cannot find list of source packages $pkgfile");
@@ -155,12 +155,12 @@
or Die("cannot open list file $list_file for writing: $!");
while (<IN>) {
chop;
-
+
if (/^N: Listed (changed|new) (binary|udeb|source) package (\S+) (\S+)/o) {
my ($type,$binsrc,$pkg,$ver) = ($1,$2,$3,$4);
-
+
Log("$type $binsrc package $pkg $ver");
-
+
if ($binsrc eq 'binary') {
my $data = $binary_info{$pkg};
$data or Die("cannot find binary package $pkg in binary-packages file");
@@ -220,7 +220,7 @@
$copy_mode = not exists $skip_source{$pkg};
}
}
-
+
if ($copy_mode) {
print OUT $_;
}
@@ -232,7 +232,7 @@
# run Lintian over the newly introduced or changed packages
Log("Running Lintian over newly introduced and changed packages...");
- my $cmd = "$lintian_cmd -I -v -p $list_file -U changelog-file >>$lintian_log";
+ my $cmd = "$lintian_cmd -I -v --show-overrides -p $list_file -U changelog-file >>$lintian_log";
Log("Executing $cmd");
my $res = (system($cmd) >> 8);
(($res == 0) or ($res == 1))
Modified: trunk/reporting/html_reports
===================================================================
--- trunk/reporting/html_reports 2007-04-28 05:53:20 UTC (rev 874)
+++ trunk/reporting/html_reports 2007-04-28 23:29:46 UTC (rev 875)
@@ -45,6 +45,10 @@
use Read_pkglists;
use vars qw(%binary_info %source_info %udeb_info %bin_src_ref); # from the above
+# These should really not be global.
+my $maint = "";
+my $maint_file = "";
+
# Determine Lintian version
chomp(my $LINTIAN_VERSION = `$LINTIAN_ROOT/frontend/lintian --print-version`);
@@ -73,8 +77,8 @@
mkdir($HTML_TMP_DIR,0777)
or die "cannot create output directory $HTML_TMP_DIR: $!";
-my ($num_errors, $num_warnings, $num_experimental, $num_overridden);
-$num_errors = $num_warnings = $num_experimental = $num_overridden = 0;
+my ($num_errors, $num_warnings, $num_experimental, $num_overridden, $num_info);
+$num_errors = $num_warnings = $num_experimental = $num_overridden = $num_info = 0;
my (%by_src, %by_tag);
my %anchor;
@@ -96,6 +100,7 @@
$num_overridden++;
next;
} elsif ($code eq 'I') {
+ $num_info++;
next;
}
@@ -114,12 +119,12 @@
if (not exists $source_info{$src}) {
# work around:
- $source_info{$src}->{'maintainer'} =
- $binary_info{$pkg}->{'maintainer'} ||
+ $source_info{$src}->{'maintainer'} =
+ $binary_info{$pkg}->{'maintainer'} ||
$udeb_info{$pkg}->{'maintainer'} || '(unknown)';
$source_info{$src}->{'version'} = $binary_info{$pkg}->{'version'};
}
-
+
push(@{$by_src{$src}},$_);
push(@{$by_tag{$tag}},$_);
}
@@ -130,15 +135,24 @@
my ($src_num_errors, $src_num_warnings);
my ($num_binpkg, $num_udebpkg, $num_maint, $num_srcpkg);
+# Build a hash of all maintainers. We use this to generate stub pages for
+# maintainers whose packages are all lintian-clean.
+my %maintainers;
+for my $src (keys %source_info) {
+ $maintainers{$source_info{$src}{maintainer}} = 1;
+}
+
# Create per-maintainer list
for my $src (sort by_maint keys %by_src) {
my @tags;
my ($lastpkg, $lasttag);
$lastpkg = $lasttag = "";
- warn "no maintainer for $src!\n" unless defined $source_info{$src}{maintainer};
+ warn "no maintainer for $src!\n"
+ unless defined $source_info{$src}{maintainer};
set_maintainer($source_info{$src}{'maintainer'});
new_src_package($src, $source_info{$src}{'version'});
+ delete $maintainers{$source_info{$src}{maintainer}};
for (sort by_tag @{$by_src{$src}}) {
my ($code, $pkg, $type, $tag, $rest) =
@@ -178,6 +192,17 @@
close_maintainer_index();
close_qa_list();
+# Now, generate stub pages for every maintainer who has only clean packages.
+# Opening the index to /dev/null is such a hack. Code refactoring is
+# desperately needed here.
+open(I, '>/dev/null');
+for my $maintainer (keys %maintainers) {
+ set_maintainer($maintainer);
+ print P "<p>All of this maintainer's packages are lintian-clean.</p>\n";
+}
+close_maintainer();
+close I;
+
# Create tag pages
open_tag_index();
for my $tag (sort keys %by_tag) {
@@ -250,9 +275,8 @@
if (-f $statistics_file) {
($old_stat) = read_dpkg_control($statistics_file);
}
+$old_stat->{'info'} ||= 0;
-#foreach (keys %old_stat) { print "old stat $_: $old_stat{$_}\n"; };
-
# Calculate changes
my $delta_num_maint = sprintf "%+d",$num_maint-$old_stat->{'maintainers'};
my $delta_num_srcpkg = sprintf "%+d",$num_srcpkg-$old_stat->{'source-packages'};
@@ -261,6 +285,7 @@
my $delta_num_warnings = sprintf "%+d",$num_warnings-$old_stat->{'warnings'};
my $delta_num_errors = sprintf "%+d",$num_errors-$old_stat->{'errors'};
my $delta_num_experimental = sprintf "%+d",$num_experimental-$old_stat->{'experimental'};
+my $delta_num_info = sprintf "%+d",$num_info-$old_stat->{'info'};
my $delta_num_overridden = sprintf "%+d",$num_overridden-$old_stat->{'overridden'};
# update statistics file
@@ -274,6 +299,7 @@
$stat->{'warnings'} = $num_warnings;
$stat->{'errors'} = $num_errors;
$stat->{'experimental'} = $num_experimental;
+$stat->{'info'} = $num_info;
$stat->{'overridden'} = $num_overridden;
$stat->{'lintian-version'} = $LINTIAN_VERSION;
open(OUT,">$statistics_file")
@@ -343,6 +369,7 @@
<tr><td>Udeb packages listed:</td> <td>$num_udebpkg ($delta_num_udebpkg)</td></tr>
<tr><td>Warnings:</td> <td>$num_warnings ($delta_num_warnings)</td></tr>
<tr><td>Errors:</td> <td>$num_errors ($delta_num_errors)</td></tr>
+<tr><td>Info tags:</td> <td>$num_info ($delta_num_info)</td></tr>
<tr><td>Overridden tags:</td> <td>$num_overridden ($delta_num_overridden)</td></tr>
<tr><td>Lintian version:</td> <td>$LINTIAN_VERSION</td></tr>
</table>
@@ -420,9 +447,6 @@
# -------------------------------
-my $maint = "";
-my $maint_file = "";
-
sub open_maintainer {
return if $_[0] eq $maint_file;
close_maintainer();
@@ -458,8 +482,8 @@
if ($file) {
$file =~ s/^(.+)\<.*$/$1/;
$file =~ tr/A-Za-z0-9_.,/_/c;
- $file =~ s/^_//g;
- $file =~ s/_$//g;
+ $file =~ s/^_+//g;
+ $file =~ s/_+$//g;
$file = "m$file.html";
} else {
@@ -621,7 +645,8 @@
# -------------------------------
sub by_maint {
- $source_info{$a}->{'maintainer'} cmp $source_info{$b}->{'maintainer'};
+ $source_info{$a}->{'maintainer'} cmp $source_info{$b}->{'maintainer'}
+ || $a cmp $b;
}
sub by_tag {
Reply to: