Browse Source

dpkg-shlibdeps: Initialize with correct minimum version from a symbols file

When initializing the minimum version for a dependency, we have to use
the greater one from any SONAME present in that symbols file, because
the shared libraries might not have been available before that version
for example.

This also guarantees a reproducible output, as the minimum version
selected is not dependant on the hash order.

Closes: #764721

[guillem@debian.org:
 - Reword debugging message. ]

Signed-off-by: Guillem Jover <guillem@debian.org>
Jérémy Bobbio 11 years ago
parent
commit
51c55641fb
2 changed files with 6 additions and 7 deletions
  1. 3 0
      debian/changelog
  2. 3 7
      scripts/dpkg-shlibdeps.pl

+ 3 - 0
debian/changelog

@@ -13,6 +13,9 @@ dpkg (1.17.17) UNRELEASED; urgency=low
   * Add missing imports from Dpkg::BuildProfiles in dpkg-genchanges.
     Regression introduced in dpkg 1.17.14. Closes: #764216
     Reported by Johannes Schauer <j.schauer@email.de>.
+  * Initialize dependencies with the correct minimum version from a symbols
+    file with multiple SONAMEs in dpkg-shlibdeps.
+    Thanks to Jérémy Bobbio <lunar@debian.org>. Closes: #764721
 
   [ Updated programs translations ]
   * German (Sven Joachim).

+ 3 - 7
scripts/dpkg-shlibdeps.pl

@@ -255,13 +255,9 @@ foreach my $file (keys %exec) {
                 # 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} = Dpkg::Version->new($minver);
-                        print " Initialize dependency ($subdep) with minimal " .
-                              "version ($minver)\n" if $debug > 1;
-		    }
-		}
+		update_dependency_version($dep, $minver);
+		print " Minimal version of ($dep) initialized with ($minver)\n"
+		    if $debug > 1;
 	    } else {
 		# No symbol file found, fall back to standard shlibs
                 print "Using shlibs+objdump for $soname (file $lib)\n" if $debug;