[SCM] Debian package checker branch, master, updated. 2.4.3-174-g6c40856
The following commit has been merged in the master branch:
commit 97687fd2d964a534c79fcf8fe5f439f5cb854487
Author: Niels Thykier <niels@thykier.net>
Date: Wed Jan 26 12:31:18 2011 +0100
Fixed more PerlCritic warnings - lib/ is now mostly clean
diff --git a/lib/Lintian/Data.pm b/lib/Lintian/Data.pm
index 5556bf6..98a7bc2 100644
--- a/lib/Lintian/Data.pm
+++ b/lib/Lintian/Data.pm
@@ -18,6 +18,7 @@
package Lintian::Data;
use strict;
+use warnings;
use Carp qw(croak);
@@ -40,7 +41,7 @@ use Carp qw(croak);
chomp;
s/^\s+//;
next if /^\#/;
- next if /^$/;
+ next if $_ eq '';
my ($key, $val);
if (defined $separator) {
($key, $val) = split(/$separator/, $_, 2);
diff --git a/lib/Lintian/DepMap/Properties.pm b/lib/Lintian/DepMap/Properties.pm
index b26aee0..cab7071 100644
--- a/lib/Lintian/DepMap/Properties.pm
+++ b/lib/Lintian/DepMap/Properties.pm
@@ -19,8 +19,6 @@ use strict;
use warnings;
use base 'Lintian::DepMap';
-my ($properties);
-
=head1 NAME
Lintian::DepMap::Properties - Dependencies with properties map/tree creator
diff --git a/lib/Lintian/Output.pm b/lib/Lintian/Output.pm
index 4405db2..158efdc 100644
--- a/lib/Lintian/Output.pm
+++ b/lib/Lintian/Output.pm
@@ -311,7 +311,7 @@ sub print_tag {
}
$self->_print('', "$code: $pkg_info->{package}$type", "$tag$information");
- if (!$self->issued_tag($tag_info->tag) and $self->showdescription) {
+ if (not $self->issued_tag($tag_info->tag) and $self->showdescription) {
my $description;
if ($self->_do_color && $self->color eq 'html') {
$description = $tag_info->description('html', ' ');
@@ -334,9 +334,9 @@ Lintian::Output uses v_msg() for output. Called from Tags::select_pkg().
sub print_start_pkg {
my ($self, $pkg_info) = @_;
- my $object = "package";
+ my $object = 'package';
if ($pkg_info->{type} eq 'changes') {
- $object = "file";
+ $object = 'file';
}
$self->v_msg($self->delimiter,
diff --git a/lib/Lintian/Output/LetterQualifier.pm b/lib/Lintian/Output/LetterQualifier.pm
index 5275779..1f9828c 100644
--- a/lib/Lintian/Output/LetterQualifier.pm
+++ b/lib/Lintian/Output/LetterQualifier.pm
@@ -127,7 +127,7 @@ sub print_tag {
}
$self->_print('', "$code\[$lq\]: $pkg$type", "$tag$information");
- if (!$self->issued_tag($tag_info->tag) and $self->showdescription) {
+ if (not $self->issued_tag($tag_info->tag) and $self->showdescription) {
my $description = $tag_info->description('text', ' ');
$self->_print('', 'N', '');
$self->_print('', 'N', split("\n", $description));
diff --git a/lib/Lintian/Schedule.pm b/lib/Lintian/Schedule.pm
index 6031466..db3d9c2 100644
--- a/lib/Lintian/Schedule.pm
+++ b/lib/Lintian/Schedule.pm
@@ -41,7 +41,8 @@ sub new {
sub add_file {
my ($self, $type, $file, %pkg_info) = @_;
- my %long_types = ('b','binary', 'c','changes', 's','source', 'u','udeb');
+ my %long_types = ('b' => 'binary', 'c' => 'changes',
+ 's' => 'source', 'u' =>'udeb');
my ($pkg, $ver, $arch);
if ($type eq 's') {
($pkg, $ver, $arch) =
@@ -120,7 +121,7 @@ sub add_changes {
my $info = get_dsc_info($changes_file);
return unless defined $info;
-
+
my $status = $self->add_file('c', $changes_file, %$info);
# get directory and filename part of $changes_file
my ($arg_dir, $arg_name) = $changes_file =~ m,(.*)/([^/]+)$,;
@@ -146,7 +147,7 @@ sub add_changes {
} elsif ($file =~ /\.dsc$/) {
$status += $self->add_dsc("$arg_dir/$file");
}
- }
+ }
return ($status ? 0 : 1);
}
diff --git a/lib/Lintian/Tag/Info.pm b/lib/Lintian/Tag/Info.pm
index 1f504a2..95bc360 100644
--- a/lib/Lintian/Tag/Info.pm
+++ b/lib/Lintian/Tag/Info.pm
@@ -218,9 +218,9 @@ sub _manual_reference {
$text .= " section $section";
}
if ($section and exists $MANUALS{$manual}{$section}) {
- my $title = $MANUALS{$manual}{$section}{title};
- my $url = $MANUALS{$manual}{$section}{url};
- $text .= $url ? qq[ (<a href="$url">$title</a>)] : qq[ ($title)];
+ my $sec_title = $MANUALS{$manual}{$section}{title};
+ my $sec_url = $MANUALS{$manual}{$section}{url};
+ $text .= $sec_url ? qq[ (<a href="$sec_url">$sec_title</a>)] : qq[ ($sec_title)];
}
return $text;
diff --git a/lib/Lintian/Tags.pm b/lib/Lintian/Tags.pm
index f4b36bb..7f6b4cf 100644
--- a/lib/Lintian/Tags.pm
+++ b/lib/Lintian/Tags.pm
@@ -344,7 +344,7 @@ sub display {
my ($self, $op, $rel, $severity, $certainty) = @_;
unless ($op =~ /^[+=-]\z/ and $rel =~ /^(?:[<>]=?|=)\z/) {
my $error = $self->_format_level($op, $rel, $severity, $certainty);
- die "invalid display constraint " . $error;
+ die 'invalid display constraint ' . $error;
}
if ($op eq '=') {
for my $s (@SEVERITIES) {
@@ -367,7 +367,7 @@ sub display {
}
unless (@severities and @certainties) {
my $error = $self->_format_level($op, $rel, $severity, $certainty);
- die "invalid display constraint " . $error;
+ die 'invalid display constraint ' . $error;
}
for my $s (@severities) {
for my $c (@certainties) {
@@ -523,7 +523,7 @@ file cannot be opened.
sub file_overrides {
my ($self, $overrides) = @_;
unless (defined $self->{current}) {
- die "no current file when adding overrides";
+ die 'no current file when adding overrides';
}
my $info = $self->{info}{$self->{current}};
open(my $file, '<', $overrides)
@@ -536,7 +536,7 @@ sub file_overrides {
s/\s+/ /go;
my $override = $_;
$override =~ s/^\Q$info->{package}\E( \Q$info->{type}\E)?: //;
- if ($override eq '' or $override !~ /^[\w.+-]+(\s.*)?$/) {
+ if ($override eq '' or $override !~ /^[\w.+-]+(?:\s.*)?$/) {
tag('malformed-override', $_);
} else {
my ($tag, $extra) = split(/ /, $override, 2);
--
Debian package checker
Reply to: