Explorar el Código

dpkg-shlibdeps: limit the number of warnings displayed

limit the number of warnings displayed about symbols not found in
libraries to 10 per binary.
Raphael Hertzog hace 18 años
padre
commit
640058da50
Se han modificado 3 ficheros con 20 adiciones y 3 borrados
  1. 5 0
      ChangeLog
  2. 2 0
      debian/changelog
  3. 13 3
      scripts/dpkg-shlibdeps.pl

+ 5 - 0
ChangeLog

@@ -1,3 +1,8 @@
+2007-11-23  Raphael Hertzog  <hertzog@debian.org>
+
+	* 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  <hertzog@debian.org>
 
 	* scripts/dpkg-shlibdeps.pl: Look for libs in the package's build

+ 2 - 0
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 <guillem@debian.org>  Fri, 23 Nov 2007 06:50:02 +0200
 

+ 13 - 3
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}) {