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

lintian: r1170 - in trunk: checks debian testset testset/manpages



Author: rra
Date: 2008-02-04 09:15:16 +0100 (Mon, 04 Feb 2008)
New Revision: 1170

Modified:
   trunk/checks/manpages
   trunk/debian/changelog
   trunk/debian/control
   trunk/testset/manpages/test.1p
   trunk/testset/tags.manpages
Log:
Update the man --warnings support so that the backport to stable
will still work for ftpmaster.  Move the versioned dependency on
man-db 2.5.1 to Suggests accordingly.

Also wrap Uploaders and add some more thorough man page tests.


Modified: trunk/checks/manpages
===================================================================
--- trunk/checks/manpages	2008-02-04 07:24:56 UTC (rev 1169)
+++ trunk/checks/manpages	2008-02-04 08:15:16 UTC (rev 1170)
@@ -23,6 +23,10 @@
 use Tags;
 use Util;
 
+# Set to true if the man program supports --warnings based on its version
+# number.  This is probed if this variable is undefined and set to 0 or 1.
+our $MAN_WARNINGS;
+
 sub run {
 
 my $pkg = shift;
@@ -247,16 +251,29 @@
 	    close LEXGROG;
 	    tag "manpage-has-bad-whatis-entry", "$file" if $? != 0;
 	}
+
+	# If we've not probed yet, determine if man supports --warnings.
+	# This can be removed once man 2.5.1 makes it to testing.
+	unless (defined $MAN_WARNINGS) {
+	    my $version = `man -V 2>&1`;
+	    if ($? == 0 && $version =~ / (\d+\.[\d.]+)(,|\Z)/) {
+		$MAN_WARNINGS = Dep::versions_gte($1, '2.5.1');
+	    } else {
+		$MAN_WARNINGS = 0;
+	    }
+	}
+
 	# If it's not a .so link, run it through "man" to check for errors.
 	# If it is in a directory with the standard man layout, cd to the
 	# parent directory before running man so that .so directives are
 	# processed properly.  (Yes, there are man pages that include other
 	# pages with .so but aren't simple links; rbash, for instance.)
 	my $cmd;
+	my $warnings = $MAN_WARNINGS ? ' --warnings' : '';
 	if ($file =~ m,^(.*)/(man\d/.*)$,) {
-	    $cmd = "cd unpacked/\Q$1\E && man --warnings -l \Q$2\E";
+	    $cmd = "cd unpacked/\Q$1\E && man$warnings -l \Q$2\E";
 	} else {
-	    $cmd = "man --warnings -l unpacked/\Q$file\E";
+	    $cmd = "man$warnings -l unpacked/\Q$file\E";
 	}
 	my $pid = open MANERRS, '-|';
 	if (not defined $pid) {
@@ -280,6 +297,8 @@
 		next if /warning \[.*\]: cannot adjust line/;
 		next if /warning \[.*\]: can\'t break line/;
 	    }
