Subject: bin/4528: makewhatis bug misses non-formatted pages
To: None <gnats-bugs@gnats.netbsd.org>
From: None <John.P.Darrow@wheaton.edu>
List: netbsd-bugs
Date: 11/17/1997 23:45:44
>Number: 4528
>Category: bin
>Synopsis: makewhatis bug misses all non-formatted (.[1-9]) pages
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: bin-bug-people (Utility Bug People)
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon Nov 17 21:50:02 1997
>Last-Modified:
>Originator: John Darrow
>Organization:
Computing Services
Wheaton College, Wheaton, IL
>Release: NetBSD-current sup as of November 17, 1997
>Environment:
System: NetBSD jdarrow.wheaton.edu 1.3_ALPHA NetBSD 1.3_ALPHA (JDARROW) #0: Mon Nov 17 18:20:45 CST 1997 jdarrow@jdarrow.wheaton.edu:/var/src/sys/arch/i386/compile/JDARROW i386
make build from sup 19971117 completed shortly before this bug was found
>Description:
Due to a misplaced '>' vs. '>>', makewhatis misses all man pages
that are not pre-formatted (i.e. all .[1-9] pages).
>How-To-Repeat:
Install a program that includes unformatted man pages in
/usr/local/man/man*.
/usr/libexec/makewhatis /usr/local/man
notice that man -k program returns 'program: nothing appropriate'
>Fix:
diff -u /usr/src/libexec/makewhatis/makewhatis.sh.old /usr/src/libexec/makewhatis/makewhatis.sh
--- /usr/src/libexec/makewhatis/makewhatis.sh.old Tue Nov 11 07:41:40 1997
+++ /usr/src/libexec/makewhatis/makewhatis.sh Mon Nov 17 23:09:34 1997
@@ -21,12 +21,12 @@
sort -n | awk '{if (u[$1]) next; u[$1]++ ; print $11}' > $LIST
egrep '\.[1-9]$' $LIST | xargs /usr/libexec/getNAME | \
- sed -e 's/ [a-zA-Z0-9]* \\-/ -/' >> $TMP
+ sed -e 's/ [a-zA-Z0-9]* \\-/ -/' > $TMP
egrep '\.0$' $LIST | while read file
do
sed -n -f /usr/share/man/makewhatis.sed $file;
-done > $TMP
+done >> $TMP
egrep '\.[0].(gz|Z)$' $LIST | while read file
do
>Audit-Trail:
>Unformatted: