The patches for 3.0.0pre10.
[rsync/rsync-patches.git] / crtimes.diff
index e4c1831..09491f0 100644 (file)
@@ -26,9 +26,9 @@ diff --git a/compat.c b/compat.c
 -int uid_ndx, gid_ndx, fileflags_ndx, acls_ndx, xattrs_ndx, unsort_ndx;
 +int uid_ndx, gid_ndx, crtimes_ndx, fileflags_ndx, acls_ndx, xattrs_ndx, unsort_ndx;
  
- #ifdef ICONV_OPTION
- int filesfrom_convert = 0;
-@@ -125,6 +126,8 @@ void setup_protocol(int f_out,int f_in)
+ int receiver_symlink_times = 0; /* receiver can set the time on a symlink */
+@@ -135,6 +136,8 @@ void setup_protocol(int f_out,int f_in)
                uid_ndx = ++file_extra_cnt;
        if (preserve_gid)
                gid_ndx = ++file_extra_cnt;
@@ -138,15 +138,15 @@ diff --git a/generator.c b/generator.c
  
  extern int verbose;
  extern int dry_run;
-@@ -41,6 +42,7 @@ extern int preserve_links;
+@@ -41,6 +42,7 @@ extern int preserve_xattrs;
+ extern int preserve_links;
  extern int preserve_devices;
  extern int preserve_specials;
- extern int preserve_hard_links;
 +extern int preserve_fileflags;
+ extern int preserve_hard_links;
+ extern int preserve_executability;
  extern int preserve_perms;
