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

lintian: r121 - in trunk: checks debian testset



Author: djpig
Date: 2004-04-01 03:18:32 +0200 (Thu, 01 Apr 2004)
New Revision: 121

Modified:
   trunk/checks/manpages
   trunk/checks/manpages.desc
   trunk/debian/changelog
   trunk/testset/tags.manpages
Log:
* checks/manpages:
 + [FL] Two new errors: 1) if section number of directory and file
   differ, 2) if section number of file differs from what is expected
   from the location of the binary. (Closes: #203831)


Modified: trunk/checks/manpages
===================================================================
--- trunk/checks/manpages	2004-04-01 00:45:00 UTC (rev 120)
+++ trunk/checks/manpages	2004-04-01 01:18:32 UTC (rev 121)
@@ -29,6 +29,8 @@
 
 my %file_info;
 my %binary;
+my %sect_by_binary;
+my %sect_by_manpage;
 my %manpage;
 
 # Read file info...
@@ -75,6 +77,21 @@
 	my $bin = $fname;
 	
 	$binary{$bin} = $file;
+
+	for ($path) {
+	    m,^(usr/(X11R6/)?)?bin/,o && do {
+		$sect_by_binary{$bin} = 1;
+		last;
+	    };
+	    m,^usr/games/,o && do {
+		$sect_by_binary{$bin} = 6;
+		last;
+	    };
+	    m,^(usr/)?sbin/,o && do {
+		$sect_by_binary{$bin} = 8;
+		last;
+	    };
+	}
 	
     	next;
     }
@@ -111,12 +128,19 @@
 	}
     }
     my $num = pop @pieces;
-    if (scalar @pieces && $num =~ /^\d/) {
-	$manpage{join(".", @pieces)} = $file;
+    if (scalar @pieces && $num =~ s/^(\d).*$/$1/) {
+	my $bin = join(".", @pieces);
+	$manpage{$bin} = $file;
+
+	# number of directory and manpage extension equal?
+	if ($num != $section) {
+	    print "E: $pkg $type: manpage-in-wrong-directory $file\n";
+	}
+	push @{$sect_by_manpage{$bin}}, $num; # array needed for cases like man(1), man(7)
     } else {
 	print "E: $pkg $type: manpage-has-wrong-extension $file\n";
     }
-
+    
     # special check for manual pages for X11 games
     if ($path =~ m,^usr/X11R6/man/man6/,o) {
 	print "W: $pkg $type: x11-games-should-be-in-usr-games $file\n";
@@ -222,6 +246,10 @@
 		# ok.
 	    }
 	}
+
+	unless (grep { $_ == $sect_by_binary{$f} } @{$sect_by_manpage{$f}}) {
+	    print "W: $pkg $type: no-manpage-in-correct-directory $binary{$f} (@{$sect_by_manpage{$f}})\n";
+	}
     } else {
 	print "E: $pkg $type: binary-without-manpage $f\n";
     }

Modified: trunk/checks/manpages.desc
===================================================================
--- trunk/checks/manpages.desc	2004-04-01 00:45:00 UTC (rev 120)
+++ trunk/checks/manpages.desc	2004-04-01 01:18:32 UTC (rev 121)
@@ -48,6 +48,9 @@
 Info: The manual page should be installed in the correct directory below
  <tt>/usr/share/man/</tt> or <tt>/usr/share/man/<i>locale</i></tt>.
  Only sections 1 through 9 should be used.
+ .
+ The section number in the filename should correspond with the section
+ number in the directory name.
 Ref: policy 12.1
 
 Tag: manpage-has-wrong-extension
@@ -112,6 +115,16 @@
  Note that moving a binary into <tt>/usr/X11R6/bin</tt> is almost never the
  proper solution for this problem; move the manual page instead.
 
+Tag: no-manpage-in-correct-directory
+Type: warning
+Info: Manpages for executables in /sbin and /usr/sbin should be placed in
+ section 8; manpages for executables in /bin and /usr/bin in section 1;
+ manpages for executables in /usr/games in section 6. For the noted
+ executable some probable manpages were found but none in the right section.
+ .
+ This could either mean there is no manpage for the executable or that its
+ manpage is placed in the wrong section.
+
 Tag: bad-so-link-within-manual-page
 Type: error
 Info: Manual files that use the .so links to include other pages should

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	2004-04-01 00:45:00 UTC (rev 120)
+++ trunk/debian/changelog	2004-04-01 01:18:32 UTC (rev 121)
@@ -13,6 +13,10 @@
       (Closes: #236846)
   * checks/fields.desc:
     + [FL] Fix some wrong policy references
+  * checks/manpages:
+    + [FL] Two new errors: 1) if section number of directory and file
+      differ, 2) if section number of file differs from what is expected
+      from the location of the binary. (Closes: #203831)
   * checks/menu-format:
     + [FL] Only issue one warning about needs=dwww, not two
   * checks/scripts:

Modified: trunk/testset/tags.manpages
===================================================================
--- trunk/testset/tags.manpages	2004-04-01 00:45:00 UTC (rev 120)
+++ trunk/testset/tags.manpages	2004-04-01 01:18:32 UTC (rev 121)
@@ -19,6 +19,7 @@
 W: manpages: link-to-undocumented-manpage usr/share/man/man1/bin-binary.1.gz
 E: manpages: bad-link-to-undocumented-manpage usr/share/man/man1/sbin-binary.1.gz
 W: manpages: link-to-undocumented-manpage usr/share/man/man3/function.3.gz
+E: manpages: no-manpage-in-correct-directory usr/sbin/usr-sbin-binary (1)
 W: manpages: package-contains-hardlink usr/share/man/man1/usr-bin-binary-alt.1.gz
 W: manpages: executable-not-elf-or-script ./usr/sbin/usr-sbin-binary
 W: manpages: executable-not-elf-or-script ./usr/bin/usr-bin-binary-alt



Reply to: