+cat <<EOT >"$chkfile"
+.f...p$dots foo/config1
+>f..t.$dots foo/config2
+EOT
+diff $diffopt "$chkfile" "$outfile" || test_fail "test 7 failed"
+
+$RSYNC -ivvplrtH --copy-dest=../to "$fromdir/" "$to2dir/" \
+ | tee "$outfile"
+filter_outfile
+case `tail -1 "$outfile"` in
+cLc.t*)
+ sym_dots="c.t.$dots"
+ L_sym_dots="cL$sym_dots"
+ is_uptodate='-> ../bar/baz/rsync'
+ echo "cL$sym_dots foo/sym $is_uptodate" >"$chkfile.extra"
+ L=cL
+ ;;
+*)
+ sym_dots="$allspace"
+ L_sym_dots=".L$allspace"
+ is_uptodate='is uptodate'
+ touch "$chkfile.extra"
+ ;;
+esac
+cat <<EOT >"$chkfile"
+cd$allspace ./
+cd$allspace bar/
+cd$allspace bar/baz/
+cf$allspace bar/baz/rsync
+cd$allspace foo/
+cf$allspace foo/config1
+cf$allspace foo/config2
+hf$allspace foo/extra => foo/config1
+cL$sym_dots foo/sym -> ../bar/baz/rsync
+EOT
+diff $diffopt "$chkfile" "$outfile" || test_fail "test 8 failed"
+
+rm -rf "$to2dir"
+$RSYNC -iplrtH --copy-dest=../to "$fromdir/" "$to2dir/" \
+ | tee "$outfile"
+cat - "$chkfile.extra" <<EOT >"$chkfile"
+hf$allspace foo/extra => foo/config1
+EOT
+diff $diffopt "$chkfile" "$outfile" || test_fail "test 9 failed"
+
+rm -rf "$to2dir"
+$RSYNC -vvplrtH --copy-dest="$todir" "$fromdir/" "$to2dir/" \
+ | tee "$outfile"
+filter_outfile
+cat <<EOT >"$chkfile"
+./ is uptodate
+bar/ is uptodate
+bar/baz/ is uptodate
+bar/baz/rsync is uptodate
+foo/ is uptodate
+foo/config1 is uptodate
+foo/config2 is uptodate
+foo/sym $is_uptodate
+foo/extra => foo/config1
+EOT
+diff $diffopt "$chkfile" "$outfile" || test_fail "test 10 failed"
+
+rm -rf "$to2dir"
+$RSYNC -ivvplrtH --link-dest="$todir" "$fromdir/" "$to2dir/" \
+ | tee "$outfile"
+filter_outfile
+cat <<EOT >"$chkfile"
+cd$allspace ./
+cd$allspace bar/
+cd$allspace bar/baz/
+hf$allspace bar/baz/rsync
+cd$allspace foo/
+hf$allspace foo/config1
+hf$allspace foo/config2
+hf$allspace foo/extra => foo/config1
+$L$sym_dots foo/sym -> ../bar/baz/rsync
+EOT
+diff $diffopt "$chkfile" "$outfile" || test_fail "test 11 failed"
+
+rm -rf "$to2dir"
+$RSYNC -iplrtH --dry-run --link-dest=../to "$fromdir/" "$to2dir/" \
+ | tee "$outfile"
+cat - "$chkfile.extra" <<EOT >"$chkfile"
+EOT
+diff $diffopt "$chkfile" "$outfile" || test_fail "test 12 failed"
+
+rm -rf "$to2dir"
+$RSYNC -iplrtH --link-dest=../to "$fromdir/" "$to2dir/" \
+ | tee "$outfile"
+cat - "$chkfile.extra" <<EOT >"$chkfile"
+EOT
+diff $diffopt "$chkfile" "$outfile" || test_fail "test 13 failed"
+
+rm -rf "$to2dir"
+$RSYNC -vvplrtH --link-dest="$todir" "$fromdir/" "$to2dir/" \
+ | tee "$outfile"
+filter_outfile
+cat <<EOT >"$chkfile"
+./ is uptodate
+bar/ is uptodate
+bar/baz/ is uptodate
+bar/baz/rsync is uptodate
+foo/ is uptodate
+foo/config1 is uptodate
+foo/config2 is uptodate
+foo/extra is uptodate
+foo/sym $is_uptodate