This patch adds the --append option, which works like a "resume" mode in
an ftp client, appending new data onto the end of the files it updates.
---- orig/generator.c 2005-02-27 18:24:42
-+++ generator.c 2005-02-27 07:51:38
+--- orig/generator.c 2005-03-03 02:58:55
++++ generator.c 2005-03-03 02:59:17
@@ -51,6 +51,7 @@ extern int remove_sent_files;
extern int update_only;
extern int opt_ignore_existing;
extern int make_backups;
extern int csum_length;
extern int ignore_times;
-@@ -457,35 +458,42 @@ static void generate_and_send_sums(int f
+@@ -450,35 +451,42 @@ static void generate_and_send_sums(int f
OFF_T offset = 0;
sum_sizes_sqroot(&sum, len);
}
if (mapbuf)
-@@ -925,6 +933,9 @@ static void recv_generator(char *fname,
+@@ -923,6 +931,9 @@ static void recv_generator(char *fname,
return;
}
if (!compare_dest && fnamecmp_type <= FNAMECMP_BASIS_DIR_HIGH)
;
else if (fnamecmp_type == FNAMECMP_FUZZY)
-@@ -951,7 +962,7 @@ prepare_to_open:
+@@ -1102,7 +1113,7 @@ void generate_files(int f_out, struct fi
+ if (delete_before && !local_name && flist->count > 0)
+ do_delete_pass(flist, allowed_lull);
- if (dry_run || read_batch)
- goto notify_others;
-- if (whole_file > 0) {
-+ if (whole_file > 0 && !append_mode) {
- if (statret == 0)
- statret = 1;
- goto notify_others;
+- if (whole_file < 0)
++ if (append_mode || whole_file < 0)
+ whole_file = 0;
+ if (verbose >= 2) {
+ rprintf(FINFO, "delta-transmission %s\n",
@@ -1147,6 +1158,8 @@ void generate_files(int f_out, struct fi
only_existing = max_size = opt_ignore_existing = 0;
update_only = always_checksum = size_only = 0;
matched(f, s, buf, j, -2);
matched(f, s, buf, len, -1);
}
---- orig/options.c 2005-03-01 05:49:24
+--- orig/options.c 2005-03-02 09:52:06
+++ options.c 2005-02-16 15:36:40
@@ -39,6 +39,7 @@ int make_backups = 0;
**/
continue;
}
---- orig/rsync.yo 2005-03-01 01:22:59
+--- orig/rsync.yo 2005-03-03 02:23:27
+++ rsync.yo 2005-02-11 20:36:38
-@@ -309,6 +309,7 @@ to the detailed description below for a
+@@ -308,6 +308,7 @@ to the detailed description below for a
--suffix=SUFFIX backup suffix (default ~ w/o --backup-dir)
-u, --update skip files that are newer on the receiver
--inplace update destination files in-place
-d, --dirs transfer directories without recursing
-l, --links copy symlinks as symlinks
-L, --copy-links transform symlink into referent file/dir
-@@ -564,6 +565,14 @@ should not use this option to update fil
+@@ -563,6 +564,14 @@ should not use this option to update fil
rsync will be unable to update a file in-place that is not writable by the
receiving user.
file->length = st.st_size;
file->mode = st.st_mode;
file->uid = st.st_uid;
---- orig/generator.c 2005-02-27 18:24:42
+--- orig/generator.c 2005-03-03 02:58:55
+++ generator.c 2004-11-03 23:02:12
-@@ -364,7 +364,7 @@ static int unchanged_file(char *fn, stru
+@@ -357,7 +357,7 @@ static int unchanged_file(char *fn, stru
if (ignore_times)
return 0;
}
-@@ -919,7 +919,7 @@ static void recv_generator(char *fname,
+@@ -808,7 +808,7 @@ static void recv_generator(char *fname,
}
- if (update_only && fnamecmp_type == FNAMECMP_FNAME
+ if (update_only && statret == 0
- && cmp_modtime(st.st_mtime, file->modtime) > 0) {
+ && cmp_time(st.st_mtime, file->modtime) > 0) {
if (verbose > 1)
rprintf(FINFO, "%s is newer\n", safe_fname(fname));
return;
---- orig/options.c 2005-03-01 05:49:24
+--- orig/options.c 2005-03-02 09:52:06
+++ options.c 2005-02-21 10:53:28
@@ -50,6 +50,7 @@ int preserve_uid = 0;
int preserve_gid = 0;
}
change_uid = am_root && preserve_uid && st->st_uid != file->uid;
---- orig/rsync.h 2005-02-23 02:57:27
+--- orig/rsync.h 2005-03-03 00:14:56
+++ rsync.h 2004-07-03 20:15:41
@@ -54,6 +54,7 @@
#define XMIT_HAS_IDEV_DATA (1<<9)
#define FULL_FLUSH 1
#define NORMAL_FLUSH 0
-@@ -499,6 +501,7 @@ struct file_struct {
+@@ -501,6 +503,7 @@ struct file_struct {
struct hlink *links;
} link_u;
time_t modtime;
uid_t uid;
gid_t gid;
mode_t mode;
---- orig/rsync.yo 2005-03-01 01:22:59
+--- orig/rsync.yo 2005-03-03 02:23:27
+++ rsync.yo 2005-01-24 01:57:18
-@@ -322,6 +322,7 @@ to the detailed description below for a
+@@ -321,6 +321,7 @@ to the detailed description below for a
-D, --devices preserve devices (root only)
-t, --times preserve times
-O, --omit-dir-times omit directories when preserving times
-S, --sparse handle sparse files efficiently
-n, --dry-run show what would have been transferred
-W, --whole-file copy files whole (without rsync algorithm)
-@@ -654,6 +655,11 @@ it is preserving modification times (see
+@@ -653,6 +654,11 @@ 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).