The following commit has been merged in the master branch:
commit 7c02a2ed867b18fba61bffaa4402dd2db230c9bc
Author: Modestas Vainius <[email protected]>
Date:   Tue Feb 2 23:58:24 2010 +0200

    Dpkg::Shlibs::SymbolFile::add_symbol() reverse $sym, $soname argument order.
    
    This makes order consistent with lookup_{symbol,pattern}.

diff --git a/scripts/Dpkg/Shlibs/SymbolFile.pm 
b/scripts/Dpkg/Shlibs/SymbolFile.pm
index 4a1dc7e..edc30ab 100644
--- a/scripts/Dpkg/Shlibs/SymbolFile.pm
+++ b/scripts/Dpkg/Shlibs/SymbolFile.pm
@@ -115,7 +115,7 @@ sub create_symbol {
 }
 
 sub add_symbol {
-    my ($self, $soname, $symbol) = @_;
+    my ($self, $symbol, $soname) = @_;
     my $object = (ref $soname) ? $soname : $self->{objects}{$soname};
 
     if ($symbol->is_pattern()) {
@@ -174,7 +174,7 @@ sub load {
            my $deprecated = ($1) ? $1 : 0;
            my $sym = new_symbol($base_symbol, deprecated => $deprecated);
            if ($self->create_symbol($2, $sym)) {
-               $self->add_symbol($$obj_ref, $sym);
+               $self->add_symbol($sym, $$obj_ref);
            } else {
                warning(_g("Failed to parse line in %s: %s"), $file, $_);
            }
@@ -215,7 +215,6 @@ sub load {
     delete $seen->{$file};
 }
 
-
 # Beware: we reuse the data structure of the provided symfile so make
 # sure to not modify them after having called this function
 sub merge_object_from_symfile {
@@ -386,7 +385,7 @@ sub merge_symbols {
                $sym = Dpkg::Shlibs::Symbol->new(symbol => $name,
                                                 minver => $minver);
            }
-           $self->add_symbol($obj, $sym);
+           $self->add_symbol($sym, $obj);
        }
     }
 
diff --git a/scripts/t/200_Dpkg_Shlibs.t b/scripts/t/200_Dpkg_Shlibs.t
index 302a2c8..207481f 100644
--- a/scripts/t/200_Dpkg_Shlibs.t
+++ b/scripts/t/200_Dpkg_Shlibs.t
@@ -146,7 +146,7 @@ is_deeply($sym, Dpkg::Shlibs::Symbol->new( 'symbol' => 
'_er...@glibc_2.0',
 
 # Wildcard test
 my $pat = $sym_file_old->create_symbol('*...@glibc_private 2.3.6.wildcard');
-$sym_file_old->add_symbol('libc.so.6', $pat);
+$sym_file_old->add_symbol($pat, 'libc.so.6');
 $sym_file_old->merge_symbols($obj, "2.6-1");
 $sym = $sym_file_old->lookup_symbol('__nss_services_loo...@glibc_private', 
['libc.so.6']);
 is_deeply($sym, Dpkg::Shlibs::Symbol->new( 'symbol' => 
'__nss_services_loo...@glibc_private',

-- 
dpkg's main repository


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to