- extern int preserve_times;
- extern int uid_ndx;
-@@ -137,6 +139,7 @@ enum delret {
+@@ -139,6 +141,7 @@ enum delret {
  /* Forward declaration for delete_item(). */
  static enum delret delete_dir_contents(char *fname, int flags);
  
@@ -154,7 +154,7 @@ diff --git a/generator.c b/generator.c
  static int is_backup_file(char *fn)
  {
        int k = strlen(fn) - backup_suffix_len;
-@@ -598,6 +601,13 @@ int unchanged_attrs(const char *fname, struct file_struct *file, stat_x *sxp)
+@@ -603,6 +606,13 @@ int unchanged_attrs(const char *fname, struct file_struct *file, stat_x *sxp)
        if (gid_ndx && !(file->flags & FLAG_SKIP_GROUP) && sxp->st.st_gid != (gid_t)F_GROUP(file))
                return 0;
  
@@ -168,7 +168,7 @@ diff --git a/generator.c b/generator.c
  #ifdef SUPPORT_ACLS
        if (preserve_acls && !S_ISLNK(file->mode)) {
                if (!ACL_READY(*sxp))
-@@ -634,6 +644,12 @@ void itemize(const char *fnamecmp, struct file_struct *file, int ndx, int statre
+@@ -642,6 +652,12 @@ void itemize(const char *fnamecmp, struct file_struct *file, int ndx, int statre
                  && (!(iflags & ITEM_XNAME_FOLLOWS) || *xname))
                 || (keep_time && cmp_time(file->modtime, sxp->st.st_mtime) != 0))
                        iflags |= ITEM_REPORT_TIME;
@@ -181,7 +181,7 @@ diff --git a/generator.c b/generator.c
  #if !defined HAVE_LCHMOD && !defined HAVE_SETATTRLIST
                if (S_ISLNK(file->mode)) {
                        ;
-@@ -1173,6 +1189,7 @@ static int try_dests_non(struct file_struct *file, char *fname, int ndx,
+@@ -1182,6 +1198,7 @@ static int try_dests_non(struct file_struct *file, char *fname, int ndx,
  static void list_file_entry(struct file_struct *f)
  {
        char permbuf[PERMSTRING_SIZE];
@@ -189,7 +189,7 @@ diff --git a/generator.c b/generator.c
        double len;
  
        if (!F_IS_ACTIVE(f)) {
-@@ -1187,14 +1204,16 @@ static void list_file_entry(struct file_struct *f)
+@@ -1196,14 +1213,16 @@ static void list_file_entry(struct file_struct *f)
  
  #ifdef SUPPORT_LINKS
        if (preserve_links && S_ISLNK(f->mode)) {
@@ -208,7 +208,7 @@ diff --git a/generator.c b/generator.c
                        f_name(f, NULL));
        }
  }
-@@ -1277,6 +1296,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1290,6 +1309,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
                        return;
                }
        }
@@ -251,7 +251,7 @@ diff --git a/ifuncs.h b/ifuncs.h
 diff --git a/log.c b/log.c
 --- a/log.c
 +++ b/log.c
-@@ -642,7 +642,7 @@ static void log_formatted(enum logcode code, const char *format, const char *op,
+@@ -644,7 +644,7 @@ static void log_formatted(enum logcode code, const char *format, const char *op,
                        c[5] = !(iflags & ITEM_REPORT_PERMS) ? '.' : 'p';
                        c[6] = !(iflags & ITEM_REPORT_OWNER) ? '.' : 'o';
                        c[7] = !(iflags & ITEM_REPORT_GROUP) ? '.' : 'g';
@@ -271,7 +271,7 @@ diff --git a/options.c b/options.c
  int update_only = 0;
  int cvs_exclude = 0;
  int dry_run = 0;
-@@ -354,6 +355,7 @@ void usage(enum logcode F)
+@@ -358,6 +359,7 @@ void usage(enum logcode F)
    rprintf(F," -D                          same as --devices --specials\n");
    rprintf(F," -t, --times                 preserve modification times\n");
    rprintf(F," -O, --omit-dir-times        omit directories from --times\n");
@@ -279,7 +279,7 @@ diff --git a/options.c b/options.c
    rprintf(F,"     --super                 receiver attempts super-user activities\n");
  #ifdef SUPPORT_XATTRS
    rprintf(F,"     --fake-super            store/recover privileged attrs using xattrs\n");
-@@ -491,6 +493,9 @@ static struct poptOption long_options[] = {
+@@ -495,6 +497,9 @@ static struct poptOption long_options[] = {
    {"times",           't', POPT_ARG_VAL,    &preserve_times, 2, 0, 0 },
    {"no-times",         0,  POPT_ARG_VAL,    &preserve_times, 0, 0, 0 },
    {"no-t",             0,  POPT_ARG_VAL,    &preserve_times, 0, 0, 0 },
@@ -289,7 +289,7 @@ diff --git a/options.c b/options.c
    {"omit-dir-times",  'O', POPT_ARG_VAL,    &omit_dir_times, 1, 0, 0 },
    {"no-omit-dir-times",0,  POPT_ARG_VAL,    &omit_dir_times, 0, 0, 0 },
    {"no-O",             0,  POPT_ARG_VAL,    &omit_dir_times, 0, 0, 0 },
-@@ -1742,6 +1747,8 @@ void server_options(char **args, int *argc_p)
+@@ -1764,6 +1769,8 @@ void server_options(char **args, int *argc_p)
                argstr[x++] = 'D';
        if (preserve_times)
                argstr[x++] = 't';
@@ -301,9 +301,9 @@ diff --git a/options.c b/options.c
 diff --git a/rsync.c b/rsync.c
 --- a/rsync.c
 +++ b/rsync.c
-@@ -436,6 +436,14 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp,
-               if (ret == 0) /* ret == 1 if symlink could not be set */
-                       updated = 1;
+@@ -439,6 +439,14 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp,
+               else if (receiver_symlink_times)
+                       file->flags |= FLAG_TIME_FAILED;
        }
 +      if (crtimes_ndx && !(flags & ATTRS_SKIP_CRTIME)) {
 +              time_t file_crtime = f_crtime(file);
@@ -316,7 +316,7 @@ diff --git a/rsync.c b/rsync.c
  
        change_uid = am_root && uid_ndx && sxp->st.st_uid != (uid_t)F_OWNER(file);
        change_gid = gid_ndx && !(file->flags & FLAG_SKIP_GROUP)
-@@ -573,7 +581,7 @@ int finish_transfer(const char *fname, const char *fnametmp,
+@@ -576,7 +584,7 @@ int finish_transfer(const char *fname, const char *fnametmp,
  
        /* Change permissions before putting the file into place. */
        set_file_attrs(fnametmp, file, NULL, fnamecmp,
@@ -325,7 +325,7 @@ diff --git a/rsync.c b/rsync.c
  
  #ifdef SUPPORT_FLAGS
        if (preserve_fileflags)
-@@ -608,7 +616,7 @@ int finish_transfer(const char *fname, const char *fnametmp,
+@@ -611,7 +619,7 @@ int finish_transfer(const char *fname, const char *fnametmp,
  
    do_set_file_attrs:
        set_file_attrs(fnametmp, file, NULL, fnamecmp,
@@ -345,7 +345,7 @@ diff --git a/rsync.h b/rsync.h
  #define XMIT_SAME_FLAGS (1<<14)               /* protocols ?? - now */
  
  /* These flags are used in the live flist data. */
-@@ -149,6 +150,7 @@
+@@ -150,6 +151,7 @@
  
  #define ATTRS_REPORT          (1<<0)
  #define ATTRS_SKIP_MTIME      (1<<1)
@@ -353,7 +353,7 @@ diff --git a/rsync.h b/rsync.h
  
  #define FULL_FLUSH    1
  #define NORMAL_FLUSH  0
-@@ -165,7 +167,7 @@
+@@ -166,7 +168,7 @@
  #define FNAMECMP_FUZZY                0x83
  
  /* For use by the itemize_changes code */
@@ -362,7 +362,7 @@ diff --git a/rsync.h b/rsync.h
  #define ITEM_REPORT_CHECKSUM (1<<1)
  #define ITEM_REPORT_SIZE (1<<2)
  #define ITEM_REPORT_TIME (1<<3)
-@@ -635,6 +637,7 @@ extern int file_extra_cnt;
+@@ -636,6 +638,7 @@ extern int file_extra_cnt;
  extern int inc_recurse;
  extern int uid_ndx;
  extern int gid_ndx;
@@ -370,7 +370,7 @@ diff --git a/rsync.h b/rsync.h
  extern int fileflags_ndx;
  extern int acls_ndx;
  extern int xattrs_ndx;
-@@ -642,6 +645,7 @@ extern int xattrs_ndx;
+@@ -643,6 +646,7 @@ extern int xattrs_ndx;
  #define FILE_STRUCT_LEN (offsetof(struct file_struct, basename))
  #define EXTRA_LEN (sizeof (union file_extras))
  #define PTR_EXTRA_CNT ((sizeof (char *) + EXTRA_LEN - 1) / EXTRA_LEN)
@@ -378,7 +378,7 @@ diff --git a/rsync.h b/rsync.h
  #define DEV_EXTRA_CNT 2
  #define DIRNODE_EXTRA_CNT 3
  #define SUM_EXTRA_CNT ((MAX_DIGEST_LEN + EXTRA_LEN - 1) / EXTRA_LEN)
-@@ -896,6 +900,7 @@ typedef struct {
+@@ -897,6 +901,7 @@ typedef struct {
  
  typedef struct {
      STRUCT_STAT st;
@@ -416,7 +416,7 @@ diff --git a/rsync.yo b/rsync.yo
  type 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.
-@@ -1696,8 +1700,8 @@ quote(itemization(
+@@ -1698,8 +1702,8 @@ quote(itemization(
    sender's value (requires bf(--owner) and super-user privileges).
    it() A bf(g) means the group is different and is being updated to the
    sender's value (requires bf(--group) and the authority to set the group).