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

[SCM] Debian package checker branch, master, updated. 2.4.3-167-gc8f87a7



The following commit has been merged in the master branch:
commit f432acae8faf3b1c8b0062d50724bfa76e551e02
Author: Niels Thykier <niels@thykier.net>
Date:   Wed Jan 26 10:36:54 2011 +0100

    Fixed PerlCritic warnings in Lintian::Collect::*

diff --git a/lib/Lintian/Collect/Binary.pm b/lib/Lintian/Collect/Binary.pm
index 50f3d76..2dd6b58 100644
--- a/lib/Lintian/Collect/Binary.pm
+++ b/lib/Lintian/Collect/Binary.pm
@@ -72,9 +72,9 @@ sub index {
     return $self->{index} if exists $self->{index};
 
     my (%idx, %dir_counts);
-    open my $idx, '<', "index"
+    open my $idx, '<', 'index'
         or fail("cannot open index file index: $!");
-    open my $num_idx, '<', "index-owner-id"
+    open my $num_idx, '<', 'index-owner-id'
         or fail("cannot open index file index-owner-id: $!");
     while (<$idx>) {
         chomp;
@@ -87,7 +87,7 @@ sub index {
 
         my $numeric = <$num_idx>;
         chomp $numeric;
-        fail("cannot read index file index-owner-id") unless defined $numeric;
+        fail('cannot read index file index-owner-id') unless defined $numeric;
         my ($owner_id, $name_chk) = (split(' ', $numeric, 6))[1, 5];
         fail("mismatching contents of index files: $name $name_chk")
             if $name ne $name_chk;
@@ -142,7 +142,7 @@ sub file_info {
 
     my %file_info;
     # sub file_info Needs-Info file-info
-    open(my $idx, '<', "file-info")
+    open(my $idx, '<', 'file-info')
         or fail("cannot open file-info: $!");
     while (<$idx>) {
         chomp;
@@ -183,7 +183,7 @@ sub scripts {
 
     my %scripts;
     # sub scripts Needs-Info scripts
-    open(SCRIPTS, '<', "scripts")
+    open(SCRIPTS, '<', 'scripts')
 	or fail("cannot open scripts file: $!");
     while (<SCRIPTS>) {
 	chomp;
@@ -213,7 +213,7 @@ sub objdump_info {
     my %objdump_info;
     my ($dynsyms, $file);
     # sub objdump_info Needs-Info objdump-info
-    open(my $idx, '<', "objdump-info")
+    open(my $idx, '<', 'objdump-info')
         or fail("cannot open objdump-info: $!");
     while (<$idx>) {
         chomp;
@@ -237,8 +237,9 @@ sub objdump_info {
             if (m/^\s*NEEDED\s*(\S+)/o) {
                 push @{$file->{NEEDED}}, $1;
             } elsif (m/^\s*RPATH\s*(\S+)/o) {
-                foreach (split m/:/, $1) {
-                    $file->{RPATH}{$_}++;
+                my $rpath = $1;
+                foreach my $r (split m/:/o, $rpath) {
+                    $file->{RPATH}{$r}++;
                 }
             } elsif (m/^\s*SONAME\s*(\S+)/o) {
                 push @{$file->{SONAME}}, $1;
@@ -248,16 +249,16 @@ sub objdump_info {
                 $file->{NOTE_SECTION} = 1;
             } elsif (m/^DYNAMIC SYMBOL TABLE:/) {
                 $dynsyms = 1;
-            } elsif (m/^objdump: (.*?): File format not recognized$/) {
-                push @{$file->{NOTES}}, "File format not recognized";
-            } elsif (m/^objdump: (.*?): File truncated$/) {
-                push @{$file->{NOTES}}, "File truncated";
-            } elsif (m/^objdump: \.(.*?): Packed with UPX$/) {
-                push @{$file->{NOTES}}, "Packed with UPX";
-            } elsif (m/objdump: \.(.*?): Invalid operation$/) {
+            } elsif (m/^objdump: .*?: File format not recognized$/) {
+                push @{$file->{NOTES}}, 'File format not recognized';
+            } elsif (m/^objdump: .*?: File truncated$/) {
+                push @{$file->{NOTES}}, 'File truncated';
+            } elsif (m/^objdump: \..*?: Packed with UPX$/) {
+                push @{$file->{NOTES}}, 'Packed with UPX';
+            } elsif (m/objdump: \..*?: Invalid operation$/) {
                 # Don't anchor this regex since it can be interspersed with other
                 # output and hence not on the beginning of a line.
-                push @{$file->{NOTES}}, "Invalid operation";
+                push @{$file->{NOTES}}, 'Invalid operation';
             } elsif (m/CXXABI/) {
                 $file->{CXXABI} = 1;
             } elsif (m%Requesting program interpreter:\s+/lib/klibc-\S+\.so%) {
@@ -267,9 +268,9 @@ sub objdump_info {
 	    } elsif (m/^\s*INTERP\s/) {
 		$file->{INTERP} = 1;
 	    } elsif (m/^\s*STACK\s/) {
-		$file->{STACK} = "0";
+		$file->{STACK} = '0';
 	    } else {
-		if (defined $file->{STACK} and $file->{STACK} eq "0") {
+		if (defined $file->{STACK} and $file->{STACK} eq '0') {
 		    m/\sflags\s+(\S+)/o;
 		    $file->{STACK} = $1;
 		} else {
diff --git a/lib/Lintian/Collect/Changes.pm b/lib/Lintian/Collect/Changes.pm
index f0e1cfe..f49d31b 100644
--- a/lib/Lintian/Collect/Changes.pm
+++ b/lib/Lintian/Collect/Changes.pm
@@ -37,17 +37,17 @@ sub new {
 # sub files Needs-Info <>
 sub files {
     my ($self) = @_;
-    
+
     return $self->{files} if exists $self->{files};
-    
+
     my %files;
-    
-    my $file_list = $self->field('files') || '';    
+
+    my $file_list = $self->field('files') || '';
     for (split /\n/, $file_list) {
 	chomp;
 	s/^\s+//o;
 	next if $_ eq '';
-	
+
 	my ($md5sum,$size,$section,$priority,$file) = split(/\s+/o, $_);
 	next if $file =~ m,/,;
 
@@ -59,14 +59,14 @@ sub files {
 	$files{$file}{section} = $section;
 	$files{$file}{priority} = $priority;
     }
-    
+
     foreach my $alg (qw(sha1 sha256)) {
 	my $list = $self->field("checksums-$alg") || '';
 	for (split /\n/, $list) {
 	    chomp;
 	    s/^\s+//o;
 	    next if $_ eq '';
-	    
+
 	    my ($checksum, $size, $file) = split(/\s+/o, $_);
 	    next if $file =~ m,/,;
 
@@ -75,7 +75,7 @@ sub files {
 	    };
 	}
     }
-    
+
     $self->{files} = \%files;
     return $self->{files};
 }
diff --git a/lib/Lintian/Collect/Source.pm b/lib/Lintian/Collect/Source.pm
index 2a30ff6..810380b 100644
--- a/lib/Lintian/Collect/Source.pm
+++ b/lib/Lintian/Collect/Source.pm
@@ -153,7 +153,7 @@ sub file_info {
 
     my %file_info;
     # sub file_info Needs-Info file-info
-    open(my $idx, '<', "file-info") or fail("cannot open file-info: $!");
+    open(my $idx, '<', 'file-info') or fail("cannot open file-info: $!");
     while (<$idx>) {
         chomp;
         m/^(.+?)\x00\s+(.*)$/o or fail("cannot parse file output: $_");

-- 
Debian package checker


Reply to: