[SCM] Debian package checker branch, master, updated. 2.5.1-168-gf42e31d
The following commit has been merged in the master branch:
commit f42e31d4de539c4798bcd3e01556f1a79011566c
Author: Niels Thykier <niels@thykier.net>
Date: Wed Aug 3 00:02:08 2011 +0200
perlcritic cleaned various code parts
diff --git a/collection/bin-pkg-control b/collection/bin-pkg-control
index b846985..22ad1e8 100755
--- a/collection/bin-pkg-control
+++ b/collection/bin-pkg-control
@@ -20,54 +20,55 @@
# MA 02110-1301, USA.
use strict;
-
-($#ARGV == 1) or fail("syntax: bin-pkg-control <pkg> <type>");
-my $pkg = shift;
-my $type = shift;
-my (@jobs, $job);
+use warnings;
use lib "$ENV{'LINTIAN_ROOT'}/lib";
use Util;
use Lintian::Command qw(spawn reap);
-if (-e "control"){
- delete_dir("control") or fail("Cannot remove old control dir");
+($#ARGV == 1) or fail('syntax: bin-pkg-control <pkg> <type>');
+my $pkg = shift;
+my $type = shift;
+my (@jobs, $job);
+
+if (-e 'control'){
+ delete_dir('control') or fail('Cannot remove old control dir');
}
-mkdir("control", 0777) or fail("mkdir control: $!");
+mkdir('control', 0777) or fail("mkdir control: $!");
# The following calls use knowledge of the .deb format for speed
# (replaces dpkg-deb -e)
# extract control files' tarball
-spawn({ fail => 'error', out => "control.tar" },
+spawn({ fail => 'error', out => 'control.tar' },
['ar', 'p', 'deb', 'control.tar.gz'],
'|', ['gzip', '-dc']);
-$job = { fail => 'error', err => "control-errors" };
+$job = { fail => 'error', err => 'control-errors' };
push @jobs, $job;
# extract the tarball's contents
spawn($job,
- ["tar", "xf", "control.tar", "-C", "control", '&']);
+ ['tar', 'xf', 'control.tar', '-C', 'control', '&']);
$job = { fail => 'error',
- out => "control-index",
- err => "control-index-errors" };
+ out => 'control-index',
+ err => 'control-index-errors' };
push @jobs, $job;
# create index of control.tar.gz
spawn($job,
- ["tar", "tvf", "control.tar"],
- '|', ["sort", "-k", "6"], '&');
+ ['tar', 'tvf', 'control.tar'],
+ '|', ['sort', '-k', '6'], '&');
reap(@jobs);
undef @jobs;
# clean up control.tar
-unlink("control.tar") or fail();
+unlink('control.tar') or fail();
# fix permissions
spawn({ fail => 'error' },
- ["chmod", "-R", "u+rX,o-w", "control"]);
+ ['chmod', '-R', 'u+rX,o-w', 'control']);
exit 0;
diff --git a/collection/fields b/collection/fields
index cc0be99..9394b32 100755
--- a/collection/fields
+++ b/collection/fields
@@ -20,10 +20,11 @@
# MA 02110-1301, USA.
use strict;
+use warnings;
use lib "$ENV{'LINTIAN_ROOT'}/lib";
use Util;
-($#ARGV == 1) or fail("syntax: fields <pkg> <type>");
+($#ARGV == 1) or fail('syntax: fields <pkg> <type>');
my $pkg = shift;
my $type = shift;
my $file;
@@ -40,17 +41,17 @@ if ($type eq 'changes'){
if (!defined($file)) {
fail("Cannot extract files for $type") unless ($type =~ m/^remove-/);
} elsif (not -e $file) {
- fail("fields invoked in the wrong directory");
+ fail('fields invoked in the wrong directory');
}
if (-d 'fields'){
- delete_dir('fields') or fail("Could not remove old fields directory");
+ delete_dir('fields') or fail('Could not remove old fields directory');
}
# Exit now if we are just removing.
exit 0 unless (defined($file));
-mkdir("fields", 0777) or fail("mkdir fields: $!");
+mkdir('fields', 0777) or fail("mkdir fields: $!");
if ($type eq 'changes' or $type eq 'source'){
$data = get_dsc_info($file);
diff --git a/collection/index b/collection/index
index 00f8263..88052da 100755
--- a/collection/index
+++ b/collection/index
@@ -25,7 +25,6 @@
use strict;
use warnings;
-use vars qw($verbose);
# import perl libraries
use lib "$ENV{'LINTIAN_ROOT'}/lib";
@@ -181,7 +180,7 @@ sub index_src {
}
# Now that we have the file names we want, write them out sorted to the index
# file.
- spawn({ fail => 'error', out_append => "index" },
+ spawn({ fail => 'error', out_append => 'index' },
sub { print @result }, '|', ['sort', '-k', '6']);
return 1;
}
diff --git a/collection/java-info b/collection/java-info
index 63c771a..681ff33 100755
--- a/collection/java-info
+++ b/collection/java-info
@@ -41,7 +41,7 @@ while (<INDEX>) {
chomp;
$_ = (split(' ', $_, 6))[5];
next if / -> .*/; # We skip symlinks.
- if (m#(\S+)\.jar$#i) {
+ if (m#\S+\.jar$#i) {
my $file = $_;
my $has_manifest = 0;
diff --git a/lib/Lab/Package.pm b/lib/Lab/Package.pm
index 41adac9..76921f3 100644
--- a/lib/Lab/Package.pm
+++ b/lib/Lab/Package.pm
@@ -333,7 +333,7 @@ sub update_status_file{
}
print $fd "Lintian-Version: $lint_version\n";
- print $fd "Lab-Format: " . LAB_FORMAT ."\n";
+ print $fd 'Lab-Format: ' . LAB_FORMAT ."\n";
print $fd "Package: $self->{pkg_name}\n";
print $fd "Version: $self->{pkg_version}\n";
print $fd "Type: $self->{pkg_type}\n";
@@ -376,7 +376,7 @@ sub _check {
# lintian status file exists?
unless (-f "$basedir/.lintian-status") {
- v_msg("No lintian status file found (removing old directory in lab)");
+ v_msg('No lintian status file found (removing old directory in lab)');
$remove_basedir = 1;
goto REMOVE_BASEDIR;
}
@@ -391,14 +391,14 @@ sub _check {
# compatible lintian version?
if (not exists $data->{'lab-format'} or ($data->{'lab-format'} < LAB_FORMAT)) {
- v_msg("Lab directory was created by incompatible lintian version");
+ v_msg('Lab directory was created by incompatible lintian version');
$remove_basedir = 1;
goto REMOVE_BASEDIR;
}
# version up to date?
if (not exists $data->{'version'} or ($data->{'version'} ne $pkg_version)) {
- debug_msg(1, "Removing package in lab (newer version exists) ...");
+ debug_msg(1, 'Removing package in lab (newer version exists) ...');
$remove_basedir = 1;
goto REMOVE_BASEDIR;
}
@@ -412,7 +412,7 @@ sub _check {
$timestamp = $stat[9];
}
if ((not defined $timestamp) or (not exists $data->{'timestamp'}) or ($data->{'timestamp'} != $timestamp)) {
- debug_msg(1, "Removing package in lab (package has been changed) ...");
+ debug_msg(1, 'Removing package in lab (package has been changed) ...');
$remove_basedir = 1;
goto REMOVE_BASEDIR;
}
diff --git a/lib/Lintian/Collect/Binary.pm b/lib/Lintian/Collect/Binary.pm
index 1649727..68062c4 100644
--- a/lib/Lintian/Collect/Binary.pm
+++ b/lib/Lintian/Collect/Binary.pm
@@ -255,7 +255,7 @@ sub java_info {
$file_list = $java_info{$file}->{files};
$manifest = 0;
}
- elsif (m#^-- MANIFEST: \./(.+)$#o) {
+ elsif (m#^-- MANIFEST: \./(?:.+)$#o) {
# TODO: check $file == $1 ?
$java_info{$file}->{manifest} = {};
$manifest = $java_info{$file}->{manifest};
diff --git a/lib/Lintian/Internal/FrontendUtil.pm b/lib/Lintian/Internal/FrontendUtil.pm
index 4e3a2b9..9f45440 100644
--- a/lib/Lintian/Internal/FrontendUtil.pm
+++ b/lib/Lintian/Internal/FrontendUtil.pm
@@ -100,3 +100,5 @@ sub find_default_profile {
return lc($vendor);
}
+1;
+
--
Debian package checker
Reply to: