Annotation of embedaddon/rsync/patches/downdate.diff, revision 1.1.1.1
1.1 misho 1: A patch from Stefan Müller to add the --downdate option, which works
2: in the opposite manner as --update.
3:
4: To use this patch, run these commands for a successful build:
5:
6: patch -p1 <patches/downdate.diff
7: ./configure (optional if already run)
8: make
9:
10: based-on: e94bad1c156fc3910f24e2b3b71a81b0b0bdeb70
11: diff --git a/generator.c b/generator.c
12: --- a/generator.c
13: +++ b/generator.c
14: @@ -55,6 +55,7 @@ extern int ignore_errors;
15: extern int remove_source_files;
16: extern int delay_updates;
17: extern int update_only;
18: +extern int downdate_only;
19: extern int human_readable;
20: extern int ignore_existing;
21: extern int ignore_non_existing;
22: @@ -1713,6 +1714,12 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
23: goto cleanup;
24: }
25:
26: + if (downdate_only > 0 && statret == 0 && file->modtime - sx.st.st_mtime >= modify_window) {
27: + if (INFO_GTE(SKIP, 1))
28: + rprintf(FINFO, "%s is older\n", fname);
29: + return;
30: + }
31: +
32: fnamecmp_type = FNAMECMP_FNAME;
33:
34: if (statret == 0 && !(S_ISREG(sx.st.st_mode) || (write_devices && IS_DEVICE(sx.st.st_mode)))) {
35: @@ -2157,6 +2164,7 @@ void check_for_finished_files(int itemizing, enum logcode code, int check_redo)
36: ignore_existing = -ignore_existing;
37: ignore_non_existing = -ignore_non_existing;
38: update_only = -update_only;
39: + downdate_only = -downdate_only;
40: always_checksum = -always_checksum;
41: size_only = -size_only;
42: append_mode = -append_mode;
43: @@ -2182,6 +2190,7 @@ void check_for_finished_files(int itemizing, enum logcode code, int check_redo)
44: ignore_existing = -ignore_existing;
45: ignore_non_existing = -ignore_non_existing;
46: update_only = -update_only;
47: + downdate_only = -downdate_only;
48: always_checksum = -always_checksum;
49: size_only = -size_only;
50: append_mode = -append_mode;
51: diff --git a/options.c b/options.c
52: --- a/options.c
53: +++ b/options.c
54: @@ -62,6 +62,7 @@ int preserve_times = 0;
55: int preserve_atimes = 0;
56: int preserve_crtimes = 0;
57: int update_only = 0;
58: +int downdate_only = 0;
59: int open_noatime = 0;
60: int cvs_exclude = 0;
61: int dry_run = 0;
62: @@ -683,6 +684,7 @@ static struct poptOption long_options[] = {
63: {"no-one-file-system",0, POPT_ARG_VAL, &one_file_system, 0, 0, 0 },
64: {"no-x", 0, POPT_ARG_VAL, &one_file_system, 0, 0, 0 },
65: {"update", 'u', POPT_ARG_NONE, &update_only, 0, 0, 0 },
66: + {"downdate", 'w', POPT_ARG_NONE, &downdate_only, 0, 0, 0 },
67: {"existing", 0, POPT_ARG_NONE, &ignore_non_existing, 0, 0, 0 },
68: {"ignore-non-existing",0,POPT_ARG_NONE, &ignore_non_existing, 0, 0, 0 },
69: {"ignore-existing", 0, POPT_ARG_NONE, &ignore_existing, 0, 0, 0 },
70: diff --git a/rsync.1.md b/rsync.1.md
71: --- a/rsync.1.md
72: +++ b/rsync.1.md
73: @@ -347,6 +347,7 @@ detailed description below for a complete description.
74: --backup-dir=DIR make backups into hierarchy based in DIR
75: --suffix=SUFFIX backup suffix (default ~ w/o --backup-dir)
76: --update, -u skip files that are newer on the receiver
77: +--downdate, -w skip files that are older on the receiver
78: --inplace update destination files in-place
79: --append append data onto shorter files
80: --append-verify --append w/old data in file checksum
81: diff -Nurp a/rsync.1 b/rsync.1
82: --- a/rsync.1
83: +++ b/rsync.1
84: @@ -423,6 +423,7 @@ detailed description below for a complet
85: --backup-dir=DIR make backups into hierarchy based in DIR
86: --suffix=SUFFIX backup suffix (default ~ w/o --backup-dir)
87: --update, -u skip files that are newer on the receiver
88: +--downdate, -w skip files that are older on the receiver
89: --inplace update destination files in-place
90: --append append data onto shorter files
91: --append-verify --append w/old data in file checksum
92: diff -Nurp a/rsync.1.html b/rsync.1.html
93: --- a/rsync.1.html
94: +++ b/rsync.1.html
95: @@ -338,6 +338,7 @@ detailed description below for a complet
96: --backup-dir=DIR make backups into hierarchy based in DIR
97: --suffix=SUFFIX backup suffix (default ~ w/o --backup-dir)
98: --update, -u skip files that are newer on the receiver
99: +--downdate, -w skip files that are older on the receiver
100: --inplace update destination files in-place
101: --append append data onto shorter files
102: --append-verify --append w/old data in file checksum
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>