浏览代码

dpkg-shlibdeps: don't fail on binaries outside of a package's dir

Dpkg 1.15.0 introduced a regression by trying to deduce the target
directory in order to adjust some warnings. This check failed when
dpkg-shlibdeps was run on files not (yet) installed in the package's
directory (debian/package/). Fix that and emit a warning so that
maintainers are encouraged to analyze the binaries once they have
been installed in their target directory.
Raphael Hertzog 17 年之前
父节点
当前提交
5fd387999d
共有 2 个文件被更改,包括 10 次插入2 次删除
  1. 2 0
      debian/changelog
  2. 8 2
      scripts/dpkg-shlibdeps.pl

+ 2 - 0
debian/changelog

@@ -6,6 +6,8 @@ dpkg (1.15.1) UNRELEASED; urgency=low
     quilt).
   * Call quilt only once to apply all patches instead of once per patch
     when building 3.0 (quilt) source packages. Closes: #518453
+  * Fix dpkg-shlibdeps so that it works again when analyzing binaries
+    outside of package's directory. Closes: #518687
 
   [ Updated dselect translations ]
   * German (Sven Joachim).

+ 8 - 2
scripts/dpkg-shlibdeps.pl

@@ -280,8 +280,14 @@ foreach my $file (keys %exec) {
     # Disable warnings about missing symbols when we have not been able to
     # find all libs
     my $disable_warnings = scalar(keys(%soname_notfound));
-    my $parent_dir = "/" . dirname(relative_to_pkg_root($file));
-    my $in_public_dir = (grep { $parent_dir eq $_ } @librarypaths) ? 1 : 0;
+    my $in_public_dir = 1;
+    if (my $relname = relative_to_pkg_root($file)) {
+        my $parent_dir = "/" . dirname($relname);
+        $in_public_dir = (grep { $parent_dir eq $_ } @librarypaths) ? 1 : 0;
+    } else {
+        warning(_g("binaries to analyze should already be " .
+                   "installed in their package's directory."));
+    }
     foreach my $sym ($obj->get_undefined_dynamic_symbols()) {
 	my $name = $sym->{name};
 	if ($sym->{version}) {