From edwin@mavetju.org  Fri Sep 28 07:47:40 2007
Return-Path: <edwin@mavetju.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 52D3E16A419
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 28 Sep 2007 07:47:40 +0000 (UTC)
	(envelope-from edwin@mavetju.org)
Received: from mail5out.barnet.com.au (mail5.barnet.com.au [202.83.178.78])
	by mx1.freebsd.org (Postfix) with ESMTP id 1B53B13C478
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 28 Sep 2007 07:47:39 +0000 (UTC)
	(envelope-from edwin@mavetju.org)
Received: by mail5out.barnet.com.au (Postfix, from userid 1001)
	id F04022219CC0; Fri, 28 Sep 2007 17:47:38 +1000 (EST)
Received: from mail5auth.barnet.com.au (mail5.barnet.com.au [202.83.178.78])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(Client did not present a certificate)
	by mail5.barnet.com.au (Postfix) with ESMTP id BC30D21B117B
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 28 Sep 2007 17:47:38 +1000 (EST)
Received: from k7.mavetju (k7.mavetju.org [10.251.1.18])
	by mail5auth.barnet.com.au (Postfix) with ESMTP id 536632218E27
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 28 Sep 2007 17:47:38 +1000 (EST)
Received: by k7.mavetju (Postfix, from userid 1001)
	id 2E3F778; Fri, 28 Sep 2007 17:47:40 +1000 (EST)
Message-Id: <20070928074740.2E3F778@k7.mavetju>
Date: Fri, 28 Sep 2007 17:47:40 +1000 (EST)
From: Edwin Groothuis <edwin@mavetju.org>
Reply-To: Edwin Groothuis <edwin@mavetju.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [patch] src/usr.bin/makewhatis/makewhatis.c - teach about .SS
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         116706
>Category:       bin
>Synopsis:       [patch] src/usr.bin/makewhatis/makewhatis.c - teach about .SS
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    edwin
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Sep 28 07:50:05 GMT 2007
>Closed-Date:    Thu Oct 25 03:54:29 UTC 2007
>Last-Modified:  Thu Oct 25 04:00:04 UTC 2007
>Originator:     Edwin Groothuis
>Release:        FreeBSD 6.2-RELEASE-p4 i386
>Organization:
-
>Environment:
System: FreeBSD k7.mavetju 6.2-RELEASE-p4 FreeBSD 6.2-RELEASE-p4 #0: Thu Apr 26 17:55:55 UTC 2007 root@i386-builder.daemonology.net:/usr/obj/usr/src/sys/SMP i386


>Description:

If you install net-mgmt/net-snmp, your whatis file will be clobbered
with rubbish:

    netsnmp_agent(3), The Net-SNMP agent(3) - The snmp agent responds to SNMP queries from management stations. "Modules" +1c -1c "Net-SNMP Agent handler and extensibility API" "The basic theory goes something like this: In the past, with the original mib module api (which derived from the original CMU SNMP code) the underlying mib modules were passed very little information (only the truly most basic information about a request). " +1c -1c "Maintain a registry of MIB subtrees, together with related information regarding mibmodule, sessions, etc" -1c "Trap generation routines for mib modules to use" -1c "net-snmp agent related processing" -1c

This should me:

    netsnmp_agent(3), The Net-SNMP agent(3) - The Net-SNMP agent - The snmp agent responds to SNMP queries from management stations.

This is caused by the man pages of net-snmp which don't have proper
.SH parts for the SYNOPSIS etc:

    .SH NAME
    The Net-SNMP agent \- The snmp agent responds to SNMP queries from management stations.  

    .PP
    .SS "Modules"

makewhatis.c checks for the new sections which start with .SH, but
not for new sections which start with .SS:

   .SH [text for a heading]
	 Set  up  an unnumbered section heading sticking out to the left.
   .SS [text for a heading]
	 Set  up a secondary, unnumbered section heading.  Prints out all

By applying the next patch it will teach makewhatis.c to treat .SS
with the same severity as .SH.

I have run /etc/period/weekly/320.whatis with the old version and
with the patched version of makewhatis(1) and the only changes in
the output were the man pages of the Net-SNMP port.

>How-To-Repeat:
>Fix:

Index: makewhatis.c
===================================================================
RCS file: /home/ncvs/src/usr.bin/makewhatis/makewhatis.c,v
retrieving revision 1.10
diff -u -r1.10 makewhatis.c
--- makewhatis.c	5 Dec 2005 14:22:12 -0000	1.10
+++ makewhatis.c	28 Sep 2007 07:46:25 -0000
@@ -726,6 +726,8 @@
 		case STATE_MANSTYLE:
 			if (strncmp(line, ".SH", 3) == 0)
 				break;
+			if (strncmp(line, ".SS", 3) == 0)
+				break;
 			trim_rhs(line);
 			if (strcmp(line, ".") == 0)
 				continue;
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->edwin 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Sat Oct 6 07:47:01 UTC 2007 
Responsible-Changed-Why:  
Handle with mentor 

http://www.freebsd.org/cgi/query-pr.cgi?pr=116706 
State-Changed-From-To: open->patched 
State-Changed-By: edwin 
State-Changed-When: Thu Oct 18 12:55:36 UTC 2007 
State-Changed-Why:  
Commited to -HEAD and RELENG_7 

http://www.freebsd.org/cgi/query-pr.cgi?pr=116706 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/116706: commit references a PR
Date: Thu, 18 Oct 2007 12:53:18 +0000 (UTC)

 edwin       2007-10-18 12:53:11 UTC
 
   FreeBSD src repository
 
   Modified files:
     usr.bin/makewhatis   makewhatis.c 
   Log:
   Teach makewhatis.c to treat .SS with the same severity as .SH.
   
   At least one port (net-mgmt/net-snmp) creates man-pages which are
   in the format:
   
           .SH NAME
           The Net-SNMP agent \- The snmp agent responds to SNMP queries from management stations.
   
           .PP
           .SS "Modules"
   
   At this moment, makewhatis determines the end of the .SH NAME section
   as where it finds .SH again, but there is none here, is it "terminated"
   by the .SS.
   
   PR:             bin/116706
   Submitted by:   edwin@
   Approved by:    re (Ken Smith), grog (mentor)
   MFC after:      1 week
   
   Revision  Changes    Path
   1.11      +2 -0      src/usr.bin/makewhatis/makewhatis.c
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/116706: commit references a PR
Date: Thu, 18 Oct 2007 12:55:34 +0000 (UTC)

 edwin       2007-10-18 12:55:27 UTC
 
   FreeBSD src repository
 
   Modified files:        (Branch: RELENG_7)
     usr.bin/makewhatis   makewhatis.c 
   Log:
   Fast MFC for inclusion of 7.0-BETA1:
   
   Teach makewhatis.c to treat .SS with the same severity as .SH.
   
   At least one port (net-mgmt/net-snmp) creates man-pages which are
   in the format:
   
           .SH NAME
           The Net-SNMP agent \- The snmp agent responds to SNMP queries from manag
   ement stations.
   
           .PP
           .SS "Modules"
   
   At this moment, makewhatis determines the end of the .SH NAME section
   as where it finds .SH again, but there is none here, is it "terminated"
   by the .SS.
   
   PR:             bin/116706
   Submitted by:   edwin@
   Approved by:    re (Ken Smith), grog (mentor)
   
   Revision  Changes    Path
   1.10.2.1  +2 -0      src/usr.bin/makewhatis/makewhatis.c
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: patched->closed 
State-Changed-By: edwin 
State-Changed-When: Thu Oct 25 03:54:07 UTC 2007 
State-Changed-Why:  
MFCd too 

http://www.freebsd.org/cgi/query-pr.cgi?pr=116706 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/116706: commit references a PR
Date: Thu, 25 Oct 2007 03:52:50 +0000 (UTC)

 edwin       2007-10-25 03:52:42 UTC
 
   FreeBSD src repository
 
   Modified files:        (Branch: RELENG_6)
     usr.bin/makewhatis   makewhatis.c 
   Log:
   MFC of 1.11
   
   Teach makewhatis.c to treat .SS with the same severity as .SH.
   
   At least one port (net-mgmt/net-snmp) creates man-pages which are
   in the format:
   
   .SH NAME
   The Net-SNMP agent \- The snmp agent responds to SNMP queries from manag
   ement stations.
   
   .PP
   .SS "Modules"
   
   At this moment, makewhatis determines the end of the .SH NAME section
   as where it finds .SH again, but there is none here, is it "terminated"
   by the .SS.
   
   PR: bin/116706
   Submitted by: edwin@
   
   Revision  Changes    Path
   1.9.16.1  +2 -0      src/usr.bin/makewhatis/makewhatis.c
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/116706: commit references a PR
Date: Thu, 25 Oct 2007 03:53:50 +0000 (UTC)

 edwin       2007-10-25 03:53:46 UTC
 
   FreeBSD src repository
 
   Modified files:        (Branch: RELENG_5)
     usr.bin/makewhatis   makewhatis.c 
   Log:
   MFC of 1.11
   
   Teach makewhatis.c to treat .SS with the same severity as .SH.
   
   At least one port (net-mgmt/net-snmp) creates man-pages which are
   in the format:
   
   .SH NAME
   The Net-SNMP agent \- The snmp agent responds to SNMP queries from manag
   ement stations.
   
   .PP
   .SS "Modules"
   
   At this moment, makewhatis determines the end of the .SH NAME section
   as where it finds .SH again, but there is none here, is it "terminated"
   by the .SS.
   
   PR:             bin/116706
   Submitted by:   edwin@
   
   Revision  Changes    Path
   1.9.10.1  +2 -0      src/usr.bin/makewhatis/makewhatis.c
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
