diff options
| author | christos <christos@NetBSD.org> | 2006-04-23 03:04:08 +0000 |
|---|---|---|
| committer | christos <christos@NetBSD.org> | 2006-04-23 03:04:08 +0000 |
| commit | 328064d112653dbf7a0ebb25c4afd2d11c9942c8 (patch) | |
| tree | c1355cdc56c3e10519c72f9c7c751a062230c49b /usr.bin/locate | |
| parent | 9225a5f961ab2a4d6c210cd0a87a4465e4eb350d (diff) | |
Redo the previous change so that we can ignore access errors from find,
but also tell when writing to the output file failed, by using a pipeline
to cat. While here change `` to $(). Otherwise this would always fail
since it is ran as nobody and therefore it cannot access some files. Reported
by smb.
Diffstat (limited to 'usr.bin/locate')
| -rw-r--r-- | usr.bin/locate/locate/updatedb.sh | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/usr.bin/locate/locate/updatedb.sh b/usr.bin/locate/locate/updatedb.sh index 5ffaaec45ad..2f4cb50131b 100644 --- a/usr.bin/locate/locate/updatedb.sh +++ b/usr.bin/locate/locate/updatedb.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# $NetBSD: updatedb.sh,v 1.10 2006/02/26 03:00:16 dyoung Exp $ +# $NetBSD: updatedb.sh,v 1.11 2006/04/23 03:04:08 christos Exp $ # # Copyright (c) 1989, 1993 # The Regents of the University of California. All rights reserved. @@ -108,7 +108,7 @@ case "$ignorefs $ignore" in *) ignore="-o $ignore";; esac -FILELIST=`mktemp -t locate.list` || exit 1 +FILELIST=$(mktemp -t locate.list) || exit 1 trap "rm -f '$FILELIST'" EXIT trap "rm -f '$FILELIST'; exit 1" INT QUIT TERM @@ -116,11 +116,13 @@ trap "rm -f '$FILELIST'; exit 1" INT QUIT TERM # Entries of each directory shall be sorted (find -s). set -f -if ! find -s ${SRCHPATHS} $lp $ignorefs $ignore $rp -print >> "$FILELIST"; then +(find -s ${SRCHPATHS} $lp $ignorefs $ignore $rp -print; true) | cat >> "$FILELIST" +if [ $? != 0 ] +then exit 1 fi -BIGRAMS=`$LIBDIR/locate.bigram <"$FILELIST"` +BIGRAMS=$($LIBDIR/locate.bigram <"$FILELIST") # code the file list if [ -z "$BIGRAMS" ]; then |
