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

lintian: r1176 - in trunk: checks debian testset testset/libbaz/debian



Author: rra
Date: 2008-02-05 05:06:02 +0100 (Tue, 05 Feb 2008)
New Revision: 1176

Modified:
   trunk/checks/binaries
   trunk/checks/binaries.desc
   trunk/debian/changelog
   trunk/testset/libbaz/debian/rules
   trunk/testset/tags.libbaz
Log:
  + [RA] Warn on packages that provide Perl modules but don't depend on
    perlapi-*.  Thanks, Niko Tyni.  (Closes: #463142)

Modified: trunk/checks/binaries
===================================================================
--- trunk/checks/binaries	2008-02-05 02:17:28 UTC (rev 1175)
+++ trunk/checks/binaries	2008-02-05 04:06:02 UTC (rev 1176)
@@ -34,6 +34,7 @@
 my $needs_libc_file;
 my $needs_libc_count = 0;
 my $needs_depends_line = 0;
+my $has_perl_lib = 0;
 
 my %COMMENT;
 my %NOTE;
@@ -48,10 +49,6 @@
 if (open(IN, '<', "fields/architecture")) {
     chop($arch = <IN>);
     close(IN);
-} else {
-    # Don't display this tag, since `fields' check already checks for this!
-    # -> no-architecture-field
-    #tag "package-does-not-specify-architecture", "";
 }
 
 my $file;
@@ -148,7 +145,7 @@
 my $match_found = 0;
 foreach my $expected_name (@sonames) {
     $expected_name =~ s/([0-9])\.so\./$1-/;
-    $expected_name =~ s/\.so(\.|$)//o;
+    $expected_name =~ s/\.so(\.|\z)//o;
     $expected_name =~ s/_/-/o;
 
     if ((lc($expected_name) eq $pkg)
@@ -224,6 +221,11 @@
     next unless ($info =~ m/executable/) or ($info =~ m/shared object/);
     next if $type eq 'udeb';
 
+    # Perl library?
+    if ($file =~ m,/usr/lib/perl5/.*\.so$,) {
+	$has_perl_lib = 1;
+    }
+
     # statically linked?
     my @needed;
     if (!exists($NEEDED{$file}) && !defined($NEEDED{$file})) {
@@ -269,16 +271,19 @@
 }
 close(IN);
 
+# Find the package dependencies, which is used by various checks.
+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;
+
+# Check for a libc dependency.
 if ($needs_depends_line) {
-    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;
@@ -295,8 +300,16 @@
     }
 }
 
+# Check for a Perl dependency.
+if ($has_perl_lib) {
+    my $re = qr/(?:^|,)\s*perlapi-[\d.]+(?:\s*\[[^\]]+\])(?:\s*,|\z)/;
+    unless ($depends =~ /$re/) {
+	tag 'missing-dependency-on-perlapi';
+    }
 }
 
+}
+
 1;
 
 # Local Variables:

Modified: trunk/checks/binaries.desc
===================================================================
--- trunk/checks/binaries.desc	2008-02-05 02:17:28 UTC (rev 1175)
+++ trunk/checks/binaries.desc	2008-02-05 04:06:02 UTC (rev 1176)
@@ -153,3 +153,14 @@
  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.
+
+Tag: missing-dependency-on-perlapi
+Type: error
+Ref: Perl policy 4.4.2
+Info: This package includes a *.so file in <tt>/usr/lib/perl5</tt>,
+ normally indicating that it includes a binary Perl module.  Binary Perl
+ modules must depend on perlapi-$Config{version} (from the Config module).
+ If the package is using debhelper, this problem is usually due to a
+ missing dh_perl call in <tt>debian/rules</tt> or a missing
+ ${perl:Depends} substitution variable in the Depends line in
+ <tt>debian/control</tt>.

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	2008-02-05 02:17:28 UTC (rev 1175)
+++ trunk/debian/changelog	2008-02-05 04:06:02 UTC (rev 1176)
@@ -8,6 +8,8 @@
       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.
+    + [RA] Warn on packages that provide Perl modules but don't depend on
+      perlapi-*.  Thanks, Niko Tyni.  (Closes: #463142)
   * checks/changelog-file:
     + [RA] Decode the changelog entry from UTF-8 before doing length
       checks.  Thanks, Cyril Brulebois.  (Closes: #461822)

Modified: trunk/testset/libbaz/debian/rules
===================================================================
--- trunk/testset/libbaz/debian/rules	2008-02-05 02:17:28 UTC (rev 1175)
+++ trunk/testset/libbaz/debian/rules	2008-02-05 04:06:02 UTC (rev 1176)
@@ -66,7 +66,11 @@
 	ln -s libfoo.so.0.9.1 $(lib_tmp)/usr/lib/libfoo.so.0.9
 	# And a plain .so (wrong, TODO)
 	touch $(lib_tmp)/usr/lib/libbar2.so
-	#
+	# Pretend to be a Perl module to test a lack of Perl dependencies.
+	install -d $(lib_tmp)/usr/lib/perl5/auto/Foo
+	install -m 644 libbaz2.so.1.0.3b $(lib_tmp)/usr/lib/perl5/auto/Foo/Foo.so
+	strip $(lib_tmp)/usr/lib/perl5/auto/Foo/Foo.so
+
 	install -d $(lib_tmp)/usr/share/doc/$(LIB)
 	install -m 644 debian/copyright $(lib_tmp)/usr/share/doc/$(LIB)
 	install -m 644 debian/changelog $(lib_tmp)/usr/share/doc/$(LIB)

Modified: trunk/testset/tags.libbaz
===================================================================
--- trunk/testset/tags.libbaz	2008-02-05 02:17:28 UTC (rev 1175)
+++ trunk/testset/tags.libbaz	2008-02-05 04:06:02 UTC (rev 1176)
@@ -8,6 +8,7 @@
 E: libbaz1: ldconfig-symlink-missing-for-shlib usr/lib/libbaz2.so.1.0 usr/lib/libfoo2.so.1.0.3b libbaz2.so.1.0
 E: libbaz1: ldconfig-symlink-missing-for-shlib usr/lib/libbaz3.so.1 usr/lib/libbaz3.so.1.0.3b libbaz3.so.1
 E: libbaz1: maintainer-shell-script-fails-syntax-check postinst
+E: libbaz1: missing-dependency-on-perlapi
 E: libbaz1: postinst-must-call-ldconfig usr/lib/libfoo2.so.1.0.3b
 E: libbaz1: sharedobject-in-library-directory-not-actually-a-shlib usr/lib/libbaz1.so.1.0.3b
 E: libbaz1: shlib-missing-in-control-file libbaz2 1.0 for usr/lib/libfoo2.so.1.0.3b
@@ -21,6 +22,7 @@
 E: libbaz2-dev: debian-changelog-file-missing-or-wrong-name
 E: libbaz2: debian-changelog-file-missing-or-wrong-name
 I: libbaz source: package-lacks-versioned-build-depends-on-debhelper 5
+I: libbaz1: binary-has-unneeded-section ./usr/lib/perl5/auto/Foo/Foo.so .comment
 I: libbaz1: no-md5sums-control-file
 I: libbaz1: several-sonames-in-same-package libbaz2.so.1.0 libbaz3.so.1
 I: libbaz2-dbg: no-md5sums-control-file


Reply to: