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

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



Author: rra
Date: 2006-07-15 05:25:17 +0200 (Sat, 15 Jul 2006)
New Revision: 696

Added:
   trunk/testset/manpages/true.1
Modified:
   trunk/checks/manpages
   trunk/checks/manpages.desc
   trunk/debian/changelog
   trunk/testset/manpages/debian/rules
   trunk/testset/tags.manpages
Log:
* checks/manpages{.desc,}:
  + [RA] Warn about manpage short descriptions of the form "manual page
    for program" (usually generated by help2man).

Modified: trunk/checks/manpages
===================================================================
--- trunk/checks/manpages	2006-07-15 00:56:35 UTC (rev 695)
+++ trunk/checks/manpages	2006-07-15 03:25:17 UTC (rev 696)
@@ -226,8 +226,10 @@
 		next;
 	    }
 	}
+
 	# If it's not a .so link, use lexgrog to find out if the man page
-	# parses correctly.
+	# parses correctly and make sure the short description is reasonable.
+        #
 	# This check is currently not applied to pages in language-specific
 	# hierarchies, because those pages are not currently scanned by
 	# mandb (bug #29448), and because lexgrog can't handle pages in all
@@ -235,9 +237,24 @@
 	# negatives. When man-db is fixed, this limitation should be
 	# removed.
 	if ($path =~ m,/man/man\d/,) {
-	    if (system_env("lexgrog unpacked/\Q$file\E >/dev/null 2>&1")) {
-		tag "manpage-has-bad-whatis-entry", "$file";
-	    }
+            my $pid = open LEXGROG, '-|';
+            if (not defined $pid) {
+                fail("cannot run lexgrog: $!");
+            } elsif ($pid == 0) {
+                my %newenv = (LANG => 'C', PATH => $ENV{PATH});
+                undef %ENV;
+                %ENV = %newenv;
+                exec "lexgrog unpacked/\Q$file\E 2>&1"
+                    or fail("cannot run lexgrog: $!");
+            }
+            my $desc = <LEXGROG>;
+            $desc =~ s/^[^:]+: \"(.*)\"$/$1/;
+            if ($desc =~ /(\S+)\s+-\s+manual page for \1/i) {
+                tag "manpage-has-useless-whatis-entry", "$file";
+            }
+            1 while <LEXGROG>;
+            close LEXGROG;
+            tag "manpage-has-bad-whatis-entry", "$file" if $? != 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

Modified: trunk/checks/manpages.desc
===================================================================
--- trunk/checks/manpages.desc	2006-07-15 00:56:35 UTC (rev 695)
+++ trunk/checks/manpages.desc	2006-07-15 03:25:17 UTC (rev 696)
@@ -94,6 +94,21 @@
  See also groff_man(7) and groff_mdoc(7) for general information on writing
  manual pages.
 
+Tag: manpage-has-useless-whatis-entry
+Type: warning
+Info: The whatis entry for this manual page (the brief description found
+ in the NAME section) is of the form:
+ .
+  program - manual page for program
+ .
+ This conveys no information about what the program is for and is
+ repetitive.  The short description should contain brief information about
+ what the program is for to aid in searching with apropos and similar
+ programs.
+ .
+ If this manpage was generated by help2man, use the -n option to provide a
+ more meaningful description.
+
 Tag: manpage-has-errors-from-man
 Type: warning
 Info: This man page provokes warnings or errors from man.

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	2006-07-15 00:56:35 UTC (rev 695)
+++ trunk/debian/changelog	2006-07-15 03:25:17 UTC (rev 696)
@@ -1,12 +1,15 @@
 lintian (1.23.23) UNRELEASED; urgency=low
 
+  * checks/manpages{.desc,}:
+    + [RA] Warn about manpage short descriptions of the form "manual page
+      for program" (usually generated by help2man).
   * checks/nmu{.desc,}:
     + [RA] When checking for an NMU changelog entry, require "NMU" be
       surrounded by word boundaries.
     + [RA] Warn if the changelog incorrectly indicates an NMU.  Thanks to
       George Danchev for the report.
 
- -- Russ Allbery <rra@debian.org>  Fri, 14 Jul 2006 17:55:28 -0700
+ -- Russ Allbery <rra@debian.org>  Fri, 14 Jul 2006 20:24:14 -0700
 
 lintian (1.23.22) unstable; urgency=low
 

Modified: trunk/testset/manpages/debian/rules
===================================================================
--- trunk/testset/manpages/debian/rules	2006-07-15 00:56:35 UTC (rev 695)
+++ trunk/testset/manpages/debian/rules	2006-07-15 03:25:17 UTC (rev 696)
@@ -22,6 +22,8 @@
 	gzip -c9 <test.1p >$(tmp)/usr/share/man/man1/test.1p.gz
 	gzip -c9 <test.1p.de >$(tmp)/usr/share/man/man1/test-latin1-chars.1p.gz
 
+	gzip -c9 <true.1 >$(tmp)/usr/share/man/man1/true.1.gz
+
 	ln -s ../X11R6/bin/rstartd $(tmp)/usr/bin/rstartd
 	touch $(tmp)/usr/X11R6/man/man1/rstartd.1x.gz
 

Added: trunk/testset/manpages/true.1
===================================================================
--- trunk/testset/manpages/true.1	2006-07-15 00:56:35 UTC (rev 695)
+++ trunk/testset/manpages/true.1	2006-07-15 03:25:17 UTC (rev 696)
@@ -0,0 +1,44 @@
+.\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.36.
+.TH TRUE "1" "July 2006" "true 5.96" "User Commands"
+.SH NAME
+true \- manual page for true 5.96
+.SH SYNOPSIS
+.B true
+[\fIignored command line arguments\fR]
+.br
+.B true
+\fIOPTION\fR
+.SH DESCRIPTION
+Exit with a status code indicating success.
+.TP
+\fB\-\-help\fR
+display this help and exit
+.TP
+\fB\-\-version\fR
+output version information and exit
+.PP
+NOTE: your shell may have its own version of true, which usually supersedes
+the version described here.  Please refer to your shell's documentation
+for details about the options it supports.
+.SH AUTHOR
+Written by Jim Meyering.
+.SH "REPORTING BUGS"
+Report bugs to <bug\-coreutils@gnu.org>.
+.SH COPYRIGHT
+Copyright \(co 2006 Free Software Foundation, Inc.
+.br
+This is free software.  You may redistribute copies of it under the terms of
+the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.
+There is NO WARRANTY, to the extent permitted by law.
+.SH "SEE ALSO"
+The full documentation for
+.B true
+is maintained as a Texinfo manual.  If the
+.B info
+and
+.B true
+programs are properly installed at your site, the command
+.IP
+.B info true
+.PP
+should give you access to the complete manual.

Modified: trunk/testset/tags.manpages
===================================================================
--- trunk/testset/tags.manpages	2006-07-15 00:56:35 UTC (rev 695)
+++ trunk/testset/tags.manpages	2006-07-15 03:25:17 UTC (rev 696)
@@ -43,3 +43,4 @@
 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-latin1-chars.1p.gz 9: warning: can't find numbered character 228
+W: manpages: manpage-has-useless-whatis-entry usr/share/man/man1/true.1.gz



Reply to: