[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
excluding .svn and symlinks from locate db
From: |
Karl Berry |
Subject: |
excluding .svn and symlinks from locate db |
Date: |
Mon, 24 Mar 2008 12:14:23 -0500 |
Hi James,
As I wrote some time ago, I like to exclude .svn files and symbolic
links from the locate database (otherwise I'd have massive duplication
of hits).
Would you consider adding hooks to make this possible with the
distributed version? I believe it would amount to two new environment
variables, one to allow for more stuff inside the prune expression, and
one to allow for more predicates outside. Of course they'd be empty by
default.
The diff below (between stock 4.4.0 and the derived script that I
actually run) gives the flavor, although of course for any distributed
patch it would be generalized. If you're amenable to the idea, I could
work on a real patch. Wdyt?
Thanks,
Karl
*** /usr/local/gnu/bin/updatedb Mon Mar 24 09:07:06 2008
--- /l/etc/updatedb Mon Mar 24 08:57:54 2008
***************
*** 110,114 ****
then
sort="/usr/local/gnu/bin/sort -z"
! print_option="-print0"
frcode_options="$frcode_options -0"
else
--- 110,114 ----
then
sort="/usr/local/gnu/bin/sort -z"
! print_option="-type f -print0"
frcode_options="$frcode_options -0"
else
***************
*** 253,262 ****
su $LOCALUSER `select_shell $LOCALUSER` -c \
"$find $SEARCHPATHS $FINDOPTIONS \
! \\( $prunefs_exp \
-type d -regex '$PRUNEREGEX' \\) -prune -o $print_option"
else
# : A2
$find $SEARCHPATHS $FINDOPTIONS \
! \( $prunefs_exp \
-type d -regex "$PRUNEREGEX" \) -prune -o $print_option
fi
--- 253,262 ----
su $LOCALUSER `select_shell $LOCALUSER` -c \
"$find $SEARCHPATHS $FINDOPTIONS \
! \\( $prunefs_exp -type l -o \
-type d -regex '$PRUNEREGEX' \\) -prune -o $print_option"
else
# : A2
$find $SEARCHPATHS $FINDOPTIONS \
! \( $prunefs_exp -type l -o \
-type d -regex "$PRUNEREGEX" \) -prune -o $print_option
fi
***************
*** 322,331 ****
su $LOCALUSER `select_shell $LOCALUSER` -c \
"$find $SEARCHPATHS $FINDOPTIONS \
! \( $prunefs_exp \
-type d -regex '$PRUNEREGEX' \) -prune -o $print_option" || exit $?
else
# : A6
$find $SEARCHPATHS $FINDOPTIONS \
! \( $prunefs_exp \
-type d -regex "$PRUNEREGEX" \) -prune -o $print_option || exit $?
fi
--- 322,331 ----
su $LOCALUSER `select_shell $LOCALUSER` -c \
"$find $SEARCHPATHS $FINDOPTIONS \
! \( $prunefs_exp -type l -o \
-type d -regex '$PRUNEREGEX' \) -prune -o $print_option" || exit $?
else
# : A6
$find $SEARCHPATHS $FINDOPTIONS \
! \( $prunefs_exp -type l -o \
-type d -regex "$PRUNEREGEX" \) -prune -o $print_option || exit $?
fi
- excluding .svn and symlinks from locate db,
Karl Berry <=