From 640058da507e8e379989d5a156c465c1af743279 Mon Sep 17 00:00:00 2001 From: Raphael Hertzog Date: Fri, 23 Nov 2007 15:59:17 +0100 Subject: [PATCH] dpkg-shlibdeps: limit the number of warnings displayed limit the number of warnings displayed about symbols not found in libraries to 10 per binary. --- ChangeLog | 5 +++++ debian/changelog | 2 ++ scripts/dpkg-shlibdeps.pl | 16 +++++++++++++--- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index e1b30bf3..93b370bc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-11-23 Raphael Hertzog + + * scripts/dpkg-shlibdeps.pl: Limit the number of warnings + displayed about symbols not found in libraries to 10 per binary. + 2007-11-23 Raphael Hertzog * scripts/dpkg-shlibdeps.pl: Look for libs in the package's build diff --git a/debian/changelog b/debian/changelog index 67018737..3634d4b5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,8 @@ dpkg (1.14.11) UNRELEASED; urgency=low specific cases (instead of failing): - when the library is in the same package than the binary analyzed - when the library is not versionned and can't have a shlibs file + * dpkg-shlibdeps now only displays 10 warnings about symbols not found for + each binary and a count of skipped warnings. Closes: #452318 -- Guillem Jover Fri, 23 Nov 2007 06:50:02 +0200 diff --git a/scripts/dpkg-shlibdeps.pl b/scripts/dpkg-shlibdeps.pl index 72230349..4ed07351 100755 --- a/scripts/dpkg-shlibdeps.pl +++ b/scripts/dpkg-shlibdeps.pl @@ -184,6 +184,8 @@ foreach my $file (keys %exec) { # Scan all undefined symbols of the binary and resolve to a # dependency my %used_sonames = map { $_ => 0 } @sonames; + my $nb_warnings = 0; + my $nb_skipped_warnings = 0; foreach my $sym ($obj->get_undefined_dynamic_symbols()) { my $name = $sym->{name}; if ($sym->{version}) { @@ -217,15 +219,23 @@ foreach my $file (keys %exec) { my $print_name = $name; # Drop the default suffix for readability $print_name =~ s/\@Base$//; - warning(_g("symbol %s used by %s found in none of the " . - "libraries."), $print_name, $file) - unless $sym->{weak}; + unless ($sym->{weak}) { + if ($debug or $nb_warnings < 10) { + warning(_g("symbol %s used by %s found in none of the " . + "libraries."), $print_name, $file); + $nb_warnings++; + } else { + $nb_skipped_warnings++; + } + } } } else { $used_sonames{$syminfo->{soname}}++; } } } + warning(_g("%d other similar warnings have been skipped (use -v to see " . + "them all)."), $nb_skipped_warnings) if $nb_skipped_warnings; # Warn about un-NEEDED libraries foreach my $soname (@sonames) { unless ($used_sonames{$soname}) { -- 2.39.5