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

lintian: r458 - in trunk: checks debian testset



Author: djpig
Date: 2005-07-24 01:09:01 +0200 (Sun, 24 Jul 2005)
New Revision: 458

Modified:
   trunk/checks/binaries
   trunk/checks/binaries.desc
   trunk/debian/changelog
   trunk/testset/tags.libbaz
Log:
Check that the package name of a shared library matches
the SONAME as defined in the "Library Packaging guide"
(Closes: #305575, #313118)


Modified: trunk/checks/binaries
===================================================================
--- trunk/checks/binaries	2005-07-23 23:03:11 UTC (rev 457)
+++ trunk/checks/binaries	2005-07-23 23:09:01 UTC (rev 458)
@@ -38,6 +38,7 @@
 my %NEEDED;
 my %CXXABI;
 my %OCAML;
+my %SONAME;
 
 # read architecture file
 if (open(IN,"fields/architecture")) {
@@ -92,6 +93,9 @@
 	    push @{$NEEDED{$file}}, $1;
 	} elsif (m/^\s*RPATH\s*(\S+)/o) {
 	    $RPATH{$file} = $1;
+	} elsif (m/^\s*SONAME\s*(\S+)/o) {
+	    $SONAME{$1} ||= [];
+	    push @{$SONAME{$1}}, $file;
 	} elsif (m/^\s*\d+\s+\.comment\s+/o) {
 	    $COMMENT{$file} = 1;
 	} elsif (m/^\s*\d+\s+\.note\s+/o) {
@@ -109,6 +113,23 @@
 }
 close(IN);
 
+my @sonames = keys %SONAME;
+tag "several-sonames-in-same-package", "@sonames" if @sonames > 1;
+
+my $match_found = 0;
+foreach my $expected_name (@sonames) {
+    $expected_name =~ s/([0-9])\.so\./$1-/;
+    $expected_name =~ s/\.so\.//;
+
+    if ($expected_name eq $pkg) {
+	$match_found = 1;
+	last;
+    }
+}
+
+tag "package-name-doesnt-match-sonames", "@sonames"
+    if @sonames && !$match_found;
+
 # process all files in package
 open(IN,"file-info") or fail("cannot find file-info for $type package $pkg");
 while (<IN>) {

Modified: trunk/checks/binaries.desc
===================================================================
--- trunk/checks/binaries.desc	2005-07-23 23:03:11 UTC (rev 457)
+++ trunk/checks/binaries.desc	2005-07-23 23:09:01 UTC (rev 458)
@@ -121,3 +121,18 @@
 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
+ have different sonames. This is usually discouraged because it is
+ inherently error-prone.
+
+Tag: package-name-doesnt-match-sonames
+Type: warning
+Info: The package name of a library package should usually reflect
+ the soname of the included library. The package name can determined
+ from the package name with the following code snippet:
+ .
+  $ objdump -p /path/to/libfoo-bar.so.1.2.3 | sed -n -e's/^[[:space:]]*SONAME[[:space:]]*//p' | sed -e's/\([0-9]\)\.so\./\1-/; s/\.so\.//'
+Ref: Library Packaging guide 5

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	2005-07-23 23:03:11 UTC (rev 457)
+++ trunk/debian/changelog	2005-07-23 23:09:01 UTC (rev 458)
@@ -5,6 +5,10 @@
       >= 0.6 since prior versions have bugs regarding parse
       error handling
   
+  * checks/binaries:
+    + [FL] Check that the package name of a shared library matches
+      the SONAME as defined in the "Library Packaging guide"
+      (Closes: #305575, #313118)
   * checks/changelog-file{,.desc}:
     + [FL] Use libparse-debianchangelog-perl to parse the changelog,
       which detects a lot of syntax errors

Modified: trunk/testset/tags.libbaz
===================================================================
--- trunk/testset/tags.libbaz	2005-07-23 23:03:11 UTC (rev 457)
+++ trunk/testset/tags.libbaz	2005-07-23 23:09:01 UTC (rev 458)
@@ -12,7 +12,9 @@
 W: libbaz source: changelog-should-mention-nmu
 W: libbaz source: source-nmu-has-incorrect-version-number 1
 W: libbaz1: missing-depends-line
+W: libbaz1: package-name-doesnt-match-sonames libbaz2-1.0
 W: libbaz1: possible-bashism-in-maintainer-script postinst:6 '[ -d /usr/doc -a ! -e /usr/doc/$PKG -a '
 W: libbaz1: possible-bashism-in-maintainer-script prerm:5 '[ \( "$1" = "upgrade" -o "$1" = "remove" \) -a '
 W: libbaz1: postinst-should-not-set-usr-doc-link
 W: libbaz1: zero-byte-file-in-doc-directory usr/share/doc/README.Debian
+W: libbaz2: package-name-doesnt-match-sonames libbaz2-1.0



Reply to: