320.whatis revision 51173
1#!/bin/sh -
2#
3# $FreeBSD: head/etc/periodic/weekly/320.whatis 51173 1999-09-11 18:55:02Z ache $
4#
5
6if [ -x /usr/libexec/makewhatis.local -a -x /usr/bin/manpath ]; then
7
8    echo ""
9    echo "Rebuilding whatis database:"
10
11    MANPATH=`/usr/bin/manpath -q`
12    if [ $? = 0 ]; then
13	if [ "x${MANPATH}" = "x" ]; then
14	    echo "manpath failed to find any manpage directories"
15	else
16            # If possible, check global system configuration file
17	    # for additional man(1) locales installed
18	    if [ -r /etc/defaults/rc.conf ]; then
19		. /etc/defaults/rc.conf
20	    elif [ -r /etc/rc.conf ]; then
21		. /etc/rc.conf
22	    fi
23
24            # Build whatis(1) database(s) for original, non-localized  manpages.
25	    /usr/libexec/makewhatis.local "${MANPATH}"
26
27            # Build whatis(1) database(s) for localized manpages.
28	    if [ "x${man_locales}" != "x" -a "${man_locales}" != "NO" ]; then
29		for i in ${man_locales}
30		do
31		   LC_CTYPE=$i /usr/libexec/makewhatis.local -a -L "${MANPATH}"
32		done
33	    fi
34	fi
35    fi
36fi
37