From 45cc1441b376a3cf34b55256b9bda73472171fab Mon Sep 17 00:00:00 2001 From: Raphael Hertzog Date: Sun, 25 Nov 2007 15:54:20 +0000 Subject: [PATCH] dpkg-shlibdeps: do not fail if it can't find unversioned libraries Skip the check on symbols when some libs were not found because one can not be sure that the symbols was not provided by the missing library. Also improve the corresponding error message which is downgraded to a warning for unversioned libraries. --- ChangeLog | 8 ++++++++ debian/changelog | 3 +++ scripts/dpkg-shlibdeps.pl | 23 +++++++++++++++++++---- 3 files changed, 30 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6760adce..0f190ad5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2007-11-28 Raphael Hertzog + + * scripts/dpkg-shlibdeps.pl: Do not fail if it + can't find unversioned libraries, just output a warning. + Consequently skip the check on symbols when some libs were not + found because one can not be sure that the symbols was not + provided by the missing library. + 2007-11-28 Raphael Hertzog * scripts/dpkg-shlibdeps.pl (find_packages): Make sure to always diff --git a/debian/changelog b/debian/changelog index 8ef98fb4..bd5e498a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,6 +6,9 @@ dpkg (1.14.12) UNRELEASED; urgency=low * Dpkg::Shlibs::find_library() now returns canonicalized paths. * dpkg-shlibdeps always tries the realpath() of a lib as fallback when trying to identify the package of a lib (and not only for symlinks). + * dpkg-shlibdeps doesn't fail any more if it can't find unversioned + libraries on the presumption that they are just private libraries. Outputs + a warning instead. -- Guillem Jover Sat, 24 Nov 2007 07:38:13 +0200 diff --git a/scripts/dpkg-shlibdeps.pl b/scripts/dpkg-shlibdeps.pl index 420afafe..ce2caf43 100755 --- a/scripts/dpkg-shlibdeps.pl +++ b/scripts/dpkg-shlibdeps.pl @@ -97,11 +97,22 @@ foreach my $file (keys %exec) { # Load symbols files for all needed libraries (identified by SONAME) my %libfiles; my %altlibfiles; + my %soname_notfound; foreach my $soname (@sonames) { my $lib = my_find_library($soname, $obj->{RPATH}, $obj->{format}, $file); - failure(_g("couldn't find library %s (note: only packages with " . - "'shlibs' files are looked into)."), $soname) - unless defined($lib); + unless (defined $lib) { + $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 " . + "find private libraries, you might need to set LD_LIBRARY_PATH."); + if (scalar(split_soname($soname))) { + failure($msg, $soname, $file, join(":", @{$obj->{RPATH}})); + } else { + warning($msg, $soname, $file, join(":", @{$obj->{RPATH}})); + } + next; + } $libfiles{$lib} = $soname; my $reallib = realpath($lib); if ($reallib ne $lib) { @@ -187,6 +198,9 @@ foreach my $file (keys %exec) { my %used_sonames = map { $_ => 0 } @sonames; my $nb_warnings = 0; my $nb_skipped_warnings = 0; + # Disable warnings about missing symbols when we have not been able to + # find all libs + my $disable_warnings = scalar(keys(%soname_notfound)); foreach my $sym ($obj->get_undefined_dynamic_symbols()) { my $name = $sym->{name}; if ($sym->{version}) { @@ -214,6 +228,7 @@ foreach my $file (keys %exec) { } else { my $syminfo = $dumplibs_wo_symfile->locate_symbol($name); if (not defined($syminfo)) { + next if $disable_warnings; # Complain about missing symbols only for executables # and public libraries if ($obj->is_executable() or $obj->is_public_library()) { @@ -239,7 +254,7 @@ foreach my $file (keys %exec) { "them all)."), $nb_skipped_warnings) if $nb_skipped_warnings; # Warn about un-NEEDED libraries foreach my $soname (@sonames) { - unless ($used_sonames{$soname}) { + unless ($soname_notfound{$soname} or $used_sonames{$soname}) { warning(_g("%s shouldn't be linked with %s (it uses none of its " . "symbols)."), $file, $soname); } -- 2.39.5