X-Git-Url: https://mattmccutchen.net/rsync/rsync-patches.git/blobdiff_plain/44d9dbfb5ad2427a21b5ccb9cdbe7984f9847117..refs/heads/master:/downdate.diff diff --git a/downdate.diff b/downdate.diff index 6a9698e..147a1d2 100644 --- a/downdate.diff +++ b/downdate.diff @@ -1,23 +1,31 @@ A patch from Stefan Müller to add the --downdate option, which works in the opposite manner as --update. ---- old/generator.c -+++ new/generator.c -@@ -53,6 +53,7 @@ extern int ignore_errors; - extern int remove_sent_files; +To use this patch, run these commands for a successful build: + + patch -p1 modtime) < 0) { -+ if (verbose > 1) ++ && cmp_time(sx.st.st_mtime, file->modtime) < 0) { ++ if (INFO_GTE(SKIP, 1)) + rprintf(FINFO, "%s is older\n", fname); + return; + } @@ -25,36 +33,44 @@ in the opposite manner as --update. fnamecmp = fname; fnamecmp_type = FNAMECMP_FNAME; -@@ -1430,7 +1438,7 @@ void generate_files(int f_out, struct fi - phase++; - csum_length = SUM_LENGTH; - max_size = min_size = ignore_existing = ignore_non_existing = 0; -- update_only = always_checksum = size_only = 0; -+ downdate_only = update_only = always_checksum = size_only = 0; - ignore_times = 1; - if (append_mode) /* resend w/o append mode */ - append_mode = -1; /* ... but only longer files */ ---- old/options.c -+++ new/options.c -@@ -56,6 +56,7 @@ int preserve_gid = 0; +@@ -1962,6 +1970,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; ++ downdate_only = -downdate_only; + always_checksum = -always_checksum; + size_only = -size_only; + append_mode = -append_mode; +@@ -1987,6 +1996,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; ++ downdate_only = -downdate_only; + always_checksum = -always_checksum; + size_only = -size_only; + append_mode = -append_mode; +diff --git a/options.c b/options.c +--- a/options.c ++++ b/options.c +@@ -60,6 +60,7 @@ int preserve_uid = 0; + int preserve_gid = 0; int preserve_times = 0; - int omit_dir_times = 0; int update_only = 0; +int downdate_only = 0; int cvs_exclude = 0; int dry_run = 0; int do_xfers = 1; -@@ -291,6 +292,7 @@ void usage(enum logcode F) +@@ -671,6 +672,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"); + rprintf(F," -w, --downdate skip files that are older on the receiver\n"); rprintf(F," --inplace update destination files in-place (SEE MAN PAGE)\n"); rprintf(F," --append append data onto shorter files\n"); - rprintf(F," -d, --dirs transfer directories without recursing\n"); -@@ -461,6 +463,7 @@ static struct poptOption long_options[] - {"size-only", 0, POPT_ARG_NONE, &size_only, 0, 0, 0 }, - {"one-file-system", 'x', POPT_ARG_NONE, 0, 'x', 0, 0 }, + rprintf(F," --append-verify like --append, but with old data in file checksum\n"); +@@ -892,6 +894,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 }, {"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 },