diff options
author | Raphael Hertzog <hertzog@debian.org> | 2008-04-04 00:19:38 +0200 |
---|---|---|
committer | Raphael Hertzog <hertzog@debian.org> | 2008-04-04 00:19:38 +0200 |
commit | c87dde454cc53182afa4f373cebcb5c79e721531 (patch) | |
tree | 93b994a6725e56d5253ab71812e97e4dcdf1a0e7 /scripts/Dpkg | |
parent | 470ca21172f625934cb01036d317a6a944dd213e (diff) | |
download | dpkg-c87dde454cc53182afa4f373cebcb5c79e721531.tar.gz |
dpkg-shlibdeps: initialize dependencies differently
* scripts/Dpkg/Shlibs/SymbolFile.pm (get_smallest_version): New
function to retrieve the smallest "minver" of all symbols of a
given library.
* scripts/dpkg-shlibdeps.pl: Do not initialize dependencies of
libraries with symbols files as unversioned, instead use the
smallest minimal version returned by the function above. This
is required because the library might not have always been
available in the package and the unversioned dependency thus
doesn't ensure his presence.
* scripts/t/800_Dpkg_IPC.t: Remove temporary files used by the
tests.
Diffstat (limited to 'scripts/Dpkg')
-rw-r--r-- | scripts/Dpkg/Shlibs/SymbolFile.pm | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/scripts/Dpkg/Shlibs/SymbolFile.pm b/scripts/Dpkg/Shlibs/SymbolFile.pm index 5aac68103..7e068c662 100644 --- a/scripts/Dpkg/Shlibs/SymbolFile.pm +++ b/scripts/Dpkg/Shlibs/SymbolFile.pm @@ -304,6 +304,20 @@ sub get_dependency { return $self->{objects}{$soname}{deps}[$dep_id]; } +sub get_smallest_version { + my ($self, $soname, $dep_id) = @_; + $dep_id = 0 unless defined($dep_id); + my $minver; + foreach my $sym (values %{$self->{objects}{$soname}{syms}}) { + next if $dep_id != $sym->{dep_id}; + $minver ||= $sym->{minver}; + if (vercmp($minver, $sym->{minver}) > 0) { + $minver = $sym->{minver}; + } + } + return $minver; +} + sub get_dependencies { my ($self, $soname) = @_; return @{$self->{objects}{$soname}{deps}}; |