On 8/11/06, Karl Berry <[EMAIL PROTECTED]> wrote:
Hi James and all,I'd like to limit updatedb to indexing files, or at least not index symlinks. However, the way the script is written, I don't see a way to make it happen. Using --findoptions='-type f' puts that at the beginning of the eventual find command (findutils 4.2.28, GNU/Linux, not that it matters), so updatedb executes find / -type f '(' -fstype nfs ... ')' -prune -o -print0 which of course makes the prune ineffective, as far as I can see.
You're right. There may be a bug in find 4.3.x relating to using -prune on files, too.
So I wonder about adding yet another option/envvar to allow prepending args before the -print[0]? --printoptions? --afterprune?
For now, I would recommend editing the updatedbshell script. In the longer term, perhaps we should have separate options for criteria to include a file, and criteria to exclude it, both added after the -prune. In a week or two I will be contemplating replacing the current updatedb shell script with something else. It'd be either another shell script or perhaps a binary. So this is exactly the right time to complain or comment about ways in which the existing implementation is unsatisfactory.
Another way (not mutually exclusive) would be to add a general --pruneoptions, and stick in its value just before the closing ')'. Then updatedb --pruneoptions='-type -l -o -type d' would get the job done well enough. I've wanted to specify general pruning in other circumstances too. BTW, the Invoking updatedb node could use some examples :). It also seems like a lot of that node could be usefully included in the --help output.
Noted - and thanks for the suggestion. Any problems that you think are serious enough to need to be fixed (i.e. any problem worth your time to write an email about, so that includes this one) could usefully be added to the Savannah bugs list so that we don't forget to fix it. James. _______________________________________________ Bug-findutils mailing list [email protected] http://lists.gnu.org/mailman/listinfo/bug-findutils
