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

[SCM] Debian package checker branch, master, updated. 2.4.3-250-gc10a385



The following commit has been merged in the master branch:
commit c10a385f8123fac4fd1f918c373fbc5af9fc3bbd
Author: Raphael Geissert <atomo64@gmail.com>
Date:   Sat Feb 19 20:23:23 2011 -0600

    Don't modify index entries
    
    A subtle reminder that foreach creates aliases instead of local copies
    of the list's elements.

diff --git a/checks/binaries b/checks/binaries
index 1ef2a72..c67d103 100644
--- a/checks/binaries
+++ b/checks/binaries
@@ -215,10 +215,13 @@ tag 'package-name-doesnt-match-sonames', "@sonames"
 my %directories;
 foreach (@{$info->sorted_index}) {
     next unless length $_;
-    my $ftype = $info->index->{$_}->{'type'};
+    # create copy, don't modify the index
+    my $path = $_;
+
+    my $ftype = $info->index->{$path}->{'type'};
     next unless ($ftype eq 'd' || $ftype eq 'l');
-    s,/\z,,;
-    $directories{"/$_"}++;
+    $path =~ s,/\z,,;
+    $directories{"/$path"}++;
 }
 
 # If we have an unknown architecture, pretend that all binaries are fine.

-- 
Debian package checker


Reply to: