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

[SCM] Debian package checker branch, master, updated. 2.5.8-4-g80d611f



The following commit has been merged in the master branch:
commit 80d611f81ad2aa2d092fc6d85e533c3593b0b436
Author: Niels Thykier <niels@thykier.net>
Date:   Mon Jun 4 20:36:00 2012 +0200

    L::Collect::P: Make sorted_index return a list
    
    As all (except one) caller of sorted_index immediately derefs the list
    ref to a list, move the deref'ing into sorted_index (altering its
    return type).
    
    Signed-off-by: Niels Thykier <niels@thykier.net>

diff --git a/checks/apache2 b/checks/apache2
index 3e4a027..81dc52c 100644
--- a/checks/apache2
+++ b/checks/apache2
@@ -43,7 +43,7 @@ sub run {
     my $seen_apache2_special_file = 0;
 
     if ($type eq 'binary') {
-        foreach my $file (@{ $info->sorted_index }) {
+        foreach my $file ($info->sorted_index) {
             next if $file eq '';
             my $file_info = $info->index->{$file};
 
diff --git a/checks/binaries b/checks/binaries
index 67eb5a8..9769401 100644
--- a/checks/binaries
+++ b/checks/binaries
@@ -202,7 +202,7 @@ tag 'package-name-doesnt-match-sonames', "@sonames"
     if @sonames && !$match_found;
 
 my %directories;
-foreach (@{$info->sorted_index}) {
+foreach ($info->sorted_index) {
     next unless length $_;
     # create copy, don't modify the index
     my $path = $_;
@@ -214,7 +214,7 @@ foreach (@{$info->sorted_index}) {
 }
 
 # process all files in package
-foreach my $file (@{$info->sorted_index}) {
+foreach my $file ($info->sorted_index) {
     my $fileinfo = $info->file_info->{$file};
     my $objdump = $info->objdump_info->{$file};
 
diff --git a/checks/changelog-file b/checks/changelog-file
index 514dd48..b24cb0c 100644
--- a/checks/changelog-file
+++ b/checks/changelog-file
@@ -51,7 +51,7 @@ return 0 if $info->index->{"usr/share/doc/$pkg"} and
 
 
 # Modify the file_info by following symbolic links.
-for my $file (@{$info->sorted_index}) {
+for my $file ($info->sorted_index) {
     next unless $file =~ m/doc/o;
 
     $file_info{$file} = $info->file_info->{$file};
@@ -83,7 +83,7 @@ for my $file (@{$info->sorted_index}) {
 }
 
 # Read package contents....  Capitalization errors are dealt with later.
-foreach (@{$info->sorted_index}) {
+foreach ($info->sorted_index) {
     next unless length $_;
 
     # we are only interested in files or symlinks in /usr/(share/)?doc/$pkg
diff --git a/checks/conffiles b/checks/conffiles
index 0da3432..78f1fc8 100644
--- a/checks/conffiles
+++ b/checks/conffiles
@@ -74,7 +74,7 @@ if (-f $cf) {
 }
 
 # Read package contents...
-foreach my $file (@{$info->sorted_index}) {
+foreach my $file ($info->sorted_index) {
     my $index_info = $info->index->{$file};
     next unless $file =~ m,^etc, and $index_info->{type}=~ m/^[-h]/;
 
diff --git a/checks/duplicate-files b/checks/duplicate-files
index a4e15d0..ea0e919 100644
--- a/checks/duplicate-files
+++ b/checks/duplicate-files
@@ -32,7 +32,7 @@ my $info = shift;
 
 my %hashmap;
 
-foreach my $file (@{ $info->sorted_index }){
+foreach my $file ($info->sorted_index){
     my $md5 = $info->md5sums->{$file};
     my $fs;
     next unless defined $md5;
diff --git a/checks/fields b/checks/fields
index 38548e2..bcd52df 100644
--- a/checks/fields
+++ b/checks/fields
@@ -521,7 +521,7 @@ if (defined $info->field('installer-menu-item')) {
 my $metapackage = 0;
 if ($type eq 'binary') {
     $metapackage = 1;
-    for my $file (@{$info->sorted_index}) {
+    for my $file ($info->sorted_index) {
         next if $info->index->{$file}->{type} =~ /^d/;
         next if $file =~ m%^usr/share/doc/%;
         next if $file =~ m%^usr/share/lintian/overrides/%;
diff --git a/checks/files b/checks/files
index a801adf..01b4430 100644
--- a/checks/files
+++ b/checks/files
@@ -229,7 +229,7 @@ if (!$is_dummy && $description) {
 }
 if (!$is_dummy) {
     my $is_empty = 1;
-    for my $file (@{$info->sorted_index}) {
+    for my $file ($info->sorted_index) {
         # Ignore directories
         unless ($file =~ m,/$,) {
             # Skip if $file is an empty string
@@ -260,7 +260,7 @@ if (!$is_dummy) {
 }
 
 # Read package contents...
-foreach my $file (@{$info->sorted_index}) {
+foreach my $file ($info->sorted_index) {
     next if $file eq '';
     my $index_info = $info->index->{$file};
     my $owner = $index_info->{owner} . '/' . $index_info->{group};
@@ -1382,7 +1382,7 @@ if ($pkg_section !~ m,games$, and $games > 0 and $other == 0) {
 #
 # python-support needs a directory for each package even it might be empty
 if($pkg ne 'base-files'){
-    foreach my $dir (@{$info->sorted_index}) {
+    foreach my $dir ($info->sorted_index) {
         next if $dir eq '' or $info->index->{$dir}->{type} ne 'd';
         next if ($dir =~ m{^var/} or $dir =~ m{^etc/});
         if (dir_counts($info, $dir) == 0) {
diff --git a/checks/group-checks b/checks/group-checks
index 018ef55..3a5be77 100644
--- a/checks/group-checks
+++ b/checks/group-checks
@@ -135,7 +135,7 @@ sub _check_file_overlap {
 sub _overlap_check {
     my ($a_proc, $a_info, $b_proc, $b_info) = @_;
     my $b_index = $b_info->index;
-    foreach my $raw (@{ $a_info->sorted_index }) {
+    foreach my $raw ($a_info->sorted_index) {
         my $file;
         my $a_file;
         my $b_file;
diff --git a/checks/infofiles b/checks/infofiles
index e75dcea..b0b20d9 100644
--- a/checks/infofiles
+++ b/checks/infofiles
@@ -35,7 +35,7 @@ my $type = shift;
 my $info = shift;
 
 # Read package contents...
-foreach my $file (@{$info->sorted_index}) {
+foreach my $file ($info->sorted_index) {
     my $index_info = $info->index->{$file};
     my $file_info = $info->file_info->{$file};
     my $link = $index_info->{link} || '';
diff --git a/checks/java b/checks/java
index 2b7a5b9..d29c161 100644
--- a/checks/java
+++ b/checks/java
@@ -163,7 +163,7 @@ if($has_jars && $need_cp) {
 
 if(! $has_public_jars && $pkg =~ /^lib[^\s,]+-java$/) {
     # Skip this if it installs a symlink in usr/share/java
-    return if grep m@^usr/share/java/[^/]+\.jar$@o, @{ $info->sorted_index };
+    return if grep m@^usr/share/java/[^/]+\.jar$@o, $info->sorted_index;
     tag 'javalib-but-no-public-jars';
 }
 
diff --git a/checks/manpages b/checks/manpages
index ade6260..5031c88 100644
--- a/checks/manpages
+++ b/checks/manpages
@@ -45,7 +45,7 @@ my %link;
 my %manpage;
 
 # Read package contents...
-foreach my $file (@{$info->sorted_index}) {
+foreach my $file ($info->sorted_index) {
     my $index_info = $info->index->{$file};
     my $file_info = $info->file_info->{$file};
     my $link = $index_info->{link} || '';
@@ -329,7 +329,7 @@ foreach my $file (@{$info->sorted_index}) {
 foreach my $depproc (@{ $ginfo->direct_dependencies ($proc) }) {
     # Find the manpages in our related dependencies
     my $depinfo = $depproc->info();
-    foreach my $file (@{ $depinfo->sorted_index() }){
+    foreach my $file ($depinfo->sorted_index){
         next if $file eq '';
         my $index_info = $depinfo->index->{$file};
         my $perm = $index_info->{type};
diff --git a/checks/md5sums b/checks/md5sums
index 1538e31..e6ed2f1 100644
--- a/checks/md5sums
+++ b/checks/md5sums
@@ -60,7 +60,7 @@ unless (-f $control) {
     # for conffiles since this information would
     # be redundant
     my $only_conffiles = 1;
-    foreach my $file (@{ $info->sorted_index }) {
+    foreach my $file ($info->sorted_index) {
         # Skip non-files, they will not appear in the md5sums file
         next if !$file or $info->index->{$file}->{type} ne '-';
         unless ($conffile{$file}) {
diff --git a/checks/menu-format b/checks/menu-format
index 4c13843..d0d8acd 100644
--- a/checks/menu-format
+++ b/checks/menu-format
@@ -341,7 +341,7 @@ closedir MENUDIR;
 
 # Find the desktop files in the package for verification.
 my @desktop_files;
-foreach my $file (@{$info->sorted_index}) {
+foreach my $file ($info->sorted_index) {
     my $index_info = $info->index->{$file};
     my $operm = $index_info->{operm};
 
diff --git a/checks/menus b/checks/menus
index 4dcfd18..8a0304c 100644
--- a/checks/menus
+++ b/checks/menus
@@ -84,7 +84,7 @@ if (-f $info->control('postrm')) {
 }
 
 # read package contents
-for my $file (@{$info->sorted_index}) {
+for my $file ($info->sorted_index) {
     next if $file eq '';
 
     add_file_link_info ($info, $file, \%all_files, \%all_links);
diff --git a/checks/ocaml b/checks/ocaml
index f852ec8..26d4eb7 100644
--- a/checks/ocaml
+++ b/checks/ocaml
@@ -80,7 +80,7 @@ my $dev_prefix;
 # does the package provide a META file?
 my $has_meta = 0;
 
-foreach my $file (@{$info->sorted_index}) {
+foreach my $file ($info->sorted_index) {
     my $fileinfo = $info->file_info->{$file};
 
     # For each .cmxa file, there must be a matching .a file (#528367)
diff --git a/checks/scripts b/checks/scripts
index 545992e..07eb7b7 100644
--- a/checks/scripts
+++ b/checks/scripts
@@ -202,7 +202,7 @@ my $pkg = shift;
 my $type = shift;
 my $info = shift;
 
-foreach my $file (@{$info->sorted_index}) {
+foreach my $file ($info->sorted_index) {
     next if $file eq '';
     $ELF{$file} = 1 if $info->file_info->{$file} =~ /^[^,]*\bELF\b/o;
 
@@ -980,7 +980,7 @@ for my $divert (keys %added_diversions) {
 
     if ($expand_diversions) {
         tag 'diversion-for-unknown-file', $divert, "$script:$line"
-            unless (grep { $_ =~ m/$divertrx/ } @{$info->sorted_index});
+            unless (grep { $_ =~ m/$divertrx/ } $info->sorted_index);
     } else {
         tag 'diversion-for-unknown-file', $divert, "$script:$line"
             unless (exists $info->index->{$divert});
diff --git a/checks/shared-libs b/checks/shared-libs
index ace9bb2..1d14ece 100644
--- a/checks/shared-libs
+++ b/checks/shared-libs
@@ -77,7 +77,7 @@ foreach my $file (sort keys %{$objdump}) {
         if defined $objdump->{$file}->{SONAME};
 }
 
-foreach my $file (@{$info->sorted_index}) {
+foreach my $file ($info->sorted_index) {
     next unless length $file;
     my $fileinfo = $info->file_info->{$file};
     if ($fileinfo =~ m/^[^,]*\bELF\b/ && $fileinfo =~ m/shared object/) {
@@ -96,7 +96,7 @@ if (%SONAME) {
 
 # 2nd step: read package contents
 
-for my $cur_file (@{$info->sorted_index}) {
+for my $cur_file ($info->sorted_index) {
     # shared library?
     my $cur_file_data = $info->index->{$cur_file};
 
diff --git a/checks/symlinks b/checks/symlinks
index 7591e97..f37bd51 100644
--- a/checks/symlinks
+++ b/checks/symlinks
@@ -39,7 +39,7 @@ my $index = $info->index;
 my @brokenlinks;
 my @dindexes;
 
-foreach my $file (@{$info->sorted_index}) {
+foreach my $file ($info->sorted_index) {
     my $index_info = $index->{$file};
     my $perm = $index_info->{type};
     if ($perm =~ m/^l/o){
diff --git a/collection/ar-info b/collection/ar-info
index e12195f..4e2c103 100755
--- a/collection/ar-info
+++ b/collection/ar-info
@@ -42,7 +42,7 @@ open OUT, '>', "$dir/ar-info"
 chdir ("$dir/unpacked")
     or fail("cannot chdir to unpacked directory: $!");
 
-foreach my $file (@{ $info->sorted_index }) {
+foreach my $file ($info->sorted_index) {
     next unless $file =~ m/\.a$/;
     next unless -f $file and not -l $file;
 
diff --git a/collection/file-info b/collection/file-info
index ab5436a..075c470 100755
--- a/collection/file-info
+++ b/collection/file-info
@@ -58,7 +58,7 @@ my %opts = ( pipe_in => FileHandle->new,
 spawn(\%opts, ['xargs', '-0r', 'file', '-NF', '', '--print0', '--'], '|', [$helper], '|', ['gzip', '--best', '-c']);
 $opts{pipe_in}->blocking(1);
 
-foreach my $file (@{ $info->sorted_index }) {
+foreach my $file ($info->sorted_index) {
     next unless $file; # ignore "root-dir" which has "no name" (post stripping).
     printf {$opts{pipe_in}} "%s\0", $file;
 }
diff --git a/collection/java-info b/collection/java-info
index c4f69bd..ecaca09 100755
--- a/collection/java-info
+++ b/collection/java-info
@@ -49,7 +49,7 @@ my %opts;
 chdir ("$dir/unpacked")
     or fail "unable to chdir to unpacked: $!";
 
-foreach my $file (@{ $info->sorted_index }) {
+foreach my $file ($info->sorted_index) {
     my $ftype = $info->index->{$file}->{type};
     next unless $ftype eq '-' or $ftype eq 'h';
     if ($file =~ m#\S+\.jar$#i) {
diff --git a/collection/md5sums b/collection/md5sums
index 7d9b4d2..262c5d6 100755
--- a/collection/md5sums
+++ b/collection/md5sums
@@ -46,7 +46,7 @@ my %opts = ( pipe_in => FileHandle->new,
 spawn(\%opts, ['xargs', '-0r', 'md5sum'] );
 $opts{pipe_in}->blocking(1);
 
-foreach my $file (@{ $info->sorted_index }) {
+foreach my $file ($info->sorted_index) {
     next unless $file;
     next unless $info->index->{$file}->{type} =~ m/^[-h]/;
     printf {$opts{pipe_in}} "%s\0", $file;
diff --git a/collection/objdump-info b/collection/objdump-info
index 57edc4f..92bff6b 100755
--- a/collection/objdump-info
+++ b/collection/objdump-info
@@ -54,7 +54,7 @@ $opts{pipe_in}->blocking(1);
 chdir ("$dir/unpacked")
     or fail ("unable to chdir to unpacked: $!\n");
 
-foreach my $bin (@{ $info->sorted_index }) {
+foreach my $bin ($info->sorted_index) {
     my $finfo = $file_info->{$bin};
 
     if ($finfo =~ m/^\bELF\b/) {
diff --git a/collection/scripts b/collection/scripts
index 8c6fbcb..7a7abd4 100755
--- a/collection/scripts
+++ b/collection/scripts
@@ -35,7 +35,7 @@ my $file;
 my $magic;
 my $scriptpath;
 
-foreach my $file (@{ $info->sorted_index }) {
+foreach my $file ($info->sorted_index) {
     next unless $info->index->{$file}->{type} eq '-';
 
     # This used to call fail() instead of next.  However, the check to
diff --git a/debian/changelog b/debian/changelog
index b1a9551..6378727 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -9,10 +9,14 @@ lintian (2.5.9) UNRELEASED; urgency=low
       dev-pkg-without-shlib-symlink false positives.  Thanks to
       Aurelien Jarno and Stephen M. Webb for the report and the
       patch.  (Closes: #675826, #675832)
+
   * debian/changelog:
     + [NT] raster-image-in-scalable-directory was added in 2.5.7,
       not removed.
 
+  * lib/Lintian/Package/Source.pm:
+    + [NT] sorted_index now returns a list rather than a list ref.
+
  -- Niels Thykier <niels@thykier.net>  Tue, 29 May 2012 13:19:07 +0200
 
 lintian (2.5.8) unstable; urgency=low
diff --git a/lib/Lintian/Collect/Package.pm b/lib/Lintian/Collect/Package.pm
index c295275..545b864 100644
--- a/lib/Lintian/Collect/Package.pm
+++ b/lib/Lintian/Collect/Package.pm
@@ -76,12 +76,12 @@ sub sorted_index {
     my ($self) = @_;
     my $index;
     my @result;
-    return $self->{sorted_index} if exists $self->{sorted_index};
+    return @{ $self->{sorted_index} } if exists $self->{sorted_index};
     $index = $self->index();
     @result = sort keys %{$index};
     shift @result if scalar @result && $result[0] eq '';
     $self->{sorted_index} = \@result;
-    return \@result;
+    return @result;
 }
 
 

-- 
Debian package checker


Reply to: