Package list metche / 50fc67f
Ignore changes to $WATCHED_DIR itself. This fixes the dreaded "sometimes sends empty reports" bug metche has had since forever. Implementation-wise, this requires making $FIND_OPTS initialized in context_config, as $WATCHED_DIR changes depending on the context (host or VServer). Closes: https://labs.riseup.net/code/issues/3933 intrigeri 9 years ago
1 changed file(s) with 16 addition(s) and 9 deletion(s). Raw diff Collapse all Expand all
255255 done
256256 set +o noglob
257257
258 # How to use $FIND_OPTS:
259 # - $FIND_OPTS should appear unquoted between:
260 # . the (optional) target files and directories
261 # . the (compulsory) action, such as -print or -exec
262 # - 'set -o noglob' has to be run before any $FIND_OPTS use
263 # - 'set +o noglob' has to be run after any $FIND_OPTS use
264 FIND_OPTS=""
258 # How to use $_FIND_OPTS:
259 # - 'set -o noglob' has to be run before any $_FIND_OPTS use
260 # - 'set +o noglob' has to be run after any $_FIND_OPTS use
261 _FIND_OPTS=""
265262 set -o noglob
266 # DO NOT fix me: the final -or at the end of $FIND_OPTS is really needed
263 # DO NOT fix me: the final -or at the end of $_FIND_OPTS is really needed
267264 for pattern in $EXCLUDES; do
268 FIND_OPTS="$FIND_OPTS -path */$pattern -prune -or"
265 _FIND_OPTS="$_FIND_OPTS -path */$pattern -prune -or"
269266 done
270267 set +o noglob
271268
347344 # Check the existence of WATCHED_DIR
348345 test -d "$WATCHED_DIR" || \
349346 fatal "$WATCHED_DIR directory (built from WATCHED_DIR) does not exist."
347
348 # Initialize $FIND_OPTS -- how to use it:
349 # - 'set -o noglob' has to be run before any $FIND_OPTS use
350 # - 'set +o noglob' has to be run after any $FIND_OPTS use
351 # - $FIND_OPTS should appear unquoted between:
352 # . the (optional) target files and directories
353 # . the (compulsory) action, such as -print or -exec
354 set -o noglob
355 FIND_OPTS="-path $WATCHED_DIR -or $_FIND_OPTS"
356 set +o noglob
350357
351358 # Initialize WATCHED_PARENT
352359 WATCHED_PARENT=`dirname $WATCHED_DIR`