Subject: Re: Let "locate" search/index network volumes, too?
To: Frederick Bruckman <fredb@immanent.net>
From: Robert Elz <kre@munnari.OZ.AU>
List: tech-userlevel
Date: 02/02/2004 22:49:52
    Date:        Mon, 2 Feb 2004 08:52:26 -0600 (CST)
    From:        Frederick Bruckman <fredb@immanent.net>
    Message-ID:  <Pine.NEB.4.58.0402020810120.204@seduction.immanent.net>

  | Below are my patches to make the locate database construction
  | configurable in "/etc/weekly.conf".

Looks nice - would be nicer if there was an easy way to change where
the temp files go during the sort (on some of my systems the lists
are so big that /var/tmp just can't cope).   Sort can be told to
use someplace else, but getting this info into updatedb via weekly and
cron isn't trivial (as in, it isn't hard to do, but means modifying
things that shouldn't need to be modified).

  | The settings look like this:
  | 
  | rebuild_locatedb=YES locatedb_flags="-local +cd9660 +fdesc +kernfs +procfs"

I think you have - and + backwards, for most people, '-' would mean subtract,
or leave out, and '+' add in, or include, having them the other way around for
no particularly good reason is just confusing.


  | +while [ $# -ne 0 ]; do
  | +    if [ x"${1##-*}" = x ]; then
  | +	set -A fs_dash -- ${fs_dash[@]} -and ! -fstype ${1#-}
  | +    elif [ x"${1##+*}" = x ]; then
  | +	set -A fs_plus -- ${fs_plus[@]} -or -fstype ${1#+}
  | +    else
  | +	set -A dir -- ${dir[@]} ${1}
  | +    fi
  | +    shift
  | +done

This is all very pretty fancy code, using sh features in nice
ways, but, but wouldn't it be simpler to just do

while [ $# -ne 0 ]; do		# or "-gt 0" just to be safe...
	case "$1" in
	-*)	set ... ;;
	+*)	set ... ;;
	 *)	set ... ;;
	esac
	shift
done

??

kre