*BSD News Article 7164


Return to BSD News archive

Newsgroups: comp.unix.bsd
Path: sserve!manuel.anu.edu.au!munnari.oz.au!sgiblab!darwin.sura.net!wupost!decwrl!decwrl!netcomsv!netcom.com!alm
From: alm@netcom.com (Andrew Moore)
Subject: Re: Fix for whatis.db database.
Message-ID: <1992Oct28.204340.16565@netcom.com>
Keywords: man whatis apropos patch
Organization: Netcom - Online Communication Services  (408 241-9760 guest) 
References: <murray.3.720285489@its.uct.ac.za>
Date: Wed, 28 Oct 1992 20:43:40 GMT
Lines: 123

In article <murray.3.720285489@its.uct.ac.za> murray@its.uct.ac.za (Mark Murray) writes:
>Hello, all!
>
>As a proud owner of a 50 MHz 486 with 386BSD, I spend some time makeing the 
>system "look pretty".
>
>One thing that bugged me was the whatis.db file format being messed up even 
>_after_ the col -b patch. What I found was the section number being replaced 
>by garbage.
>
>Lines like this:
>
>(ar) - <description for ar>
>
>or
>
>ar (a) - <description for ar>
>
>This was a minor irritation, so I fixed it.
>
>Here is a patch for the makewhatis.sed file, which sits in the
>/usr/share/man directory.
>

[... patch deleted ...]

The following whatis.sed replacement was posted  by Andy Valencia.  It
is similar to the above patch, but it also makes the col -b patch
unnecessary and works on a broader range of man pages.  The only
additional change I would make is support for lower case headings as in
the above patch.

From: ajv@xhost92.csd.mot.com
Newsgroups: comp.unix.bsd
Subject: whatis
Message-ID: <7023@motcsd.csd.mot.com>
Date: 28 Aug 92 20:49:45 GMT
Sender: usenet@motcsd.csd.mot.com
Lines: 81

Enclosed is my modification to makewhatis.sed.  It understands the
new way of underlining which groff uses, and it also looks for the
"right" thing in the man header when trying to pick out section number
and man page name.  It is uuencode'ed because it contains control
characters, and they should be preserved.  It seems to get everything
right except some of the GNU man pages, which don't appear to be in
the standard format, anyway.

Just save off your old /usr/share/man/makewhatis.sed, and put this
one in its place.  Others have provided instructions on generating the
whatis.db, but the following script will suffice until you can find
those instructions. :-)

#!/bin/sh
cd /usr/share/man
for x in `find cat* -type f -print`
do
        echo $x > /dev/tty
        sed -f makewhatis.sed < $x
done | sort -u > whatis.db
exit 0

This file is a derivative work of the original, and is provided under
the same conditions.

					Andy Valencia
					ajv@csd.mot.com (for now)
					jtk@netcom.com (if it bounces)

