Make a local-copy caused by a not-quite-up-to-date --compare-dest
authorWayne Davison <wayned@samba.org>
Fri, 1 Apr 2005 18:12:22 +0000 (18:12 +0000)
committerWayne Davison <wayned@samba.org>
Fri, 1 Apr 2005 18:12:22 +0000 (18:12 +0000)
or --link-dest file be output as a 'c' (local change) when itemizing
or as transfered file when not itemizing.

generator.c

index ec0e04d..98313e3 100644 (file)
@@ -923,8 +923,25 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
                                        }
                                        match_level = 0;
                                        statret = -1;
-                               } else
-                                       set_perms(fname, file, NULL, 0);
+                               } else {
+                                       if (itemizing) {
+                                               itemize(file, ndx, 0, &st,
+                                                       ITEM_LOCAL_CHANGE, 0,
+                                                       NULL);
+                                       } else if (verbose && code) {
+                                               rprintf(code, "%s\n",
+                                                       safe_fname(fname));
+                                       }
+                                       set_perms(fname, file, NULL,
+                                                 maybe_PERMS_REPORT);
+                                       if (preserve_hard_links
+                                           && file->link_u.links) {
+                                               hard_link_cluster(file, ndx,
+                                                                 itemizing,
+                                                                 code);
+                                       }
+                                       return;
+                               }
                        } else if (compare_dest || match_level == 1) {
                                fnamecmp = fnamecmpbuf;
                                fnamecmp_type = i;