Moved the --append check so that files that don't need to be transferred
authorWayne Davison <wayned@samba.org>
Mon, 17 Mar 2008 00:50:28 +0000 (17:50 -0700)
committerWayne Davison <wayned@samba.org>
Mon, 17 Mar 2008 00:50:28 +0000 (17:50 -0700)
still get their non-content attributes updated, and combining --append
with --hard-links will not prevent the discovery of unchanged files.

generator.c
rsync.yo

index 909c0f4..e189ddd 100644 (file)
@@ -1743,9 +1743,6 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
                goto cleanup;
        }
 
-       if (append_mode > 0 && sx.st.st_size >= F_LENGTH(file))
-               goto cleanup;
-
        if (fnamecmp_type <= FNAMECMP_BASIS_DIR_HIGH)
                ;
        else if (fnamecmp_type == FNAMECMP_FUZZY)
@@ -1770,6 +1767,10 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
                goto cleanup;
        }
 
+       if (append_mode > 0 && sx.st.st_size >= F_LENGTH(file)) {
+               goto cleanup;
+       }
+
   prepare_to_open:
        if (partialptr) {
                sx.st = partial_st;
index 9c99645..6bbf400 100644 (file)
--- a/rsync.yo
+++ b/rsync.yo
@@ -723,9 +723,12 @@ receiving user.
 dit(bf(--append)) This causes rsync to update a file by appending data onto
 the end of the file, which presumes that the data that already exists on
 the receiving side is identical with the start of the file on the sending
-side.  Any files that are the same size or longer on the receiving side
-are skipped.  Files that do not yet exist on the receiving side are
-transferred, regardless of size.  Implies bf(--inplace),
+side.  If a file needs to be transferred and its size on the receiver is
+the same or longer than the size on the sender, the file is skipped.  This
+does not interfere with the updating of a file's non-content attributes
+(e.g. permissions, ownership, etc.) when the file does not need to be
+transferred, nor does it affect the updating of any non-regular files.
+Implies bf(--inplace),
 but does not conflict with bf(--sparse) (since it is always extending a
 file's length).