begin 644 makewhatis.sed
M(R$O8FEN+W-H("T*(PHC($-O<'ER:6=H="`H8RD@,3DX."!4:&4@4F5G96YT
M<R!O9B!T:&4@56YI=F5R<VET>2!O9B!#86QI9F]R;FEA+@HC($%L;"!R:6=H
M=',@<F5S97)V960N"B,*(R!2961I<W1R:6)U=&EO;B!A;F0@=7-E(&EN('-O
M=7)C92!A;F0@8FEN87)Y(&9O<FUS+"!W:71H(&]R('=I=&AO=70*(R!M;V1I
M9FEC871I;VXL(&%R92!P97)M:71T960@<')O=FED960@=&AA="!T:&4@9F]L
M;&]W:6YG(&-O;F1I=&EO;G,*(R!A<F4@;65T.@HC(#$N(%)E9&ES=')I8G5T
M:6]N<R!O9B!S;W5R8V4@8V]D92!M=7-T(')E=&%I;B!T:&4@86)O=F4@8V]P
M>7)I9VAT"B,@("`@;F]T:6-E+"!T:&ES(&QI<W0@;V8@8V]N9&ET:6]N<R!A
M;F0@=&AE(&9O;&QO=VEN9R!D:7-C;&%I;65R+@HC(#(N(%)E9&ES=')I8G5T
M:6]N<R!I;B!B:6YA<GD@9F]R;2!M=7-T(')E<')O9'5C92!T:&4@86)O=F4@
M8V]P>7)I9VAT"B,@("`@;F]T:6-E+"!T:&ES(&QI<W0@;V8@8V]N9&ET:6]N
M<R!A;F0@=&AE(&9O;&QO=VEN9R!D:7-C;&%I;65R(&EN('1H90HC("`@(&1O
M8W5M96YT871I;VX@86YD+V]R(&]T:&5R(&UA=&5R:6%L<R!P<F]V:61E9"!W
M:71H('1H92!D:7-T<FEB=71I;VXN"B,@,RX@06QL(&%D=F5R=&ES:6YG(&UA
M=&5R:6%L<R!M96YT:6]N:6YG(&9E871U<F5S(&]R('5S92!O9B!T:&ES('-O
M9G1W87)E"B,@("`@;75S="!D:7-P;&%Y('1H92!F;VQL;W=I;F<@86-K;F]W
M;&5D9V5M96YT.@HC"51H:7,@<')O9'5C="!I;F-L=61E<R!S;V9T=V%R92!D
M979E;&]P960@8GD@=&AE(%5N:79E<G-I='D@;V8*(PE#86QI9F]R;FEA+"!"
M97)K96QE>2!A;F0@:71S(&-O;G1R:6)U=&]R<RX*(R`T+B!.96ET:&5R('1H
M92!N86UE(&]F('1H92!5;FEV97)S:71Y(&YO<B!T:&4@;F%M97,@;V8@:71S
M(&-O;G1R:6)U=&]R<PHC("`@(&UA>2!B92!U<V5D('1O(&5N9&]R<V4@;W(@
M<')O;6]T92!P<F]D=6-T<R!D97)I=F5D(&9R;VT@=&AI<R!S;V9T=V%R90HC
M("`@('=I=&AO=70@<W!E8VEF:6,@<')I;W(@=W)I='1E;B!P97)M:7-S:6]N
M+@HC"B,@5$A)4R!33T945T%212!)4R!04D]6241%1"!"62!42$4@4D5'14Y4
M4R!!3D0@0T].5%))0E543U)3(&!@05,@25,G)R!!3D0*(R!!3ED@15A04D53
M4R!/4B!)35!,245$(%=!4E)!3E1)15,L($E.0TQ51$E.1RP@0E54($Y/5"!,
M24U)5$5$(%1/+"!42$4*(R!)35!,245$(%=!4E)!3E1)15,@3T8@34520TA!
M3E1!0DE,2519($%.1"!&251.15-3($9/4B!!(%!!4E1)0U5,05(@4%524$]3
M10HC($%212!$25-#3$%)345$+B`@24X@3D\@159%3E0@4TA!3$P@5$A%(%)%
M1T5.5%,@3U(@0T].5%))0E543U)3($)%($Q)04),10HC($9/4B!!3ED@1$E2
M14-4+"!)3D1)4D5#5"P@24Y#241%3E1!3"P@4U!%0TE!3"P@15A%35!,05)9
M+"!/4B!#3TY315%514Y424%,"B,@1$%-04=%4R`H24Y#3%5$24Y'+"!"550@
M3D]4($Q)34E4140@5$\L(%!23T-54D5-14Y4($]&(%-50E-425155$4@1T]/
M1%,*(R!/4B!315)624-%4SL@3$]34R!/1B!54T4L($1!5$$L($]2(%!23T9)
M5%,[($]2($)54TE.15-3($E.5$524E505$E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