128263Spst#!/bin/sh - 228263Spst# 350472Speter# $FreeBSD: releng/10.2/etc/periodic/weekly/320.whatis 73349 2001-03-02 16:52:14Z ru $ 428263Spst# 528263Spst 661981Sbrian# If there is a global system configuration file, suck it in. 761981Sbrian# 861981Sbrianif [ -r /etc/defaults/periodic.conf ] 961981Sbrianthen 1061981Sbrian . /etc/defaults/periodic.conf 1161981Sbrian source_periodic_confs 1261981Sbrianfi 1328263Spst 1461981Sbriancase "$weekly_whatis_enable" in 1561981Sbrian [Yy][Ee][Ss]) 1665843Sbrian echo "" 1765843Sbrian echo "Rebuilding whatis database:" 1865843Sbrian 1965843Sbrian MANPATH=`/usr/bin/manpath -q` 2065843Sbrian if [ $? = 0 ] 2161981Sbrian then 2265843Sbrian if [ -z "${MANPATH}" ] 2361981Sbrian then 2465843Sbrian echo "manpath failed to find any manpage directories" 2565843Sbrian rc=3 2665843Sbrian else 2765843Sbrian man_locales=`/usr/bin/manpath -qL` 2865843Sbrian rc=0 2951173Sache 3065843Sbrian # Build whatis(1) database(s) for original, non-localized 3165843Sbrian # manpages. 3265843Sbrian /usr/libexec/makewhatis.local "${MANPATH}" || rc=3 3351173Sache 3465843Sbrian # Build whatis(1) database(s) for localized manpages. 3565843Sbrian if [ X"${man_locales}" != X ] 3665843Sbrian then 3765843Sbrian for i in ${man_locales} 3865843Sbrian do 3973349Sru LC_ALL=$i /usr/libexec/makewhatis.local -a \ 4065843Sbrian -L "${MANPATH}" || rc=3 4165843Sbrian done 4261981Sbrian fi 4351173Sache fi 4465843Sbrian else 4565843Sbrian rc=3 4661981Sbrian fi;; 4765843Sbrian 4865843Sbrian *) rc=0;; 4961981Sbrianesac 5065843Sbrian 5165843Sbrianexit $rc 52