Add the DragonFly cvs id and perform general cleanups on cvs/rcs/sccs ids. Most
[dragonfly.git] / etc / periodic / weekly / 330.catman
1 #!/bin/sh -
2 #
3 # $FreeBSD: src/etc/periodic/weekly/330.catman,v 1.5.2.5 2002/04/15 00:44:16 dougb Exp $
4 # $DragonFly: src/etc/periodic/weekly/330.catman,v 1.2 2003/06/17 04:24:48 dillon Exp $
5 #
6
7 # If there is a global system configuration file, suck it in.
8 #
9 if [ -r /etc/defaults/periodic.conf ]
10 then
11     . /etc/defaults/periodic.conf
12     source_periodic_confs
13 fi
14
15 case "$weekly_catman_enable" in
16     [Yy][Ee][Ss])
17         if [ ! -d /usr/share/man/cat1 ]
18         then
19             echo '$weekly_catman_enable is set but /usr/share/man/cat1' \
20                 "doesn't exist"
21             rc=2
22         else
23             echo ""
24             echo "Reformatting manual pages:"
25
26             MANPATH=`/usr/bin/manpath -q`
27             if [ $? = 0 ]
28             then
29                 if [ -z "${MANPATH}" ]
30                 then
31                     echo "manpath failed to find any manpath directories" 
32                     rc=3
33                 else
34                     man_locales=`/usr/bin/manpath -qL`
35                     rc=0
36          
37                     # Preformat original, non-localized manpages  
38                     echo /usr/libexec/catman.local "$MANPATH" |
39                         su -fm man || rc=3
40
41                     # Preformat localized manpages.
42                     if [ -n "$man_locales" ]
43                     then
44                         for i in $man_locales
45                         do
46                             echo /usr/libexec/catman.local -L \
47                                 "$MANPATH" | LC_ALL=$i su -fm man || rc=3
48                         done
49                     fi
50                 fi
51             else
52                 rc=3
53             fi
54         fi;;
55
56     *)  rc=0;;
57 esac
58
59 exit $rc