Author: hertzog
Date: 2007-07-15 10:55:09 +0000 (Sun, 15 Jul 2007)
New Revision: 872

Modified:
   branches/dpkg-shlibdeps-buxy/scripts/Dpkg/Shlibs/SymbolFile.pm
   branches/dpkg-shlibdeps-buxy/scripts/t/200_Dpkg_Shlibs.t
Log:
* Define $foo->has_lost_symbols($ref) as $ref->has_new_symbols($foo).
* Same for has_lost_libs.
* Fixed improper usage of File::Temp object in a non-regression test.


Modified: branches/dpkg-shlibdeps-buxy/scripts/Dpkg/Shlibs/SymbolFile.pm
===================================================================
--- branches/dpkg-shlibdeps-buxy/scripts/Dpkg/Shlibs/SymbolFile.pm      
2007-07-14 20:55:52 UTC (rev 871)
+++ branches/dpkg-shlibdeps-buxy/scripts/Dpkg/Shlibs/SymbolFile.pm      
2007-07-15 10:55:09 UTC (rev 872)
@@ -201,25 +201,6 @@
     return undef;
 }
 
-sub has_lost_symbols {
-    my ($self, $ref) = @_;
-    foreach my $soname (keys %{$self->{objects}}) {
-       my $mysyms = $self->{objects}{$soname}{syms};
-       next if not exists $ref->{objects}{$soname};
-       my $refsyms = $ref->{objects}{$soname}{syms};
-       foreach my $sym (grep { not $refsyms->{$_}{deprecated} }
-           keys %{$refsyms})
-       {
-           if ((not exists $mysyms->{$sym}) or
-               $mysyms->{$sym}{deprecated})
-           {
-               return 1;
-           }
-       }
-    }
-    return 0;
-}
-
 sub has_new_symbols {
     my ($self, $ref) = @_;
     foreach my $soname (keys %{$self->{objects}}) {
@@ -239,6 +220,12 @@
     return 0;
 }
 
+sub has_lost_symbols {
+    my ($self, $ref) = @_;
+    return $ref->has_new_symbols($self);
+}
+
+
 sub has_new_libs {
     my ($self, $ref) = @_;
     foreach my $soname (keys %{$self->{objects}}) {
@@ -249,10 +236,7 @@
 
 sub has_lost_libs {
     my ($self, $ref) = @_;
-    foreach my $soname (keys %{$ref->{objects}}) {
-       return 1 if not exists $self->{objects}{$soname};
-    }
-    return 0;
+    return $ref->has_new_libs($self);
 }
 
 1;

Modified: branches/dpkg-shlibdeps-buxy/scripts/t/200_Dpkg_Shlibs.t
===================================================================
--- branches/dpkg-shlibdeps-buxy/scripts/t/200_Dpkg_Shlibs.t    2007-07-14 
20:55:52 UTC (rev 871)
+++ branches/dpkg-shlibdeps-buxy/scripts/t/200_Dpkg_Shlibs.t    2007-07-15 
10:55:09 UTC (rev 872)
@@ -78,9 +78,9 @@
 
 my $save_file = new File::Temp;
 
-$sym_file->save($save_file);
+$sym_file->save($save_file->filename);
 
-$sym_file_dup->load($save_file);
+$sym_file_dup->load($save_file->filename);
 $sym_file_dup->{file} = "t/200_Dpkg_Shlibs/symbol_file.tmp";
 
 is_deeply($sym_file_dup, $sym_file, 'save -> load' );


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

Reply via email to