The local copy we do for --compare-dest simplifies the logic near
authorWayne Davison <wayned@samba.org>
Thu, 3 Mar 2005 00:28:03 +0000 (00:28 +0000)
committerWayne Davison <wayned@samba.org>
Thu, 3 Mar 2005 00:28:03 +0000 (00:28 +0000)
the main unchanged_file() call.

copy-dest.diff

index 091e29c..a0d9753 100644 (file)
@@ -2,8 +2,8 @@ This adds the option --copy-dest, which works just like --link-dest
 except that identical files are copied into the destination instead
 of hard-linked.
 
---- orig/generator.c   2005-03-02 17:48:47
-+++ generator.c        2005-03-02 17:30:18
+--- orig/generator.c   2005-03-03 00:14:56
++++ generator.c        2005-03-03 00:25:59
 @@ -65,6 +65,7 @@ extern int always_checksum;
  extern char *partial_dir;
  extern char *basis_dir[];
@@ -12,7 +12,7 @@ of hard-linked.
  extern int link_dest;
  extern int whole_file;
  extern int local_server;
-@@ -831,6 +832,8 @@ static void recv_generator(char *fname, 
+@@ -824,6 +825,8 @@ static void recv_generator(char *fname, 
                                        continue;
                                best_match = i;
                                match_level = 2;
@@ -21,7 +21,7 @@ of hard-linked.
                                /* FALL THROUGH */
                        case 2:
                                if (!unchanged_attrs(file, &st))
-@@ -863,7 +866,20 @@ static void recv_generator(char *fname, 
+@@ -857,7 +860,20 @@ static void recv_generator(char *fname, 
                                match_level = 2;
                        }
  #endif
@@ -43,6 +43,21 @@ of hard-linked.
                                fnamecmp = fnamecmpbuf;
                                fnamecmp_type = i;
                        }
+@@ -935,11 +951,9 @@ static void recv_generator(char *fname, 
+                       return;
+               }
+               /* Only --compare-dest gets here. */
+-              if (unchanged_attrs(file, &st)) {
+-                      itemize(file, statret, &st, ITEM_NO_DEST_AND_NO_UPDATE,
+-                              f_out, ndx);
+-                      return;
+-              }
++              itemize(file, statret, &st, ITEM_NO_DEST_AND_NO_UPDATE,
++                      f_out, ndx);
++              return;
+       }
+ prepare_to_open:
 --- orig/options.c     2005-03-02 09:52:06
 +++ options.c  2005-03-02 10:05:21
 @@ -143,6 +143,7 @@ char *backup_dir = NULL;
@@ -102,7 +117,7 @@ of hard-linked.
                return 0;
        }
  
---- orig/rsync.yo      2005-03-02 08:52:45
+--- orig/rsync.yo      2005-03-02 18:01:33
 +++ rsync.yo   2005-02-23 02:05:34
 @@ -353,6 +353,7 @@ to the detailed description below for a 
   -T, --temp-dir=DIR          create temporary files in directory DIR
@@ -123,8 +138,8 @@ of hard-linked.
  
  WARNING: The file's data will be in an inconsistent state during the
  transfer (and possibly afterward if the transfer gets interrupted), so you
-@@ -957,9 +958,19 @@ finds an existing file.  That first disc
and also determines if the transfer needs to happen.
+@@ -957,9 +958,19 @@ the list in the order specified), and if
of the em(DIR)s will be selected to try to speed up the transfer.
  
  If em(DIR) is a relative path, it is relative to the destination directory.
 -See also bf(--link-dest).