+	    # ignore a common undefined macro from pod2man
+	    next if /warning: \`IX\' not defined/;
 	    chomp;
 	    s/^[^:]+://o;
 	    tag "manpage-has-errors-from-man", "$file", "$_";

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	2008-02-04 07:24:56 UTC (rev 1169)
+++ trunk/debian/changelog	2008-02-04 08:15:16 UTC (rev 1170)
@@ -65,8 +65,8 @@
       lines.  Thanks, Michal Čihař.  (Closes: #459871)
     + [CW] Use man's new --warnings option to catch use of undefined
       strings, macros, or diversions in manual pages, which usually indicate
-      mistaken use of "." or "'" at the start of a line. Requires man-db >=
-      2.5.1-1.
+      mistaken use of "." or "'" at the start of a line. This check is only
+      enabled if man 2.5.1 or later is installed.
   * checks/menu-format:
     + [RA] Avoid a Perl warning for desktop entries without Exec.
     + [RA] Fix a bug that prevented Exec keys in desktop files from being
@@ -99,6 +99,10 @@
     + [RA] Catch exec wrappers that use $* instead of $@ (not that this is
       a good idea).  Thanks, Adam D. Barratt.  (Closes: #463476)
 
+  * debian/control:
+    + [RA] Suggest man-db >= 2.5.1 for better warning support.
+    + [RA] Wrap Uploaders.
+
   * frontend/lintian:
     + [RA] Include info tags in the broken-down description of the
       override count since they're included in the total.  Based on a

Modified: trunk/debian/control
===================================================================
--- trunk/debian/control	2008-02-04 07:24:56 UTC (rev 1169)
+++ trunk/debian/control	2008-02-04 08:15:16 UTC (rev 1170)
@@ -2,7 +2,11 @@
 Section: devel
 Priority: optional
 Maintainer: Debian Lintian Maintainers <lintian-maint@debian.org>
-Uploaders: Josip Rodin <joy-packages@debian.org>, Jeroen van Wolffelaar <jeroen@wolffelaar.nl>, Frank Lichtenheld <djpig@debian.org>, Marc 'HE' Brockschmidt <he@debian.org>, Colin Watson <cjwatson@debian.org>, Russ Allbery <rra@debian.org>
+Uploaders: Josip Rodin <joy-packages@debian.org>,
+ Jeroen van Wolffelaar <jeroen@wolffelaar.nl>,
+ Frank Lichtenheld <djpig@debian.org>,
+ Marc 'HE' Brockschmidt <he@debian.org>,
+ Colin Watson <cjwatson@debian.org>, Russ Allbery <rra@debian.org>
 Build-Depends: debhelper (>= 4)
 Build-Depends-Indep: debiandoc-sgml, sed (>= 4.1-4)
 Standards-Version: 3.7.3
@@ -12,9 +16,9 @@
 Package: lintian
 Architecture: all
 Depends: perl, libdigest-md5-perl | perl (>> 5.8), dpkg-dev (>= 1.13.17),
- file, binutils, diffstat (>= 1.27-1), man-db (>= 2.5.1-1), gettext (>= 0.16),
+ file, binutils, diffstat (>= 1.27-1), man-db (>= 2.3.20-1), gettext (>= 0.16),
  intltool-debian, libparse-debianchangelog-perl (>= 0.6), liburi-perl
-Suggests: binutils-multiarch, libtext-template-perl
+Suggests: binutils-multiarch, libtext-template-perl, man-db (>= 2.5.1-1)
 Description: Debian package checker
  Lintian dissects Debian packages and reports bugs and policy
  violations. It contains automated checks for many aspects of Debian

Modified: trunk/testset/manpages/test.1p
===================================================================
--- trunk/testset/manpages/test.1p	2008-02-04 07:24:56 UTC (rev 1169)
+++ trunk/testset/manpages/test.1p	2008-02-04 08:15:16 UTC (rev 1170)
@@ -7,3 +7,6 @@
 \&\fBTEST\fR tests lintian.
 .PP
 Use more up-level tools like human brains to understand lintian.
+Here's a bad undefined macro.
+Here's a serious syntax error.
+.dep

Modified: trunk/testset/tags.manpages
===================================================================
--- trunk/testset/tags.manpages	2008-02-04 07:24:56 UTC (rev 1169)
+++ trunk/testset/tags.manpages	2008-02-04 08:15:16 UTC (rev 1170)
@@ -61,5 +61,7 @@
 W: manpages: manpage-has-bad-whatis-entry usr/share/man/man1/usr-bin-binary.1
 W: manpages: manpage-has-bad-whatis-entry usr/share/man/man1/usr-sbin-binary.1.gz
 W: manpages: manpage-has-bad-whatis-entry usr/share/man/man6/usr-games-binary.6.gz
+W: manpages: manpage-has-errors-from-man usr/share/man/man1/test.1p.gz 12: warning: `dep' not defined (probable missing space after `de')
+W: manpages: manpage-has-errors-from-man usr/share/man/man3/included.3.gz 6: warning: `zY' not defined
 W: manpages: manpage-has-useless-whatis-entry usr/share/man/man1/true.1.gz
 W: manpages: package-contains-empty-directory usr/share/man/man1/not-a-man-page.1.gz/


Reply to: