X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/ff43d8b4493836fd02d99fc376afe33ff22088db..76181461f582d385da73172d06532c4e4ec3f681:/testsuite/delete.test diff --git a/testsuite/delete.test b/testsuite/delete.test index 58fa82c2..8fa6035a 100644 --- a/testsuite/delete.test +++ b/testsuite/delete.test @@ -11,27 +11,47 @@ hands_setup -makepath "$chkdir" +makepath "$chkdir" "$todir/extradir" "$todir/emptydir/subdir" + +echo extra >"$todir"/remove1 +echo extra >"$todir"/remove2 +echo extra >"$todir"/extradir/remove3 +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-sent-files. -$RSYNC -av "$fromdir/" "$chkdir/copy/" +# what we expect to be left behind by the copy using --remove-source-files. +# 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" +egrep -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" +egrep -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 --remove-sent-files \ - \"$fromdir/\" \"$todir/\"" "$chkdir/copy" "$todir" +checkit "$RSYNC -avv --del --remove-source-files '$fromdir/' '$todir/'" "$chkdir/copy" "$todir" diff -r "$chkdir/empty" "$fromdir" -# Make sure that --delete-excluded does not dump a per-dir merge-file filter. +# Make sure that "P" but not "-" per-dir merge-file filters take effect with +# --delete-excluded. cat >"$todir/filters" <