From 952ae751384aebf39e36cb0fb8d7d894dccc901d Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Sat, 14 Jul 2007 04:47:42 +0000 Subject: [PATCH] Make sure that --dry-run with --del doesn't output extraneous info when the dest directory does not exist. --- testsuite/delete.test | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/testsuite/delete.test b/testsuite/delete.test index 208ff456..077a59d8 100644 --- a/testsuite/delete.test +++ b/testsuite/delete.test @@ -20,7 +20,19 @@ echo extra >"$todir"/emptydir/subdir/remove4 # Create two chk dirs, one with a copy of the source files, and one with # what we expect to be left behind by the copy using --remove-source-files. -$RSYNC -av "$fromdir/" "$chkdir/copy/" +# Also, make sure that --dry-run --del doesn't output anything extraneous. +$RSYNC -av "$fromdir/" "$chkdir/copy/" >"$tmpdir/copy.out" 2>&1 +cat "$tmpdir/copy.out" +grep -v '^\(created directory\|sent\|total size\) ' "$tmpdir/copy.out" >"$tmpdir/copy.new" +mv "$tmpdir/copy.new" "$tmpdir/copy.out" + +$RSYNC -avn --del "$fromdir/" "$chkdir/copy2/" >"$tmpdir/copy2.out" 2>&1 || true +cat "$tmpdir/copy2.out" +grep -v '^\(created directory\|sent\|total size\) ' "$tmpdir/copy2.out" >"$tmpdir/copy2.new" +mv "$tmpdir/copy2.new" "$tmpdir/copy2.out" + +diff $diffopt "$tmpdir/copy.out" "$tmpdir/copy2.out" + $RSYNC -av -f 'exclude,! */' "$fromdir/" "$chkdir/empty/" checkit "$RSYNC -avv --del --remove-source-files \ -- 2.34.1