From d9c09384a348639c6ac0399e42e7a33cda8ee528 Mon Sep 17 00:00:00 2001 From: Raphael Hertzog Date: Thu, 3 Jan 2008 15:41:23 +0100 Subject: [PATCH] dpkg-shlibdeps: fix find_symbols_file to choose the right symbols file * scripts/dpkg-shlibdeps.pl (find_symbols_file): When libraries are found in non-packaged files, first try to find the corresponding symbols file in the build tree containing that library. On the opposite, don't look up symbols files in debian/* build directories for libraries found in installed packages (build trees are scanned first and thus if they contain a needed library dpkg-shlibdeps will find the library there and not in an installed package). --- ChangeLog | 11 +++++++++++ debian/changelog | 2 ++ scripts/dpkg-shlibdeps.pl | 26 +++++++++++++++++++------- 3 files changed, 32 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 69815525..862cec20 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2008-01-03 Raphael Hertzog + + * scripts/dpkg-shlibdeps.pl (find_symbols_file): When libraries + are found in non-packaged files, first try to find the + corresponding symbols file in the build tree containing that + library. On the opposite, don't look up symbols files in debian/* + build directories for libraries found in installed packages (build + trees are scanned first and thus if they contain a needed library + dpkg-shlibdeps will find the library there and not in an installed + package). + 2008-01-03 Guillem Jover * scripts/dpkg-buildpackage.pl: Do not automatically enable '-j' diff --git a/debian/changelog b/debian/changelog index 7b8f0246..38afc068 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,6 +6,8 @@ dpkg (1.14.15) UNRELEASED; urgency=low * Blacklist armel-specific symbols in dpkg-gensymbols. Reported by Riku Voipio. Closes: #457964 * Fix typos in various manpages. Patch from A. Costa. Closes: #458276 + * Make dpkg-shlibdeps choose the right symbols files when we have several + debian/*/DEBIAN/symbols for a given soname. Closes: #458860 [ Guillem Jover ] * Move compression related variables to a new Dpkg::Compression module. diff --git a/scripts/dpkg-shlibdeps.pl b/scripts/dpkg-shlibdeps.pl index 07d84581..8c7a6066 100755 --- a/scripts/dpkg-shlibdeps.pl +++ b/scripts/dpkg-shlibdeps.pl @@ -160,7 +160,7 @@ foreach my $file (keys %exec) { my $dpkg_symfile; if ($packagetype eq "deb") { # Use fine-grained dependencies only on real deb - $dpkg_symfile = find_symbols_file($pkg, $soname); + $dpkg_symfile = find_symbols_file($pkg, $soname, $lib); if (defined $dpkg_symfile) { # Load symbol information print "Using symbols file $dpkg_symfile for $soname\n" if $debug; @@ -520,12 +520,24 @@ sub extract_from_shlibs { } sub find_symbols_file { - my ($pkg, $soname) = @_; - foreach my $file (@pkg_symbols, - "/etc/dpkg/symbols/$pkg.symbols.$host_arch", - "/etc/dpkg/symbols/$pkg.symbols", - "$admindir/info/$pkg.symbols") - { + my ($pkg, $soname, $libfile) = @_; + my @files; + if ($pkg eq "") { + # If the file is not packaged, try to find out the symbols file in + # the package being built where the lib has been found + my $pkg_root = guess_pkg_root_dir($libfile); + if (defined $pkg_root) { + push @files, "$pkg_root/DEBIAN/symbols"; + } + # Fallback to other symbols files but it shouldn't be necessary + push @files, @pkg_symbols; + } else { + push @files, "/etc/dpkg/symbols/$pkg.symbols.$host_arch", + "/etc/dpkg/symbols/$pkg.symbols", + "$admindir/info/$pkg.symbols"; + } + + foreach my $file (@files) { if (-e $file and symfile_has_soname($file, $soname)) { return $file; } -- 2.39.5