The following commit has been merged in the master branch:
commit e411b5732dd76a157a50778ce96c81115b49332a
Author: Modestas Vainius <modes...@vainius.eu>
Date:   Wed Jul 15 19:38:45 2009 +0300

    Replace local with my in SymbolFile::load() and use strict.
    
    Rather than creating an alias with local, manually do $current_object_ref
    re-referencing. This allows to use 'my $object' and to enable 'use strict'.
    
    Signed-off-by: Modestas Vainius <modes...@vainius.eu>

diff --git a/scripts/Dpkg/Shlibs/SymbolFile.pm 
b/scripts/Dpkg/Shlibs/SymbolFile.pm
index 4355ce4..978815d 100644
--- a/scripts/Dpkg/Shlibs/SymbolFile.pm
+++ b/scripts/Dpkg/Shlibs/SymbolFile.pm
@@ -17,6 +17,8 @@
 
 package Dpkg::Shlibs::SymbolFile;
 
+use strict;
+use warnings;
 use Dpkg::Gettext;
 use Dpkg::ErrorHandling;
 use Dpkg::Version qw(vercmp);
@@ -139,7 +141,7 @@ sub load {
         my $obj;
         $current_object_ref = \$obj;
     }
-    local *object = $current_object_ref;
+    my $object = $$current_object_ref;
     while (defined($_ = <$sym_file>)) {
        chomp($_);
 
@@ -166,7 +168,7 @@ sub load {
                $new_base_symbol->parse_tagspec($tagspec);
            }
            $dir =~ s{[^/]+$}{}; # Strip filename
-           $self->load("$dir$filename", $seen, $current_object_ref, 
$new_base_symbol);
+           $self->load("$dir$filename", $seen, \$object, $new_base_symbol);
        } elsif (/^#/) {
            # Skip possible comments
        } elsif (/^\|\s*(.*)$/) {
@@ -177,7 +179,7 @@ sub load {
            $self->{objects}{$object}{fields}{capit($1)} = $2;
        } elsif (/^(\S+)\s+(.*)$/) {
            # New object and dependency template
-           $object = $1;
+           $$current_object_ref = $object = $1;
            if (exists $self->{objects}{$object}) {
                # Update/override infos only
                $self->{objects}{$object}{deps} = [ "$2" ];

-- 
dpkg's main repository


-- 
To UNSUBSCRIBE, email to debian-dpkg-cvs-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to