Codebase list metche / c1f20bb
TAR_OPTS should now work fine: used noglob shell option where appropriate to prevent it from being expanded by bash before it's given to tar intrigeri 18 years ago
1 changed file(s) with 8 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
239239 # This will save an archive of the watched directory with the given prefix
240240 save_files() {
241241 debug " - save_files $@"
242 set -o noglob
242243 tar jcf "$BACKUP_DIR/$1-$DATE".tar.bz2 \
243 -C "$WATCHED_PARENT" $TAR_OPTS `basename "$WATCHED_DIR"`
244 -C "$WATCHED_PARENT" $TAR_OPTS `basename "$WATCHED_DIR"`
245 set +o noglob
244246 ln -sf "$1-$DATE".tar.bz2 "$BACKUP_DIR/$1"-latest.tar.bz2
245247 }
246248
318320 echo "$FILES_HEADER" >> "$tmp"
319321
320322 # Find differences with tar
323 set -o noglob
321324 tar_diff=$(tar jdf "$BACKUP_DIR/$1".tar.bz2 \
322325 -C "$WATCHED_PARENT" $TAR_OPTS 2>&1 |
323326 # transform:
330333 # Only in test/etc: issue -> test/etc/issue
331334 sed -n -e "s,^Only in $WATCHED_PARENT\([^:]*\): \(.*\),\1/\2,p")
332335 files="`echo "$tar_diff$diff_diff" | sort -u`"
336 set +o noglob
333337 if [ -z "$files" ]; then
334338 echo "$_NO_CHANGE" >> "$tmp"
335339 else
366370 echo "$FILES_DETAILS_HEADER" >> "$tmp"
367371
368372 # Just diff it!
369 if (LC_ALL=$LOCALE diff -urBN $TAR_OPTS \
373 set -o noglob
374 if (LC_ALL=$LOCALE diff -urBN $TAR_ObPTS \
370375 --minimal "$tmpdir"/`basename "$WATCHED_DIR"` \
371376 "$WATCHED_DIR" 2>/dev/null); then
372377 echo "$_NO_CHANGE"
373378 fi | grep -v '^--- \|diff ' |
374379 sed -e "s;^+++ $WATCHED_PARENT\([^ ]*\) .*;+++ \1;" \
375380 >> "$tmp"
381 set +o noglob
376382 fi
377383
378384 # Put on standard output