mirror of
https://github.com/RsyncProject/rsync.git
synced 2026-03-27 10:41:47 -04:00
Avoid spurious "is newer" messages with --update.
This commit is contained in:
4
NEWS.md
4
NEWS.md
@@ -9,6 +9,10 @@
|
||||
- Fix a bug with `--mkpath` if a single-file copy specifies an existing
|
||||
destination dir with a non-existing destination filename.
|
||||
|
||||
- Fix `--update -vv` to output "is uptodate" instead of "is newer" messages
|
||||
for files that are being skipped due to an identical modify time. (This
|
||||
was a new output quirk in 3.2.3.)
|
||||
|
||||
- Avoid a weird failure if you run a local copy with a (useless) `--rsh`
|
||||
option that contains a `V`.
|
||||
|
||||
|
||||
@@ -1703,7 +1703,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (update_only > 0 && statret == 0 && file->modtime - sx.st.st_mtime <= modify_window) {
|
||||
if (update_only > 0 && statret == 0 && file->modtime - sx.st.st_mtime < modify_window) {
|
||||
if (INFO_GTE(SKIP, 1))
|
||||
rprintf(FINFO, "%s is newer\n", fname);
|
||||
#ifdef SUPPORT_HARD_LINKS
|
||||
|
||||
@@ -118,7 +118,8 @@ ln -s too "$fromdir/bar/down/to/foo/sym"
|
||||
|
||||
# Start to prep an --update test dir
|
||||
mkdir "$scratchdir/up1" "$scratchdir/up2"
|
||||
touch "$scratchdir/up1/older" "$scratchdir/up2/newer"
|
||||
touch "$scratchdir/up1/dst-newness" "$scratchdir/up2/src-newness"
|
||||
touch "$scratchdir/up1/same-newness" "$scratchdir/up2/same-newness"
|
||||
touch "$scratchdir/up1/extra-src" "$scratchdir/up2/extra-dest"
|
||||
|
||||
# Create chkdir with what we expect to be excluded.
|
||||
@@ -133,7 +134,7 @@ rm "$chkdir"/bar/down/to/foo/to "$chkdir"/bar/down/to/foo/file[235-9]
|
||||
rm "$chkdir"/mid/for/foo/extra
|
||||
|
||||
# Finish prep for the --update test (run last)
|
||||
touch "$scratchdir/up1/newer" "$scratchdir/up2/older"
|
||||
touch "$scratchdir/up1/src-newness" "$scratchdir/up2/dst-newness"
|
||||
|
||||
# Un-tweak the directory times in our first (weak) exclude test (though
|
||||
# it's a good test of the --existing option).
|
||||
@@ -227,11 +228,14 @@ checkit "$RSYNC -avv $relative_opts --exclude='$fromdir/foo/down' \
|
||||
'$fromdir/foo' '$todir'" "$chkdir$fromdir/foo" "$todir$fromdir/foo"
|
||||
|
||||
# Now we'll test the --update option.
|
||||
$RSYNC -aiO --update touch "$scratchdir/up1/" "$scratchdir/up2/" \
|
||||
$RSYNC -aiiO --update --info=skip "$scratchdir/up1/" "$scratchdir/up2/" \
|
||||
| tee "$outfile"
|
||||
cat <<EOT >"$chkfile"
|
||||
dst-newness is newer
|
||||
.d ./
|
||||
>f$all_plus extra-src
|
||||
>f..t.$dots newer
|
||||
.f$allspace same-newness
|
||||
>f..t.$dots src-newness
|
||||
EOT
|
||||
diff $diffopt "$chkfile" "$outfile" || test_fail "--update test failed"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user