Adjust path for the upcoming 2.0 release
[dragonfly.git] / etc / periodic / weekly / 320.whatis
blobe2dfcd7de88661d64633861b9de274baed86c986
1 #!/bin/sh -
3 # $FreeBSD: src/etc/periodic/weekly/320.whatis,v 1.5.2.3 2001/03/05 13:08:37 ru Exp $
4 # $DragonFly: src/etc/periodic/weekly/320.whatis,v 1.2 2003/06/17 04:24:48 dillon Exp $
7 # If there is a global system configuration file, suck it in.
9 if [ -r /etc/defaults/periodic.conf ]
10 then
11 . /etc/defaults/periodic.conf
12 source_periodic_confs
15 case "$weekly_whatis_enable" in
16 [Yy][Ee][Ss])
17 echo ""
18 echo "Rebuilding whatis database:"
20 MANPATH=`/usr/bin/manpath -q`
21 if [ $? = 0 ]
22 then
23 if [ -z "${MANPATH}" ]
24 then
25 echo "manpath failed to find any manpage directories"
26 rc=3
27 else
28 man_locales=`/usr/bin/manpath -qL`
29 rc=0
31 # Build whatis(1) database(s) for original, non-localized
32 # manpages.
33 /usr/libexec/makewhatis.local "${MANPATH}" || rc=3
35 # Build whatis(1) database(s) for localized manpages.
36 if [ X"${man_locales}" != X ]
37 then
38 for i in ${man_locales}
40 LC_ALL=$i /usr/libexec/makewhatis.local -a \
41 -L "${MANPATH}" || rc=3
42 done
45 else
46 rc=3
47 fi;;
49 *) rc=0;;
50 esac
52 exit $rc