[SCM] Debian package checker branch, master, updated. 2.4.3-177-g03cb2d4
The following commit has been merged in the master branch:
commit f134f0e356c028599f25c74addfd93e52e460fc7
Author: Niels Thykier <niels@thykier.net>
Date: Wed Jan 26 13:06:03 2011 +0100
Fixed some PerlCritic warnings in private/
diff --git a/private/generate-lintian-pod b/private/generate-lintian-pod
index 7e4a966..ac58946 100755
--- a/private/generate-lintian-pod
+++ b/private/generate-lintian-pod
@@ -1,28 +1,27 @@
#!/usr/bin/perl
use strict;
+use warnings;
# Find the lib directory of lintian-root (defaulting to ./lib/)
-use lib ($ENV{LINTIAN_ROOT}//'.') . "/lib/";
+use lib ($ENV{LINTIAN_ROOT}//'.') . '/lib/';
use Util qw(read_dpkg_control fail);
-my @keywords = (
-
-);
+my @keywords = ();
foreach my $kw (qw(conffiles shlibs Standards-Version)){
- push(@keywords, ["$kw", "B<$kw>"]);
+ push(@keywords, [$kw, "B<$kw>"]);
}
-open(my $file, "<", "man/lintian.pod.in") or fail("man/lintian.pod.in: $!");
+open(my $file, '<', 'man/lintian.pod.in') or fail("man/lintian.pod.in: $!");
while(my $line = <$file>){
chomp($line);
if($line eq '@CHECKS@'){
- extract_data('checks', 'check-script', 'abbrev');
+ extract_data('checks', 'abbrev');
} elsif($line eq '@COLLECTION@'){
- extract_data('collection', 'collector-script');
+ extract_data('collection');
} else {
print "$line\n";
}
@@ -71,7 +70,7 @@ sub pretty_print {
}
sub extract_data {
- my ($folder, $name, $abname) = @_;
+ my ($folder, $abname) = @_;
print "=over 4\n\n";
foreach my $file (<$folder/*.desc>) {
my ($header, @ignore) = read_dpkg_control($file);
diff --git a/private/refresh-perl-provides b/private/refresh-perl-provides
index 2dba961..ae890fe 100755
--- a/private/refresh-perl-provides
+++ b/private/refresh-perl-provides
@@ -1,5 +1,6 @@
#!/usr/bin/perl -w
use strict;
+use warnings;
# Generate a list of packages that are provided by the Perl core packages
# and also packaged separately at a (hopefully) newer version.
@@ -42,8 +43,8 @@ my $cache = AptPkg::Cache->new;
# special cases when libfoo-bar-perl => Foo::Bar doesn't work
my %module_name = (
- "libio-compress-perl" => "IO::Compress::Gzip",
- "libio-compress-zlib-perl" => "IO::Compress::Gzip",
+ 'libio-compress-perl' => 'IO::Compress::Gzip',
+ 'libio-compress-zlib-perl' => 'IO::Compress::Gzip',
);
use Module::CoreList;
@@ -53,11 +54,11 @@ my $versioning = $_system->versioning;
my @core_packages = (qw(perl-base perl perl-modules));
# check we have a cache of Debian sid packages available
-warn("Warning: this list should only be updated on a system with an up to date APT cache of the Debian unstable distribution")
+warn('Warning: this list should only be updated on a system with an up to date APT cache of the Debian unstable distribution')
if !grep { defined $_->{Origin} &&
defined $_->{Archive} &&
- $_->{Origin} eq "Debian" &&
- $_->{Archive} eq "unstable" }
+ $_->{Origin} eq 'Debian' &&
+ $_->{Archive} eq 'unstable' }
@{$cache->files};
print <<EOF;
diff --git a/private/tag-stats b/private/tag-stats
index 4d2b3d0..5d522aa 100755
--- a/private/tag-stats
+++ b/private/tag-stats
@@ -33,7 +33,6 @@ my @types = qw(E W I P);
my %stats;
my $num_tags = 0;
-my %num_code;
my $num_ok = 0;
my $percent = 0;
@@ -83,14 +82,14 @@ print "Severity\n";
foreach my $s (@severities) {
my $tags = $stats{severity}{$s};
print " $s: " . @{$tags} . "\n";
- print " " . join("\n ", sort @{$tags}) . "\n" if $verbose >= 3;
+ print ' ' . join("\n ", sort @{$tags}) . "\n" if $verbose >= 3;
}
print "\nCertainty\n";
foreach my $c (@certainties) {
my $tags = $stats{certainty}{$c};
print " $c: " . @{$tags} . "\n";
- print " " . join("\n ", sort @{$tags}) . "\n" if $verbose >= 3;
+ print ' ' . join("\n ", sort @{$tags}) . "\n" if $verbose >= 3;
}
print "\nSeverity/Certainty\n";
@@ -98,7 +97,7 @@ foreach my $s (@severities) {
foreach my $c (@certainties) {
if (my $tags = $stats{both}{$s}{$c}) {
print " $s/$c: " . @{$tags} . "\n";
- print " " . join("\n ", sort @{$tags}) . "\n"
+ print ' ' . join("\n ", sort @{$tags}) . "\n"
if $verbose >= 2;
}
}
@@ -109,7 +108,7 @@ foreach my $t (@types) {
foreach my $s (@severities) {
if (my $tags = $stats{type}{severity}{$t}{$s}) {
print " $s: " . @{$tags} . "\n";
- print " " . join("\n ", sort @{$tags}) . "\n"
+ print ' ' . join("\n ", sort @{$tags}) . "\n"
if $verbose >= 2;
}
}
@@ -121,7 +120,7 @@ foreach my $t (@types) {
foreach my $c (@certainties) {
if (my $tags = $stats{type}{both}{$t}{$s}{$c}) {
print " $s/$c: " . @{$tags} . "\n";
- print " " . join("\n ", sort @{$tags}) . "\n"
+ print ' ' . join("\n ", sort @{$tags}) . "\n"
if $verbose >= 1;
}
}
@@ -135,14 +134,14 @@ foreach my $s (@severities) {
my $size = scalar keys %{$needs};
my @list = sort keys %{$needs};
print " $s/$c: $size\n";
- print " " . join("\n ", @list) . "\n" if $verbose >= 2;
+ print ' ' . join("\n ", @list) . "\n" if $verbose >= 2;
}
}
}
if ($verbose >= 1 and exists $stats{severity}{unclassified}) {
print "\nUnclassified tags\n";
- print " " . join("\n ", @{$stats{severity}{unclassified}}) . "\n"
+ print ' ' . join("\n ", @{$stats{severity}{unclassified}}) . "\n"
}
# Local Variables:
diff --git a/private/update-coverage b/private/update-coverage
index 5e9b564..7ea5178 100755
--- a/private/update-coverage
+++ b/private/update-coverage
@@ -64,8 +64,8 @@ for my $tagfile (<t/changes/*.tags>, <t/debs/*/tags>, <t/source/*/tags>) {
open(IN, '<', $tagfile) or die "Cannot open $tagfile: $!\n";
local $_;
while (<IN>) {
- if (/^(.): (\S+)(?: (?:changes|source|udeb))?: (\S+)/) {
- delete $tags{$3};
+ if (/^.: \S+(?: (?:changes|source|udeb))?: (\S+)/) {
+ delete $tags{$1};
}
}
close IN;
@@ -82,11 +82,12 @@ for my $tagfile (<testset/tags.*>) {
open (IN, '<', $tagfile) or die "Cannot open $tagfile: $!\n";
local $_;
while (<IN>) {
- if (/^(.): (\S+)(?: (?:changes|source|udeb))?: (\S+)/) {
- if (exists $tags{$3}) {
- $legacy{$3} = $tags{$3};
- delete $tags{$3};
- push (@{ $legacy_test{$case} }, $3);
+ if (/^.: \S+(?: (?:changes|source|udeb))?: (\S+)/) {
+ my $tag = $1;
+ if (exists $tags{$tag}) {
+ $legacy{$tag} = $tags{$tag};
+ delete $tags{$tag};
+ push (@{ $legacy_test{$case} }, $tag);
}
}
}
@@ -95,7 +96,7 @@ for my $tagfile (<testset/tags.*>) {
# Open COVERAGE and print out a date stamp.
open(OUT, '>', 't/COVERAGE') or die "Cannot create t/COVERAGE: $!\n";
-print OUT "Last generated ", strftime ('%Y-%m-%d', gmtime), "\n\n";
+print OUT 'Last generated ', strftime ('%Y-%m-%d', gmtime), "\n\n";
# Whatever is left in the %tags hash are untested. Print them out sorted by
# checks file.
--
Debian package checker
Reply to: