NetBSD Problem Report #1062
From gnats Thu May 18 17:05:23 1995
Received: from pain.lcs.mit.edu (pain.lcs.mit.edu [128.52.46.239]) by sun-lamp.cs.berkeley.edu (8.6.10/8.6.10) with ESMTP id RAA01110 for <gnats-bugs@sun-lamp.cs.berkeley.edu>; Thu, 18 May 1995 17:05:22 -0700
Message-Id: <199505190005.RAA02423@gabriella.resort.com>
Date: Thu, 18 May 1995 17:05:59 -0700
From: Robert Dobbs <banshee@gabriella.resort.com>
Reply-To: banshee@gabriella.resort.com
To: gnats-bugs@NetBSD.ORG
Subject: makewhatis
X-Send-Pr-Version: 3.2
>Number: 1062
>Category: bin
>Synopsis: makewhatis fails to find MAN format files
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: bin-bug-people
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Thu May 18 17:20:02 +0000 1995
>Closed-Date: Thu Jan 04 02:08:14 +0000 1996
>Last-Modified: Thu Jan 04 02:08:40 +0000 1996
>Originator: Robert Dobbs
>Release: # $Header: /b/source/CVS/src/libexec/makewhatis/makewhatis.sh,v 1.4 1994/03/19 08:09:16 cgd Exp $
>Organization:
Resort.com
>Environment:
System: NetBSD gabriella.resort.com 1.0A NetBSD 1.0A (RESORT3) #2: Fri Mar 17 13:46:12 PST 1995 banshee@ns.cooltech.com:/usr/src/sys/arch/i386/compile/RESORT3 i386
>Description:
Many programs install man files that are in man nroff format. These
man files are named foo.1, foo.5, foo.8, etc. makewhatis only looks
for foo.0 and compressed versions.
>How-To-Repeat:
Install any man file in /usr/share/man/manX/file.X Run makewhatis
and note that they are not in the whatis.db file.
>Fix:
A fix requires a modification to /usr/libexec/makewhatis and a new
/usr/share/man/makewhatis.sed to deal with nroff man type files.
I hacked up a new makewhatis-man.sed and added to the makewhatis
script for 1..8.
# Get Man Files
find $MANDIR -type f -name '*.1' -print | while read file
do
sed -n -f /usr/share/man/makewhatis-man.sed $file;
done > /tmp/whatis$$
Here is my hack of the std makewhatis.sed to deal with man pages.
(I don't follow sed really well, so parts may be useless, but when
I ran this on /usr/local/man it produced correct results.)
==BEGIN==
#!/usr/bin/sed -nf
#
# Look for the manual page header .TH name number[ date]
/^.TH [a-zA-Z][a-zA-Z0-9\._+\-]* \([a-zA-Z0-9\._+\-]*\).*/ {
s;^.TH [a-zA-Z0-9\._+\-]* \([a-zA-Z0-9\._+\-]*\).*;\1;
# add a trailing space following the pattern space
s;[a-zA-Z0-9\._+\-]*;& ;
# save the manual number
h
d
}
# look for the program name
/^.SH NAME/!d
:name
s;.*;;
N
s;\n;;
# Convert "foo /- does bar" to "foo - does bar"
s;\\-;-;
# some twits underline the command name
s;;;g
/^[^a-zA-Z]/b print
H
b name
:print
x
s;\n;;g
/-/!d
s;;;g
s;\([a-z][A-z]\)-[ ][ ]*;\1;
s;\([a-zA-Z0-9,\._+\-]\)[ ][ ]*;\1 ;g
s;[^a-zA-Z0-9\._+\-]*\([a-zA-Z0-9\._+\-]*\)[^a-zA-Z0-9\._+\-]*\(.*\) - \(.*\);\2 (\1) - \3;
p
q
==END==
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed
State-Changed-By: mycroft
State-Changed-When: Wed Jan 3 21:08:14 EST 1996
State-Changed-Why:
Superceded by PR 1809.
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.