diff -bru findutils-4.1.7-new/locate/updatedb.sh findutils-4.1.7-new2/locate/updatedb.sh --- findutils-4.1.7-new/locate/updatedb.sh Tue Jul 3 22:38:05 2001 +++ findutils-4.1.7-new2/locate/updatedb.sh Tue Jul 3 23:53:52 2001 @@ -61,9 +61,8 @@ # Directories to not put in the database, which would otherwise be. : ${PRUNEPATHS="/tmp /usr/tmp /var/tmp /afs"} -# The same, in the form of a regex that find can use. -test -z "$PRUNEREGEX" && - PRUNEREGEX=`echo $PRUNEPATHS|sed -e 's,^,\\\(^,' -e 's, ,$\\\)\\\|\\\(^,g' -e 's,$,$\\\),'` +# The same, in the form that find can use. +prunepath_exp=`echo $PRUNEPATHS|sed -e 's/\([^ ][^ ]*\)/-o -path \1/g' -e 's/-o //'` # The database file to build. : address@hidden@} @@ -118,20 +117,20 @@ su $LOCALUSER -c \ "$find $SEARCHPATHS \ \\( $prunefs_exp \ - -type d -regex '$PRUNEREGEX' \\) -prune -o -print0" + -type d $prunepath_exp \\) -prune -o -print0" else $find $SEARCHPATHS \ \( $prunefs_exp \ - -type d -regex "$PRUNEREGEX" \) -prune -o -print0 + -type d $prunepath_exp \) -prune -o -print0 fi fi if test -n "$NETPATHS"; then if [ "`whoami`" = root ]; then su $NETUSER -c \ - "$find $NETPATHS \\( -type d -regex '$PRUNEREGEX' -prune \\) -o -print0" + "$find $NETPATHS \\( -type d $prunepath_exp -prune \\) -o -print0" else - $find $NETPATHS \( -type d -regex "$PRUNEREGEX" -prune \) -o -print0 + $find $NETPATHS \( -type d $prunepath_exp -prune \) -o -print0 fi fi } | sort -f -z | $frcode > $LOCATE_DB.n @@ -171,20 +170,20 @@ su $LOCALUSER -c \ "$find $SEARCHPATHS \ \( $prunefs_exp \ - -type d -regex '$PRUNEREGEX' \) -prune -o -print" + -type d $prunepath_exp \) -prune -o -print" else $find $SEARCHPATHS \ \( $prunefs_exp \ - -type d -regex "$PRUNEREGEX" \) -prune -o -print + -type d $prunepath_exp \) -prune -o -print fi fi if test -n "$NETPATHS"; then if [ "`whoami`" = root ]; then su $NETUSER -c \ - "$find $NETPATHS \\( -type d -regex '$PRUNEREGEX' -prune \\) -o -print" + "$find $NETPATHS \\( -type d $prunepath_exp -prune \\) -o -print" else - $find $NETPATHS \( -type d -regex "$PRUNEREGEX" -prune \) -o -print + $find $NETPATHS \( -type d $prunepath_exp -prune \) -o -print fi fi } | tr / '\001' | sort -f | tr '\001' / > $filelist