Subject: Re: bin/8176: locate does not support alternate databases
To: None <tech-userlevel@netbsd.org>
From: Simon J. Gerraty <sjg@quick.com.au>
List: tech-userlevel
Date: 08/11/1999 00:46:35
I trust this is an appropriate forum to solicit feedback on
PR bin/8176 which is a change request for adding support for multiple
databases to our locate(1).  I actually followed up with a patch of my
initial implementation - which I've since re-worked to use the
queue(3) macros.

Essentially our locate(1) has a single fixed database that it
searches and it only allows a single search pattern.

It should be possible for users to create a private database - eg
contents of their $HOME and to use locate(1) to search it.

The semantics that I've implemented are much the same as GNU's locate
which supports a couple of mechanisms for providing this feature;
namely $LOCATE_PATH and command line switch -d dbpath and a long
version (--dbpath or something) which I chose to ignore.

Further, I treat an empty component in the LOCATE_PATH as refering to
the default database.  So LOCATE_PATH=$HOME/db/locate.db: would cause
the modified locate(1) to search $HOME/db/locate.db followed by the
default database without the user needing to know where it is.

And finally the updated locate searches each database for each search
pattern on the command line.

Finally, our current locate(1) exit's with a successful status even if
no match is found.  I've not implemeted it yet, but it would seem
appropriate to exit 0 only if a match was found?  That is what GNU
locate does.

I'm not subscribed to this list, so pls cc me if you wish to express
an opinion.

--sjg