Browse Source

Merge branch 'master' of ssh://git.debian.org/git/dpkg/dpkg

Javier Fernandez-Sanguino 15 years ago
parent
commit
5e702366cb
2 changed files with 20 additions and 5 deletions
  1. 3 0
      debian/changelog
  2. 17 5
      scripts/dpkg-shlibdeps.pl

+ 3 - 0
debian/changelog

@@ -22,6 +22,9 @@ dpkg (1.16.0) UNRELEASED; urgency=low
     - it documents the VCS-* fields too. Closes: #483119
     Thanks to Oxan van Leeuwen <oxan@oxanvanleeuwen.nl> who wrote it
     as part of the Google Code In program.
+  * Enhance dpkg-shlibdeps to not fail immediatly when a library is not found.
+    Instead continue and fail after all problems have been reported. Thanks
+    to Chris Baines <cbaines8@gmail.com> for the patch. Closes: #596841
 
   [ Updated programs translations ]
   * Portuguese (Miguel Figueiredo).

+ 17 - 5
scripts/dpkg-shlibdeps.pl

@@ -150,6 +150,9 @@ my %symfile_cache;
 my %objdump_cache;
 my %symfile_has_soname_cache;
 
+# Used to count errors due to missing libraries
+my $error_count = 0;
+
 my $cur_field;
 foreach my $file (keys %exec) {
     $cur_field = $exec{$file};
@@ -168,12 +171,11 @@ foreach my $file (keys %exec) {
 	unless (defined $lib) {
 	    $soname_notfound{$soname} = 1;
 	    $global_soname_notfound{$soname} = 1;
-	    my $msg = _g("couldn't find library %s needed by %s (ELF format: '%s'; RPATH: '%s').\n" .
-			 "Note: libraries are not searched in other binary packages " .
-			 "that do not have any shlibs or symbols file.\nTo help dpkg-shlibdeps " .
-			 "find private libraries, you might need to set LD_LIBRARY_PATH.");
+	    my $msg = _g("couldn't find library %s needed by %s (ELF " .
+			 "format: '%s'; RPATH: '%s').");
 	    if (scalar(split_soname($soname))) {
-		error($msg, $soname, $file, $obj->{format}, join(":", @{$obj->{RPATH}}));
+		errormsg($msg, $soname, $file, $obj->{format}, join(":", @{$obj->{RPATH}}));
+		$error_count++;
 	    } else {
 		warning($msg, $soname, $file, $obj->{format}, join(":", @{$obj->{RPATH}}));
 	    }
@@ -423,6 +425,16 @@ foreach my $soname (keys %global_soname_needed) {
     }
 }
 
+# Quit now if any missing libraries
+if ($error_count >= 1) {
+    my $note = _g("Note: libraries are not searched in other binary packages " .
+	"that do not have any shlibs or symbols file.\nTo help dpkg-shlibdeps " .
+	"find private libraries, you might need to set LD_LIBRARY_PATH.");
+    error(P_("Cannot continue due to the error above.",
+             "Cannot continue due to the errors listed above.",
+             $error_count) . "\n" . $note);
+}
+
 # Open substvars file
 my $fh;
 if ($stdout) {