From: Raphael Hertzog Date: Thu, 3 Jan 2008 15:05:54 +0000 (+0100) Subject: dpkg-shlibdeps: also search libs in package build trees containing symbols files X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9278a6af560f99611270f479686d15cf5c4e1b86;p=dpkg dpkg-shlibdeps: also search libs in package build trees containing symbols files * scripts/dpkg-shlibdeps.pl (my_find_library): When defining the list of package build trees to scan, also consider those that contain symbols files (instead of only considering those that have a shlibs file). * man/dpkg-shlibdeps.1: Document the change listed above. --- diff --git a/ChangeLog b/ChangeLog index 862cec20..e8670bf8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -8,6 +8,11 @@ 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). + * scripts/dpkg-shlibdeps.pl (my_find_library): When defining the + list of package build trees to scan, also consider those that + contain symbols files (instead of only considering those that have + a shlibs file). + * man/dpkg-shlibdeps.1: Document the change listed above. 2008-01-03 Guillem Jover diff --git a/man/dpkg-shlibdeps.1 b/man/dpkg-shlibdeps.1 index a54b3cde..21908968 100644 --- a/man/dpkg-shlibdeps.1 +++ b/man/dpkg-shlibdeps.1 @@ -242,8 +242,9 @@ directories listed in the LD_LIBRARY_PATH environment variable, and standard public directories (/lib, /usr/lib, /lib32, /usr/lib32, /lib64, /usr/lib64). Then it checks those directories in the package's build tree of the binary being analyzed, in other packages's build tree that contains -a DEBIAN/shlibs file and finally in the root directory. If the library is -not found in any of those directories, then you get this error. +a DEBIAN/shlibs or DEBIAN/symbols file and finally in the root directory. +If the library is not found in any of those directories, then you get this +error. If the library not found is in a private directory of the same package, then you want to add the directory to LD_LIBRARY_PATH. If it's in another diff --git a/scripts/dpkg-shlibdeps.pl b/scripts/dpkg-shlibdeps.pl index 8c7a6066..4bf8948b 100755 --- a/scripts/dpkg-shlibdeps.pl +++ b/scripts/dpkg-shlibdeps.pl @@ -40,10 +40,12 @@ my $debug = 0; my @exclude = (); my $host_arch = get_host_arch(); -my (@pkg_shlibs, @pkg_symbols); +my (@pkg_shlibs, @pkg_symbols, @pkg_root_dirs); if (-d "debian") { push @pkg_symbols, ; push @pkg_shlibs, ; + my %uniq = map { guess_pkg_root_dir($_) => 1 } (@pkg_symbols, @pkg_shlibs); + push @pkg_root_dirs, keys %uniq; } my ($stdout, %exec); @@ -115,7 +117,7 @@ foreach my $file (keys %exec) { $soname_notfound{$soname} = 1; my $msg = _g("couldn't find library %s needed by %s (its RPATH is '%s').\n" . "Note: libraries are not searched in other binary packages " . - "that do not have any shlibs file.\nTo help dpkg-shlibdeps " . + "that do not have any shlibs or symbols file.\nTo help dpkg-shlibdeps " . "find private libraries, you might need to set LD_LIBRARY_PATH."); if (scalar(split_soname($soname))) { failure($msg, $soname, $file, join(":", @{$obj->{RPATH}})); @@ -590,14 +592,14 @@ sub my_find_library { } # Look into the packages we're currently building (but only those - # that provides shlibs file and the one that contains the binary being - # anlyzed...) + # that provides shlibs/symbols file and the one that contains the + # binary being analyzed...) # TODO: we should probably replace that by a cleaner way to look into # the various temporary build directories... - my @copy = (@pkg_shlibs); + my @copy = (@pkg_root_dirs); my $pkg_root = guess_pkg_root_dir($execfile); unshift @copy, $pkg_root if defined $pkg_root; - foreach my $builddir (map { s{/DEBIAN/shlibs$}{}; $_ } @copy) { + foreach my $builddir (@copy) { $file = find_library($lib, \@RPATH, $format, $builddir); return $file if defined($file); }