瀏覽代碼

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.
Raphael Hertzog 18 年之前
父節點
當前提交
9278a6af56
共有 3 個文件被更改,包括 16 次插入8 次删除
  1. 5 0
      ChangeLog
  2. 3 2
      man/dpkg-shlibdeps.1
  3. 8 6
      scripts/dpkg-shlibdeps.pl

+ 5 - 0
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  <guillem@debian.org>
 

+ 3 - 2
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

+ 8 - 6
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, <debian/*/DEBIAN/symbols>;
     push @pkg_shlibs, <debian/*/DEBIAN/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);
     }