Kaynağa Gözat

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 yıl önce
ebeveyn
işleme
9278a6af56
3 değiştirilmiş dosya ile 16 ekleme ve 8 silme
  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
 	trees are scanned first and thus if they contain a needed library
 	dpkg-shlibdeps will find the library there and not in an installed
 	dpkg-shlibdeps will find the library there and not in an installed
 	package).
 	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>
 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,
 standard public directories (/lib, /usr/lib, /lib32, /usr/lib32, /lib64,
 /usr/lib64). Then it checks those directories in the package's build tree
 /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
 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,
 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
 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 @exclude = ();
 my $host_arch = get_host_arch();
 my $host_arch = get_host_arch();
 
 
-my (@pkg_shlibs, @pkg_symbols);
+my (@pkg_shlibs, @pkg_symbols, @pkg_root_dirs);
 if (-d "debian") {
 if (-d "debian") {
     push @pkg_symbols, <debian/*/DEBIAN/symbols>;
     push @pkg_symbols, <debian/*/DEBIAN/symbols>;
     push @pkg_shlibs, <debian/*/DEBIAN/shlibs>;
     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);
 my ($stdout, %exec);
@@ -115,7 +117,7 @@ foreach my $file (keys %exec) {
 	    $soname_notfound{$soname} = 1;
 	    $soname_notfound{$soname} = 1;
 	    my $msg = _g("couldn't find library %s needed by %s (its RPATH is '%s').\n" .
 	    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 " .
 			 "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.");
 			 "find private libraries, you might need to set LD_LIBRARY_PATH.");
 	    if (scalar(split_soname($soname))) {
 	    if (scalar(split_soname($soname))) {
 		failure($msg, $soname, $file, join(":", @{$obj->{RPATH}}));
 		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
     # 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
     # TODO: we should probably replace that by a cleaner way to look into
     # the various temporary build directories...
     # the various temporary build directories...
-    my @copy = (@pkg_shlibs);
+    my @copy = (@pkg_root_dirs);
     my $pkg_root = guess_pkg_root_dir($execfile);
     my $pkg_root = guess_pkg_root_dir($execfile);
     unshift @copy, $pkg_root if defined $pkg_root;
     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);
 	$file = find_library($lib, \@RPATH, $format, $builddir);
 	return $file if defined($file);
 	return $file if defined($file);
     }
     }