Subject: Re: when to run makewhatis
To: None <tech-userlevel@netbsd.org>
From: Jeremy C. Reed <reed@reedmedia.net>
List: tech-userlevel
Date: 01/20/2007 10:50:01
On Sat, 20 Jan 2007, Blair Sadewitz wrote:

> I have often wondered why this is not run periodically myself.
> 
> Perhaps this is best handled by an option in rc.conf?

I'll use weekly.conf.

If nobody objects, I'll commit this in a couple days:

Index: weekly
===================================================================
RCS file: /cvsroot/src/etc/weekly,v
retrieving revision 1.21
diff -u -r1.21 weekly
--- weekly	12 Nov 2006 01:22:57 -0000	1.21
+++ weekly	20 Jan 2007 16:39:23 -0000
@@ -79,6 +79,16 @@
 	fi
 fi
 
+if checkyesno rebuild_whatisdb; then
+	echo ""
+	if `whatis whatis 2>/dev/null >/dev/null` ; then
+		echo "Rebuilding whatis databases:"
+		nice -n 5 /usr/libexec/makewhatis -f
+	else
+		echo "Not rebuilding whatis databases"
+	fi
+fi
+
 if [ -f /etc/weekly.local ]; then
 	. /etc/weekly.local > $TMP 2>&1
 	if [ -s $TMP ] ; then
Index: defaults/weekly.conf
===================================================================
RCS file: /cvsroot/src/etc/defaults/weekly.conf,v
retrieving revision 1.2
diff -u -r1.2 weekly.conf
--- defaults/weekly.conf	8 Nov 2000 23:17:50 -0000	1.2
+++ defaults/weekly.conf	20 Jan 2007 16:39:23 -0000
@@ -11,3 +11,4 @@
 
 clean_uucp=YES
 rebuild_locatedb=YES
+rebuild_whatisdb=YES



On a related note, my man.conf is updated for pkg/share/man (add 
"share/").

  Jeremy C. Reed