Applied preallocate patch to the trunk.
[rsync-patches.git] / downdate.diff
index 7b922a4108bde8f29fb0983d0593c91e9359a99b..48598e6d3469d14943954f55808830f9fc22cae5 100644 (file)
@@ -7,32 +7,33 @@ To use this patch, run these commands for a successful build:
     ./configure                                 (optional if already run)
     make
 
+based-on: 3bd9f51917ed5718275c6132006be155239a0550
 diff --git a/generator.c b/generator.c
 --- a/generator.c
 +++ b/generator.c
-@@ -55,6 +55,7 @@ extern int ignore_errors;
+@@ -54,6 +54,7 @@ extern int ignore_errors;
  extern int remove_source_files;
  extern int delay_updates;
  extern int update_only;
 +extern int downdate_only;
+ extern int human_readable;
  extern int ignore_existing;
  extern int ignore_non_existing;
- extern int inplace;
-@@ -1706,6 +1707,13 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1590,6 +1591,13 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
                goto cleanup;
        }
  
 +      if (downdate_only && statret == 0
 +          && cmp_time(sx.st.st_mtime, file->modtime) < 0) {
-+              if (verbose > 1)
++              if (INFO_GTE(SKIP, 1))
 +                      rprintf(FINFO, "%s is older\n", fname);
 +              return;
 +      }
 +
-       fnamecmp = fname;
        fnamecmp_type = FNAMECMP_FNAME;
  
-@@ -2053,6 +2061,7 @@ void check_for_finished_files(int itemizing, enum logcode code, int check_redo)
+       if (statret == 0 && !S_ISREG(sx.st.st_mode)) {
+@@ -2022,6 +2030,7 @@ void check_for_finished_files(int itemizing, enum logcode code, int check_redo)
                        ignore_existing = -ignore_existing;
                        ignore_non_existing = -ignore_non_existing;
                        update_only = -update_only;
@@ -40,7 +41,7 @@ diff --git a/generator.c b/generator.c
                        always_checksum = -always_checksum;
                        size_only = -size_only;
                        append_mode = -append_mode;
-@@ -2078,6 +2087,7 @@ void check_for_finished_files(int itemizing, enum logcode code, int check_redo)
+@@ -2047,6 +2056,7 @@ void check_for_finished_files(int itemizing, enum logcode code, int check_redo)
                        ignore_existing = -ignore_existing;
                        ignore_non_existing = -ignore_non_existing;
                        update_only = -update_only;
@@ -59,7 +60,7 @@ diff --git a/options.c b/options.c
  int cvs_exclude = 0;
  int dry_run = 0;
  int do_xfers = 1;
-@@ -326,6 +327,7 @@ void usage(enum logcode F)
+@@ -672,6 +673,7 @@ void usage(enum logcode F)
    rprintf(F,"     --backup-dir=DIR        make backups into hierarchy based in DIR\n");
    rprintf(F,"     --suffix=SUFFIX         set backup suffix (default %s w/o --backup-dir)\n",BACKUP_SUFFIX);
    rprintf(F," -u, --update                skip files that are newer on the receiver\n");
@@ -67,9 +68,9 @@ diff --git a/options.c b/options.c
    rprintf(F,"     --inplace               update destination files in-place (SEE MAN PAGE)\n");
    rprintf(F,"     --append                append data onto shorter files\n");
    rprintf(F,"     --append-verify         like --append, but with old data in file checksum\n");
-@@ -534,6 +536,7 @@ static struct poptOption long_options[] = {
-   {"no-one-file-system",'x',POPT_ARG_VAL,   &one_file_system, 0, 0, 0 },
-   {"no-x",            'x', POPT_ARG_VAL,    &one_file_system, 0, 0, 0 },
+@@ -897,6 +899,7 @@ static struct poptOption long_options[] = {
+   {"no-one-file-system",0, POPT_ARG_VAL,    &one_file_system, 0, 0, 0 },
+   {"no-x",             0,  POPT_ARG_VAL,    &one_file_system, 0, 0, 0 },
    {"update",          'u', POPT_ARG_NONE,   &update_only, 0, 0, 0 },
 +  {"downdate",        'w', POPT_ARG_NONE,   &downdate_only, 0, 0, 0 },
    {"existing",         0,  POPT_ARG_NONE,   &ignore_non_existing, 0, 0, 0 },