if (real_ret != 0 && one_file_system)
- real_st.st_dev = filesystem_dev;
+ real_sx.st.st_dev = filesystem_dev;
- if (incremental) {
+ if (inc_recurse) {
if (one_file_system) {
uint32 *devp = F_DIRDEV_P(file);
- DEV_MAJOR(devp) = major(real_st.st_dev);
+ dflt_perms = (ACCESSPERMS & ~orig_umask);
+
do {
- if (incremental && delete_during && cur_flist->ndx_start) {
+ if (inc_recurse && delete_during && cur_flist->ndx_start) {
struct file_struct *fp = dir_flist->files[cur_flist->parent_ndx];
--- old/hlink.c
+++ new/hlink.c
extern int delay_updates;
+extern mode_t orig_umask;
extern struct stats stats;
- extern char *stdout_format;
extern char *tmpdir;
-@@ -349,6 +350,10 @@ int recv_files(int f_in, char *local_nam
+ extern char *partial_dir;
+@@ -348,6 +349,10 @@ int recv_files(int f_in, char *local_nam
int itemizing = am_server ? logfile_format_has_i : stdout_format_has_i;
enum logcode log_code = log_before_transfer ? FLOG : FINFO;
int max_phase = protocol_version >= 29 ? 2 : 1;
int ndx, recv_ok;
if (verbose > 2)
-@@ -562,7 +567,16 @@ int recv_files(int f_in, char *local_nam
+@@ -563,7 +568,16 @@ int recv_files(int f_in, char *local_nam
* mode based on the local permissions and some heuristics. */
if (!preserve_perms) {
int exists = fd1 != -1;
extern int keep_dirlinks;
extern int make_backups;
-extern mode_t orig_umask;
- extern struct stats stats;
extern struct file_list *cur_flist, *first_flist, *dir_flist;
extern struct chmod_mode_struct *daemon_chmod_modes;
-@@ -203,7 +203,8 @@ void free_sums(struct sum_struct *s)
+
+@@ -202,7 +202,8 @@ void free_sums(struct sum_struct *s)
/* This is only called when we aren't preserving permissions. Figure out what
* the permissions should be and return them merged back into the mode. */
{
int new_mode;
/* If the file already exists, we'll return the local permissions,
-@@ -220,56 +221,65 @@ mode_t dest_mode(mode_t flist_mode, mode
+@@ -219,56 +220,65 @@ mode_t dest_mode(mode_t flist_mode, mode
new_mode |= (new_mode & 0444) >> 2;
}
} else {
;
else
#endif
-@@ -279,45 +289,57 @@ int set_file_attrs(char *fname, struct f
+@@ -278,45 +288,57 @@ int set_file_attrs(char *fname, struct f
rprintf(FINFO,
"set uid of %s from %ld to %ld\n",
fname,
}
if (ret == 0) /* ret == 1 if symlink could not be set */
updated = 1;
-@@ -330,6 +352,11 @@ int set_file_attrs(char *fname, struct f
+@@ -329,6 +351,11 @@ int set_file_attrs(char *fname, struct f
else
rprintf(FCLIENT, "%s is uptodate\n", fname);
}
dit(bf(--chmod)) This option tells rsync to apply one or more
comma-separated "chmod" strings to the permission of the files in the
transfer. The resulting value is treated as though it was the permissions
-@@ -1426,8 +1439,8 @@ if the receiving rsync is at least versi
+@@ -1432,8 +1445,8 @@ if the receiving rsync is at least versi
with older versions of rsync, but that also turns on the output of other
verbose messages).
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.
-@@ -1476,7 +1489,11 @@ quote(itemization(
+@@ -1482,7 +1495,11 @@ 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).
static void send_directory(int f, struct file_list *flist, int ndx,
char *fbuf, int len, int flags);
-@@ -1702,6 +1744,25 @@ struct file_list *recv_file_list(int f)
+@@ -1706,6 +1748,25 @@ struct file_list *recv_file_list(int f)
clean_flist(flist, relative_paths, 1);
+ the_fattr_list.high = j;
+ }
+
- if (incremental) {
+ if (inc_recurse) {
qsort(dir_flist->files + dstart, dir_flist->count - dstart,
sizeof dir_flist->files[0], (int (*)())file_compare);
--- old/generator.c
rsyserr(FERROR, stat_errno, "recv_generator: failed to stat %s",
full_fname(fname));
return;
-@@ -1683,6 +1838,12 @@ void generate_files(int f_out, char *loc
+@@ -1717,6 +1872,12 @@ void generate_files(int f_out, char *loc
if (verbose > 2)
rprintf(FINFO, "generator starting pid=%ld\n", (long)getpid());
if (delete_before && !local_name && cur_flist->count > 0)
do_delete_pass(cur_flist);
if (delete_during == 2) {
-@@ -1693,7 +1854,7 @@ void generate_files(int f_out, char *loc
+@@ -1727,7 +1888,7 @@ void generate_files(int f_out, char *loc
}
do_progress = 0;
whole_file = 0;
if (verbose >= 2) {
rprintf(FINFO, "delta-transmission %s\n",
-@@ -1718,7 +1879,7 @@ void generate_files(int f_out, char *loc
+@@ -1752,7 +1913,7 @@ void generate_files(int f_out, char *loc
dirdev = MAKEDEV(DEV_MAJOR(devp), DEV_MINOR(devp));
} else
dirdev = MAKEDEV(0, 0);
}
}
for (i = cur_flist->low; i <= cur_flist->high; i++) {
-@@ -1764,7 +1925,21 @@ void generate_files(int f_out, char *loc
+@@ -1798,7 +1959,21 @@ void generate_files(int f_out, char *loc
- if (!incremental) {
+ if (!inc_recurse) {
if (delete_during)
- delete_in_dir(NULL, NULL, NULL, &dev_zero);
+ delete_in_dir(NULL, NULL, NULL, &dev_zero, 0);
--compare-dest=DIR also compare received files relative to DIR
--copy-dest=DIR ... and include copies of unchanged files
--link-dest=DIR hardlink to files in DIR when unchanged
-@@ -1272,6 +1273,15 @@ Note that the use of the bf(--delete) op
+@@ -1296,6 +1297,15 @@ Note that the use of the bf(--delete) op
fuzzy-match files, so either use bf(--delete-after) or specify some
filename exclusions if you need to prevent this.
--- old/flist.c
+++ new/flist.c
@@ -33,6 +33,7 @@ extern int am_sender;
- extern int incremental;
+ extern int inc_recurse;
extern int do_progress;
extern int always_checksum;
+extern int pre_checksum;
extern int module_id;
extern int ignore_errors;
extern int numeric_ids;
-@@ -847,6 +848,15 @@ static struct file_struct *recv_file_ent
+@@ -850,6 +851,15 @@ static struct file_struct *recv_file_ent
memcpy(bp, F_SUM(first), checksum_len);
} else
read_buf(f, bp, checksum_len);
+ }
}
- return file;
+ if (S_ISREG(mode) || S_ISLNK(mode))
--- old/generator.c
+++ new/generator.c
@@ -73,6 +73,7 @@ extern int protocol_version;
int local_server = 0;
int new_root_dir = 0;
mode_t orig_umask = 0;
-@@ -792,6 +796,7 @@ static void do_server_recv(int f_in, int
+@@ -793,6 +797,7 @@ static void do_server_recv(int f_in, int
struct file_list *flist;
char *local_name = NULL;
char *dir = NULL;
int save_verbose = verbose;
if (filesfrom_fd >= 0) {
-@@ -838,6 +843,10 @@ static void do_server_recv(int f_in, int
+@@ -839,6 +844,10 @@ static void do_server_recv(int f_in, int
filesfrom_fd = -1;
}
flist = recv_file_list(f_in);
if (!flist) {
rprintf(FERROR,"server_recv: recv_file_list error\n");
-@@ -847,6 +856,9 @@ static void do_server_recv(int f_in, int
+@@ -848,6 +857,9 @@ static void do_server_recv(int f_in, int
recv_additional_file_list(f_in);
verbose = save_verbose;
if (argc > 0)
local_name = get_local_name(flist,argv[0]);
-@@ -926,6 +938,7 @@ int client_run(int f_in, int f_out, pid_
+@@ -927,6 +939,7 @@ int client_run(int f_in, int f_out, pid_
{
struct file_list *flist = NULL;
int exit_code = 0, exit_code2 = 0;
char *local_name = NULL;
cleanup_child_pid = pid;
-@@ -1006,12 +1019,19 @@ int client_run(int f_in, int f_out, pid_
+@@ -1007,12 +1020,19 @@ int client_run(int f_in, int f_out, pid_
filesfrom_fd = -1;
}
if (write_batch && !am_server)
start_write_batch(f_in);
flist = recv_file_list(f_in);
- if (incremental && file_total == 1)
+ if (inc_recurse && file_total == 1)
recv_additional_file_list(f_in);
+ if (pre_checksum)
extern char curr_dir[MAXPATHLEN];
-@@ -712,7 +713,7 @@ static struct file_struct *recv_file_ent
+@@ -715,7 +716,7 @@ static struct file_struct *recv_file_ent
}
#endif
args[ac++] = "--files-from";
--- old/receiver.c
+++ new/receiver.c
-@@ -124,12 +124,14 @@ int get_tmpname(char *fnametmp, char *fn
+@@ -123,12 +123,14 @@ int get_tmpname(char *fnametmp, char *fn
static int receive_data(int f_in, char *fname_r, int fd_r, OFF_T size_r,
int32 len;
OFF_T offset = 0;
OFF_T offset2;
-@@ -149,6 +151,9 @@ static int receive_data(int f_in, char *
+@@ -148,6 +150,9 @@ static int receive_data(int f_in, char *
} else
mapbuf = NULL;
sum_init(checksum_seed);
if (append_mode > 0) {
-@@ -191,6 +196,8 @@ static int receive_data(int f_in, char *
+@@ -190,6 +195,8 @@ static int receive_data(int f_in, char *
cleanup_got_literal = 1;
sum_update(data, i);
if (fd != -1 && write_file(fd,data,i) != i)
goto report_write_error;
-@@ -217,6 +224,8 @@ static int receive_data(int f_in, char *
+@@ -216,6 +223,8 @@ static int receive_data(int f_in, char *
see_token(map, len);
sum_update(map, len);
}
if (updating_basis) {
-@@ -259,6 +268,8 @@ static int receive_data(int f_in, char *
+@@ -258,6 +267,8 @@ static int receive_data(int f_in, char *
}
sum_end(file_sum1);
if (mapbuf)
unmap_file(mapbuf);
-@@ -274,7 +285,7 @@ static int receive_data(int f_in, char *
+@@ -273,7 +284,7 @@ static int receive_data(int f_in, char *
static void discard_receive_data(int f_in, OFF_T length)
{
}
static void handle_delayed_updates(char *local_name)
-@@ -621,7 +632,7 @@ int recv_files(int f_in, char *local_nam
+@@ -622,7 +633,7 @@ int recv_files(int f_in, char *local_nam
/* recv file data */
recv_ok = receive_data(f_in, fnamecmp, fd1, st.st_size,
extern int make_backups;
extern mode_t orig_umask;
+extern char *link_by_hash_dir;
- extern struct stats stats;
extern struct file_list *cur_flist, *first_flist, *dir_flist;
extern struct chmod_mode_struct *daemon_chmod_modes;
-@@ -374,8 +375,15 @@ void finish_transfer(char *fname, char *
+
+@@ -373,8 +374,15 @@ void finish_transfer(char *fname, char *
/* move tmp file over real file */
if (verbose > 2)
rprintf(FINFO, "renaming %s to %s\n", fnametmp, fname);
+}
--- old/receiver.c
+++ new/receiver.c
-@@ -49,6 +49,7 @@ extern int checksum_seed;
- extern int inplace;
- extern int delay_updates;
- extern struct stats stats;
-+extern char *dest_filter;
- extern char *stdout_format;
+@@ -52,6 +52,7 @@ extern struct stats stats;
extern char *tmpdir;
extern char *partial_dir;
-@@ -350,6 +351,8 @@ int recv_files(int f_in, char *local_nam
+ extern char *basis_dir[];
++extern char *dest_filter;
+ extern struct file_list *cur_flist, *first_flist;
+ extern struct filter_list_struct server_filter_list;
+
+@@ -349,6 +350,8 @@ int recv_files(int f_in, char *local_nam
enum logcode log_code = log_before_transfer ? FLOG : FINFO;
int max_phase = protocol_version >= 29 ? 2 : 1;
int ndx, recv_ok;
if (verbose > 2)
rprintf(FINFO, "recv_files(%d) starting\n", cur_flist->count);
-@@ -359,6 +362,23 @@ int recv_files(int f_in, char *local_nam
+@@ -358,6 +361,23 @@ int recv_files(int f_in, char *local_nam
updating_basis = inplace;
while (1) {
cleanup_disable();
-@@ -619,6 +639,9 @@ int recv_files(int f_in, char *local_nam
+@@ -620,6 +640,9 @@ int recv_files(int f_in, char *local_nam
else if (!am_server && verbose && do_progress)
rprintf(FINFO, "%s\n", fname);
/* recv file data */
recv_ok = receive_data(f_in, fnamecmp, fd1, st.st_size,
fname, fd2, F_LENGTH(file));
-@@ -633,6 +656,16 @@ int recv_files(int f_in, char *local_nam
+@@ -634,6 +657,16 @@ int recv_files(int f_in, char *local_nam
exit_cleanup(RERR_FILEIO);
}
--protocol=NUM force an older protocol version to be used
--checksum-seed=NUM set block/file checksum seed (advanced)
-4, --ipv4 prefer IPv4
-@@ -1774,6 +1777,33 @@ file previously generated by bf(--write-
+@@ -1804,6 +1807,33 @@ file previously generated by bf(--write-
If em(FILE) is bf(-), the batch data will be read from standard input.
See the "BATCH MODE" section for details.
version of rsync. For instance, if rsync 2.6.4 is being used with the
--- old/sender.c
+++ new/sender.c
-@@ -44,6 +44,7 @@ extern int batch_fd;
+@@ -42,6 +42,7 @@ extern int do_progress;
+ extern int inplace;
+ extern int batch_fd;
extern int write_batch;
++extern char *source_filter;
extern struct stats stats;
extern struct file_list *cur_flist, *first_flist;
-+extern char *source_filter;
- extern char *stdout_format;
- /**
-@@ -176,6 +177,26 @@ void send_files(int f_in, int f_out)
+@@ -175,6 +176,26 @@ void send_files(int f_in, int f_out)
enum logcode log_code = log_before_transfer ? FLOG : FINFO;
int f_xfer = write_batch < 0 ? batch_fd : f_out;
int ndx, j;
if (verbose > 2)
rprintf(FINFO, "send_files starting\n");
-@@ -266,6 +287,7 @@ void send_files(int f_in, int f_out)
+@@ -265,6 +286,7 @@ void send_files(int f_in, int f_out)
exit_cleanup(RERR_PROTOCOL);
}
fd = do_open(fname, O_RDONLY, 0);
if (fd == -1) {
if (errno == ENOENT) {
-@@ -296,6 +318,33 @@ void send_files(int f_in, int f_out)
+@@ -295,6 +317,33 @@ void send_files(int f_in, int f_out)
exit_cleanup(RERR_PROTOCOL);
}
if (st.st_size) {
int32 read_size = MAX(s->blength * 3, MAX_MAP_SIZE);
mbuf = map_file(fd, st.st_size, read_size, s->blength);
-@@ -337,6 +386,8 @@ void send_files(int f_in, int f_out)
+@@ -336,6 +385,8 @@ void send_files(int f_in, int f_out)
}
}
close(fd);