This is an updated patch from Steve Sether with a few improvements
[rsync/rsync-patches.git] / atimes.diff
index 9aea9ac..caa01c1 100644 (file)
@@ -15,7 +15,7 @@ command before "make":
                rprintf(FINFO, "flist->length=%.0f\n",
                        (double) fptr[i]->length);
                rprintf(FINFO, "flist->mode=%#o\n", (int) fptr[i]->mode);
---- orig/flist.c       2005-07-27 23:31:12
+--- orig/flist.c       2005-08-17 06:45:07
 +++ flist.c    2005-07-28 00:16:34
 @@ -50,6 +50,7 @@ extern int preserve_perms;
  extern int preserve_devices;
@@ -127,7 +127,7 @@ command before "make":
        file->length = st.st_size;
        file->mode = st.st_mode;
        file->uid = st.st_uid;
---- orig/generator.c   2005-07-27 23:31:12
+--- orig/generator.c   2005-08-17 06:45:07
 +++ generator.c        2005-07-28 00:14:43
 @@ -44,6 +44,7 @@ extern int preserve_uid;
  extern int preserve_gid;
@@ -137,7 +137,7 @@ command before "make":
  extern int delete_before;
  extern int delete_during;
  extern int delete_after;
-@@ -323,9 +324,21 @@ void itemize(struct file_struct *file, i
+@@ -324,9 +325,21 @@ void itemize(struct file_struct *file, i
                            : S_ISDIR(file->mode) ? !omit_dir_times
                            : !S_ISLNK(file->mode);
  
@@ -160,7 +160,7 @@ command before "make":
                                iflags |= ITEM_REPORT_TIME;
                        if (preserve_perms
                         && (file->mode & CHMOD_BITS) != (st->st_mode & CHMOD_BITS))
-@@ -377,7 +390,7 @@ static int unchanged_file(char *fn, stru
+@@ -378,7 +391,7 @@ static int unchanged_file(char *fn, stru
        if (ignore_times)
                return 0;
  
@@ -169,7 +169,7 @@ command before "make":
  }
  
  
-@@ -530,7 +543,7 @@ static int find_fuzzy(struct file_struct
+@@ -538,7 +551,7 @@ static int find_fuzzy(struct file_struct
                name = fp->basename;
  
                if (fp->length == file->length
@@ -178,7 +178,7 @@ command before "make":
                        if (verbose > 4) {
                                rprintf(FINFO,
                                        "fuzzy size/modtime match for %s\n",
-@@ -851,7 +864,7 @@ static void recv_generator(char *fname, 
+@@ -881,7 +894,7 @@ static void recv_generator(char *fname, 
        }
  
        if (update_only && statret == 0
@@ -217,8 +217,8 @@ command before "make":
  
                        if (iflags & (ITEM_IS_NEW|ITEM_MISSING_DATA)) {
                                char ch = iflags & ITEM_IS_NEW ? '+' : '?';
---- orig/options.c     2005-07-27 23:31:12
-+++ options.c  2005-07-28 01:00:24
+--- orig/options.c     2005-08-27 21:11:26
++++ options.c  2005-08-27 21:16:51
 @@ -49,6 +49,7 @@ int preserve_uid = 0;
  int preserve_gid = 0;
  int preserve_times = 0;
@@ -227,7 +227,7 @@ command before "make":
  int update_only = 0;
  int cvs_exclude = 0;
  int dry_run = 0;
-@@ -285,8 +286,9 @@ void usage(enum logcode F)
+@@ -287,8 +288,9 @@ void usage(enum logcode F)
    rprintf(F," -o, --owner                 preserve owner (root only)\n");
    rprintf(F," -g, --group                 preserve group\n");
    rprintf(F," -D, --devices               preserve devices (root only)\n");
@@ -239,15 +239,17 @@ command before "make":
    rprintf(F," -S, --sparse                handle sparse files efficiently\n");
    rprintf(F," -n, --dry-run               show what would have been transferred\n");
    rprintf(F," -W, --whole-file            copy files whole (without rsync algorithm)\n");
-@@ -413,6 +415,7 @@ static struct poptOption long_options[] 
-   {"devices",         'D', POPT_ARG_NONE,   &preserve_devices, 0, 0, 0 },
-   {"times",           't', POPT_ARG_NONE,   &preserve_times, 0, 0, 0 },
+@@ -388,6 +390,9 @@ static struct poptOption long_options[] 
+   {"times",           't', POPT_ARG_VAL,    &preserve_times, 1, 0, 0 },
+   {"no-times",         0,  POPT_ARG_VAL,    &preserve_times, 0, 0, 0 },
+   {"no-t",             0,  POPT_ARG_VAL,    &preserve_times, 0, 0, 0 },
++  {"atimes",          'A', POPT_ARG_VAL,    &preserve_atimes, 1, 0, 0 },
++  {"no-atimes",        0,  POPT_ARG_VAL,    &preserve_atimes, 0, 0, 0 },
++  {"no-A",             0,  POPT_ARG_VAL,    &preserve_atimes, 0, 0, 0 },
    {"omit-dir-times",  'O', POPT_ARG_VAL,    &omit_dir_times, 2, 0, 0 },
-+  {"atimes",          'A', POPT_ARG_NONE,   &preserve_atimes, 0, 0, 0 },
-   {"checksum",        'c', POPT_ARG_NONE,   &always_checksum, 0, 0, 0 },
-   {"verbose",         'v', POPT_ARG_NONE,   0, 'v', 0, 0 },
-   {"quiet",           'q', POPT_ARG_NONE,   0, 'q', 0, 0 },
-@@ -1292,6 +1295,8 @@ void server_options(char **args,int *arg
+   {"modify-window",    0,  POPT_ARG_INT,    &modify_window, OPT_MODIFY_WINDOW, 0, 0 },
+   {"owner",           'o', POPT_ARG_VAL,    &preserve_uid, 1, 0, 0 },
+@@ -1337,6 +1342,8 @@ void server_options(char **args,int *arg
                argstr[x++] = 'D';
        if (preserve_times)
                argstr[x++] = 't';
@@ -308,7 +310,7 @@ command before "make":
        }
  
        change_uid = am_root && preserve_uid && st->st_uid != file->uid;
---- orig/rsync.h       2005-05-03 17:11:01
+--- orig/rsync.h       2005-08-17 06:45:08
 +++ rsync.h    2005-07-28 00:04:51
 @@ -54,6 +54,7 @@
  #define XMIT_HAS_IDEV_DATA (1<<9)
@@ -334,7 +336,7 @@ command before "make":
  #define ITEM_REPORT_CHECKSUM (1<<1)
  #define ITEM_REPORT_SIZE (1<<2)
  #define ITEM_REPORT_TIME (1<<3)
-@@ -509,6 +512,7 @@ struct file_struct {
+@@ -517,6 +520,7 @@ struct file_struct {
                struct hlink *links;
        } link_u;
        time_t modtime;
@@ -342,9 +344,9 @@ command before "make":
        uid_t uid;
        gid_t gid;
        mode_t mode;
---- orig/rsync.yo      2005-07-07 23:11:09
+--- orig/rsync.yo      2005-08-27 21:05:12
 +++ rsync.yo   2005-07-28 01:04:09
-@@ -309,8 +309,9 @@ to the detailed description below for a 
+@@ -321,8 +321,9 @@ to the detailed description below for a 
   -o, --owner                 preserve owner (root only)
   -g, --group                 preserve group
   -D, --devices               preserve devices (root only)
@@ -355,7 +357,7 @@ command before "make":
   -S, --sparse                handle sparse files efficiently
   -n, --dry-run               show what would have been transferred
   -W, --whole-file            copy files whole (without rsync algorithm)
-@@ -648,6 +649,12 @@ it is preserving modification times (see
+@@ -695,6 +696,12 @@ it is preserving modification times (see
  the directories on the receiving side, it is a good idea to use bf(-O).
  This option is inferred if you use bf(--backup) without bf(--backup-dir).
  
@@ -368,7 +370,7 @@ command before "make":
  dit(bf(-n, --dry-run)) This tells rsync to not do any file transfers,
  instead it will just report the actions it would have taken.
  
-@@ -1055,7 +1062,7 @@ changes that are being made to each file
+@@ -1103,7 +1110,7 @@ changes that are being made to each file
  This is exactly the same as specifying bf(--log-format='%i %n%L').
  
  The "%i" escape has a cryptic output that is 9 letters long.  The general
@@ -377,7 +379,7 @@ command before "make":
  kind of update being done, bf(X) is replaced by the file-type, and the
  other letters represent attributes that may be output if they are being
  modified.
-@@ -1094,17 +1101,22 @@ quote(itemize(
+@@ -1142,17 +1149,22 @@ quote(itemize(
    by the file transfer.
    it() A bf(t) means the modification time is different and is being updated
    to the sender's value (requires bf(--times)).  An alternate value of bf(T)
@@ -736,7 +738,7 @@ command before "make":
  
        return 0;
  }
---- orig/util.c        2005-07-27 23:31:12
+--- orig/util.c        2005-08-17 06:45:08
 +++ util.c     2005-07-27 23:37:27
 @@ -128,7 +128,7 @@ void overflow_exit(char *str)
  
@@ -787,7 +789,7 @@ command before "make":
                t[1] = modtime;
                return utime(fname,t);
  #else
-@@ -1167,8 +1171,8 @@ int msleep(int t)
+@@ -1166,8 +1170,8 @@ int msleep(int t)
  
  
  /**
@@ -798,7 +800,7 @@ command before "make":
   * --modify-window).
   *
   * @retval 0 if the times should be treated as the same
-@@ -1177,7 +1181,7 @@ int msleep(int t)
+@@ -1176,7 +1180,7 @@ int msleep(int t)
   *
   * @retval -1 if the 2nd is later
   **/