locate: how to prune .svn directories?

clemens fischer ino-news at spotteswoode.dnsalias.org
Sun Nov 16 18:45:19 PST 2008


Hi,

I am trying to remove all the ".svn" directories and their contents from
/var/db/locate.database.  The uncommented entries in /etc/locate.rc look
like this:

  # /etc/locate.rc -  command script for updatedb(8)
  #
  SEARCHPATHS="/"
  #
  PRUNEPATHS="/tmp /usr/tmp /var/tmp"
  PRUNEPATHS="${PRUNEPATHS} /var/db/portsnap"
  PRUNEPATHS="${PRUNEPATHS} /mnt"
  PRUNEPATHS="${PRUNEPATHS} /usr/src-test"
  #
  PRUNEPATHS="${PRUNEPATHS} '/*/.svn'"
  #
  FILESYSTEMS="ufs zfs"

pstree output looks like this:

  |-+= 06945 root sh /etc/periodic/weekly/310.locate
  | \-+- 06950 root su -fm nobody
  |   \-+= 06951 nobody su (bash)
  |     \-+- 06952 nobody /bin/sh /usr/libexec/locate.updatedb
  |       |--- 06955 nobody find -s / ! ( -fstype ufs -or -fstype zfs ) -prune -or -path /tmp -prune -or -path /usr/tmp -prune -or -path /var/tmp -prune -or -path /var/db/portsnap -prune -or -path /mnt -prune -or -path /usr/src-test -prune -or -path '/*/.svn' -prune -or -print
  |       \-+- 06956 nobody /bin/sh /usr/libexec/locate.mklocatedb -presort
  |         \--- 06958 nobody locate.code /tmp//locate8nuvNUT2eT/mklocateXYh7Vi1XUR/_mklocatedb6956.bigrams
 
As you might have guessed, this doesn't work, although running this
command[1] in a shell produces the result wanted.  What's wrong, and how
do I fix it?

[1] find /usr/src-main/ -path '/*/.svn' -prune -or -print

-c



More information about the freebsd-questions mailing list