+2008-04-04 Raphael Hertzog <hertzog@debian.org>
+
+ * 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.
+
2008-04-02 Sven Joachim <svenjoac@gmx.de>
* lib/triglib.c (trk_unknown_interest_change): Fix typo.
* Ensure the Files field is last in *.dsc and *.changes. This is a
work-around for some braindead dsc parsers (dupload and sbuild for
instance, see #473518 and #470440).
+ * Initialize dependencies for libraries having symbols files with the
+ smallest minimal version listed in the symbols file instead of using
+ an unversioned dependency. It's the only way to ensure the library
+ presence if it wasn't available in all versions of the package that ever
+ existed. Closes: #474079
[ Updated dselect translations ]
* German. (Sven Joachim).
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}};
}
}
if (defined($dpkg_symfile) && $symfile->has_object($soname)) {
- # Initialize dependencies as an unversioned dependency
+ # Initialize dependencies with the smallest minimal version
+ # of all symbols (unversioned dependency is not ok as the
+ # library might not have always been available in the
+ # package and we really need it)
my $dep = $symfile->get_dependency($soname);
+ my $minver = $symfile->get_smallest_version($soname) || '';
foreach my $subdep (split /\s*,\s*/, $dep) {
if (not exists $dependencies{$cur_field}{$subdep}) {
- $dependencies{$cur_field}{$subdep} = '';
+ $dependencies{$cur_field}{$subdep} = $minver;
}
}
} else {
my $string2;
open TMP, '>', $tmp_name;
-print TMP $string;;
+print TMP $string;
close TMP;
my $pid = fork_and_exec(exec => "cat",
close TMP;
is($string2, $string, "{from,to}_file");
+
+unlink($tmp_name);
+unlink($tmp2_name);