use the updated getNAME(8) now that it has a reasonable output. this
makes makewhatis several orders of magnitude faster for manual sources, as we now avoid a costly `nroff -mandoc' for each one...
This commit is contained in:
parent
ef53ad130b
commit
3f5509a860
|
@ -1,4 +1,4 @@
|
|||
.\" $NetBSD: makewhatis.8,v 1.2 1997/10/20 02:41:18 enami Exp $
|
||||
.\" $NetBSD: makewhatis.8,v 1.3 1997/11/01 15:06:09 mrg Exp $
|
||||
.\"
|
||||
.\" Copyright (c) 1997 The NetBSD Foundation, Inc.
|
||||
.\" All rights reserved.
|
||||
|
@ -63,11 +63,13 @@ Man pages compressed with
|
|||
and
|
||||
.Xr gzip 1
|
||||
are uncompressed before processing, unformatted man pages
|
||||
will be formatted on the fly.
|
||||
will be processed by
|
||||
.Xr getNAME 8 .
|
||||
.Sh BUGS
|
||||
.Nm
|
||||
should find its search paths using /etc/man.conf
|
||||
.Sh SEE ALSO
|
||||
.Xr getNAME 8 ,
|
||||
.Xr man 1 ,
|
||||
.Xr man.conf 5
|
||||
.Sh AUTHOR
|
||||
|
|
|
@ -1,45 +1,37 @@
|
|||
#! /bin/sh
|
||||
#
|
||||
# Written by J.T. Conklin <jtc@netbsd.org>.
|
||||
#
|
||||
# Little addons to handle also linked and unformated man pages
|
||||
# by Thorsten Frueauf <frueauf@ira.uka.de>.
|
||||
# written by matthew green <mrg@eterna.com.au>, based on the
|
||||
# original by J.T. Conklin <jtc@netbsd.org> and Thorsten
|
||||
# Frueauf <frueauf@ira.uka.de>.
|
||||
#
|
||||
# Public domain.
|
||||
#
|
||||
|
||||
trap "rm -f /tmp/whatis$$; exit 1" 1 2 15
|
||||
trap "rm -f /tmp/makewhatislist$$ /tmp/whatis$$; exit 1" 1 2 15
|
||||
|
||||
MANDIR=${1-/usr/share/man}
|
||||
LIST=/tmp/makewhatislist$$
|
||||
TMP=/tmp/whatis$$
|
||||
if test ! -d "$MANDIR"; then
|
||||
echo "makewhatis: $MANDIR: not a directory"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
find $MANDIR \( -type f -or -type l \) -name '*.0' -print | while read file
|
||||
find $MANDIR \( -type f -or -type l \) -name '*.[0-9]*' -print > $LIST
|
||||
|
||||
egrep '\.0$' $LIST | while read file
|
||||
do
|
||||
sed -n -f /usr/share/man/makewhatis.sed $file;
|
||||
done > /tmp/whatis$$
|
||||
done > $TMP
|
||||
|
||||
find $MANDIR \( -type f -or -type l \) -name '*.[1-9]' -print | while read file
|
||||
do
|
||||
nroff -man $file | sed -n -f /usr/share/man/makewhatis.sed;
|
||||
done >> /tmp/whatis$$
|
||||
egrep '\.[1-9]$|\.[1-9]?$' $LIST | xargs /usr/libexec/getNAME | \
|
||||
sed -e 's/ [a-zA-Z0-9]* \\-/ -/' >> $TMP
|
||||
|
||||
find $MANDIR \( -type f -or -type l \) -name '*.[1-9]?' -print | while read file
|
||||
do
|
||||
nroff -man $file | sed -n -f /usr/share/man/makewhatis.sed;
|
||||
done >> /tmp/whatis$$
|
||||
|
||||
find $MANDIR \( -type f -or -type l \) -name '*.0.Z' -print | while read file
|
||||
do
|
||||
zcat $file | sed -n -f /usr/share/man/makewhatis.sed;
|
||||
done >> /tmp/whatis$$
|
||||
|
||||
find $MANDIR \( -type f -or -type l \) -name '*.0.gz' -print | while read file
|
||||
egrep '\.[0].(gz|Z)$' $LIST | while read file
|
||||
do
|
||||
gzip -fdc $file | sed -n -f /usr/share/man/makewhatis.sed;
|
||||
done >> /tmp/whatis$$
|
||||
done >> $TMP
|
||||
|
||||
sort -u -o /tmp/whatis$$ /tmp/whatis$$
|
||||
|
||||
|
|
Loading…
Reference in New Issue