[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

lintian: r1169 - in trunk: checks debian testset



Author: rra
Date: 2008-02-04 08:24:56 +0100 (Mon, 04 Feb 2008)
New Revision: 1169

Modified:
   trunk/checks/binaries
   trunk/checks/binaries.desc
   trunk/debian/changelog
   trunk/testset/tags.diffs
Log:
* checks/binaries{.desc,}:
  + [RA] Warn for packages that have binaries requiring libc but which
    don't depend on libc.  Patch from Niko Tyni.  (Closes: #461350)
  + [RA] Remove check for libc5 binaries.  libc5 is long-gone.
  + [RA] Remove various dead tag descriptions we no longer issue.

Modified: trunk/checks/binaries
===================================================================
--- trunk/checks/binaries	2008-02-04 04:24:27 UTC (rev 1168)
+++ trunk/checks/binaries	2008-02-04 07:24:56 UTC (rev 1169)
@@ -30,6 +30,9 @@
 
 my $arch;
 my $dynsyms = 0;
+my $needs_libc = '';
+my $needs_libc_file;
+my $needs_libc_count = 0;
 my $needs_depends_line = 0;
 
 my %COMMENT;
@@ -69,11 +72,6 @@
 	# might be printed.  The symbol name should be the last word.
 	if (m/^[0-9a-fA-F]+.{6}\w\w?\s+(\S+)\s+[0-9a-zA-Z]+\s+(\S+)\s+(\S+)$/){
 	    my ($foo, $sec, $sym) = ($1, $2, $3);
-	#    # Add more symbols here when needed.
-	#    # We don't store them all, because the tables can be pretty large.
-	#    if ($sym =~ m/^(__register_frame_info)$/) {
-	#    	$DYNSYM{$file}{$sym} = $sec;
-	#    }
 	    if ($arch ne 'hppa') {
 		if ($foo eq '.text' and $sec eq 'Base' and
 		    $sym eq '__gmon_start__') {
@@ -227,7 +225,6 @@
     next if $type eq 'udeb';
 
     # statically linked?
-    my %libc5_binary;
     my @needed;
     if (!exists($NEEDED{$file}) && !defined($NEEDED{$file})) {
 	if ($info =~ m/shared object/o) {
@@ -246,7 +243,6 @@
 	    next if ($file =~ m%^./usr/lib/debug/%);
 	    next if ($file =~ /(\.|-)static$/);
 	    next if ($pkg =~ /-static$/);
-
 	    tag "statically-linked-binary", "$file";
 	}
     } else {
@@ -255,31 +251,13 @@
 	$needs_depends_line = 1;
 	@needed = @{$NEEDED{$file}};
 	for $lib (@needed) {
-	    # linked against libc5?
-	    if ($lib =~ m/^libc\.so\.5/o) {
-		# yes.
-		# libc5-compat ?
-		if (($file =~ m/libc5-compat/) or
-		    ($file =~ m/i486-linuxlibc1/)) {
-		    # ok, ignore it
-		} else {
-		    tag "libc5-binary", "$file" unless $libc5_binary{$file}++;
-		}
-	    }
-
-	    # C++ ABI check
-# removed for not being reliable enough
-#	    if ($lib =~ /^libstdc\+\+/) {
-#		unless ($CXXABI{$file}) {
-#		    tag "binary-or-shlib-with-obsolete-c++-abi", "$file";
-#		}
-#	    }
-
-	    if ($lib =~ m/^libc\.so/o) {
+	    if ($lib =~ /^libc\.so\.(\d+.*)/) {
+		$needs_libc = "libc$1";
+		$needs_libc_file = $file unless $needs_libc_file;
+		$needs_libc_count++;
 		$no_libc = 0;
 	    }
 	}
-
 	if ($no_libc and not $file =~ m,/libc\b,) {
 	    if ($info =~ m/shared object/) {
 		tag "library-not-linked-against-libc", "$file";
@@ -292,10 +270,29 @@
 close(IN);
 
 if ($needs_depends_line) {
-    if (not -e "fields/depends" and not -e "fields/pre-depends") {
-	tag "missing-depends-line", ""
-	    unless $pkg eq 'ldso';
+    my $depends = '';
+    if (-f 'fields/pre-depends') {
+	$depends = slurp_entire_file('fields/pre-depends');
     }
+    if (-f 'fields/depends') {
+	$depends .= ', ' if $depends;
+	$depends .= slurp_entire_file('fields/depends');
+    }
+    $depends =~ s/\n/ /g;
+    if ($depends && $needs_libc && $pkg !~ /^libc[\d.]+(-|\z)/) {
+        # Match libcXX or libcXX-*, but not libc3p0.
+        my $re = qr/(?:^|,)\s*\Q$needs_libc\E\b/o;
+        if ($depends !~ /$re/) {
+            my $others = '';
+            if ($needs_libc_count > 0) {
+                $others = " and $needs_libc_count others";
+            }
+            tag "missing-dependency-on-libc",
+		"needed by $needs_libc_file$others";
+        }
+    } elsif (!$depends) {
+	tag "missing-depends-line";
+    }
 }
 
 }

Modified: trunk/checks/binaries.desc
===================================================================
--- trunk/checks/binaries.desc	2008-02-04 04:24:27 UTC (rev 1168)
+++ trunk/checks/binaries.desc	2008-02-04 07:24:56 UTC (rev 1169)
@@ -42,15 +42,6 @@
 Info: The package installs a binary which is not dynamically linked
  against libc.
 
-Tag: libc5-binary
-Type: warning
-Info: The package contains a binary or shared library which is linked
- against libc.so.5.
- .
- This could be a bug since all programs in Debian should use
- libc6. However, the packages in the oldlibs section might contain
- libc5 libs/binaries intentionally.
-
 Tag: binary-or-shlib-defines-rpath
 Type: warning
 Ref: http://wiki.debian.org/RpathIssue
@@ -101,17 +92,6 @@
  .
  If you have questions about this, please contact &debdev;.
 
-Tag: compiled-with-bad-libc
-Type: error
-Info: This file defines or requires `__register_frame_info' as a dynamic
- symbol, and is not linked with libstdc++.  This means that it was
- compiled with a buggy version of libc.  It should be recompiled with
- the fixed versions, libc6 2.0.7u-6 or higher.  (which may not yet be
- available; see debian-devel).
- .
- This was a problem in the second half of 1998.  If you get this tag
- much later than that, it may be a different problem, file a bug.
-
 Tag: arch-dependent-file-in-usr-share
 Type: error
 Info: This package installs an ELF binary in the <tt>/usr/share</tt>
@@ -131,12 +111,6 @@
 Type: error
 Info: Debian does not allow binaries to be compressed by UPX.
 
-Tag: binary-or-shlib-with-obsolete-c++-abi
-Type: warning
-Info: There is no CXXABI_* mark in the objdump output on this file,
- and it is linked against a libstdc++, meaning it's likely linking to
- an obsolete version of the C++ library.
-
 Tag: several-sonames-in-same-package
 Type: info
 Info: There are several shared libraries in this package and they
@@ -165,3 +139,17 @@
  install binutils-multiarch on the system running lintian so that
  non-native binaries are handled correctly, or it may be a
  misidentification of a file as ELF that actually isn't.
+
+Tag: missing-dependency-on-libc
+Type: error
+Ref: policy 8.6
+Info: The listed file appears to be linked against the C library, but the
+ package doesn't depend on the C library package.  Normally this indicates
+ that ${shlibs:Depends} was omitted from the Depends line for this package
+ in <tt>debian/control</tt>.
+ .
+ All shared libraries and compiled binaries must be run through
+ dpkg-shlibdeps to find out any libraries they are linked against (often
+ via the dh_shlibdeps debhelper command).  The package containing these
+ files must then depend on ${shlibs:Depends} in <tt>debian/control</tt> to
+ get the proper package dependencies for those libraries.

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	2008-02-04 04:24:27 UTC (rev 1168)
+++ trunk/debian/changelog	2008-02-04 07:24:56 UTC (rev 1169)
@@ -1,9 +1,13 @@
 lintian (1.23.43) UNRELEASED; urgency=low
 
-  * checks/binaries:
+  * checks/binaries{.desc,}:
     + [RA] Don't require objdump's errors on files with bad dynamic tables
       to start at the beginning of the line.  Patch from Chris Lamb.
       (Closes: #459509)
+    + [RA] Warn for packages that have binaries requiring libc but which
+      don't depend on libc.  Patch from Niko Tyni.  (Closes: #461350)
+    + [RA] Remove check for libc5 binaries.  libc5 is long-gone.
+    + [RA] Remove various dead tag descriptions we no longer issue.
   * checks/changelog-file:
     + [RA] Decode the changelog entry from UTF-8 before doing length
       checks.  Thanks, Cyril Brulebois.  (Closes: #461822)

Modified: trunk/testset/tags.diffs
===================================================================
--- trunk/testset/tags.diffs	2008-02-04 04:24:27 UTC (rev 1168)
+++ trunk/testset/tags.diffs	2008-02-04 07:24:56 UTC (rev 1169)
@@ -1,5 +1,6 @@
 E: diffs source: debian-files-list-in-source
 E: diffs: arch-independent-package-contains-binary-or-object ./usr/bin/diffs
+E: diffs: missing-dependency-on-libc needed by ./usr/bin/diffs and 1 others
 E: diffs: no-copyright-file
 E: diffs: unstripped-binary-or-object ./usr/bin/diffs
 I: diffs source: diff-contains-editor-backup-file binary.c~


Reply to: