+ deleting = 0;
+ return ret;
+}
---- orig/options.c 2004-11-27 18:27:35
+--- orig/options.c 2005-01-17 23:11:45
+++ options.c 2004-11-27 18:37:18
@@ -115,10 +115,14 @@ int no_detach = 0;
int write_batch = 0;
rprintf(F," --suffix=SUFFIX backup suffix (default %s w/o --backup-dir)\n",BACKUP_SUFFIX);
+ rprintf(F," --delete-suffix=SUFFIX deleted files suffix (default %s w/o --backup-dir)\n",BACKUP_SUFFIX);
rprintf(F," -u, --update update only (don't overwrite newer files)\n");
- rprintf(F," --inplace update destination files inplace (SEE MAN PAGE)\n");
+ rprintf(F," --inplace update destination files in-place (SEE MAN PAGE)\n");
rprintf(F," -K, --keep-dirlinks treat symlinked dir on receiver as dir\n");
-@@ -329,6 +337,7 @@ static struct poptOption long_options[]
+@@ -330,6 +338,7 @@ static struct poptOption long_options[]
/* longName, shortName, argInfo, argPtr, value, descrip, argDesc */
{"version", 0, POPT_ARG_NONE, 0, OPT_VERSION, 0, 0},
{"suffix", 0, POPT_ARG_STRING, &backup_suffix, 0, 0, 0 },
{"rsync-path", 0, POPT_ARG_STRING, &rsync_path, 0, 0, 0 },
{"password-file", 0, POPT_ARG_STRING, &password_file, 0, 0, 0 },
{"ignore-times", 'I', POPT_ARG_NONE, &ignore_times, 0, 0, 0 },
-@@ -396,6 +405,7 @@ static struct poptOption long_options[]
+@@ -398,6 +407,7 @@ static struct poptOption long_options[]
{"log-format", 0, POPT_ARG_STRING, &log_format, 0, 0, 0 },
{"bwlimit", 0, POPT_ARG_INT, &bwlimit, 0, 0, 0 },
{"backup-dir", 0, POPT_ARG_STRING, &backup_dir, 0, 0, 0 },
{"hard-links", 'H', POPT_ARG_NONE, &preserve_hard_links, 0, 0, 0 },
{"read-batch", 0, POPT_ARG_STRING, &batch_name, OPT_READ_BATCH, 0, 0 },
{"write-batch", 0, POPT_ARG_STRING, &batch_name, OPT_WRITE_BATCH, 0, 0 },
-@@ -866,6 +876,8 @@ int parse_arguments(int *argc, const cha
+@@ -867,6 +877,8 @@ int parse_arguments(int *argc, const cha
partial_dir = sanitize_path(NULL, partial_dir, NULL, 0);
if (backup_dir)
backup_dir = sanitize_path(NULL, backup_dir, NULL, 0);
if (files_from)
files_from = sanitize_path(NULL, files_from, NULL, 0);
}
-@@ -892,6 +904,12 @@ int parse_arguments(int *argc, const cha
+@@ -893,6 +905,12 @@ int parse_arguments(int *argc, const cha
if (check_exclude(elp, backup_dir, 1) < 0)
goto options_rejected;
}
}
if (server_exclude_list.head && files_from) {
clean_fname(files_from, 1);
-@@ -912,6 +930,16 @@ int parse_arguments(int *argc, const cha
+@@ -913,6 +931,16 @@ int parse_arguments(int *argc, const cha
backup_suffix);
return 0;
}
if (backup_dir) {
backup_dir_len = strlcpy(backup_dir_buf, backup_dir, sizeof backup_dir_buf);
backup_dir_remainder = sizeof backup_dir_buf - backup_dir_len;
-@@ -931,6 +959,31 @@ int parse_arguments(int *argc, const cha
+@@ -932,6 +960,31 @@ int parse_arguments(int *argc, const cha
"--suffix cannot be a null string without --backup-dir\n");
return 0;
}
if (do_progress && !verbose)
verbose = 1;
-@@ -1144,6 +1197,10 @@ void server_options(char **args,int *arg
+@@ -1139,6 +1192,10 @@ void server_options(char **args,int *arg
args[ac++] = "--backup-dir";
args[ac++] = backup_dir;
}
/* Only send --suffix if it specifies a non-default value. */
if (strcmp(backup_suffix, backup_dir ? "" : BACKUP_SUFFIX) != 0) {
-@@ -1152,7 +1209,13 @@ void server_options(char **args,int *arg
+@@ -1147,7 +1204,13 @@ void server_options(char **args,int *arg
goto oom;
args[ac++] = arg;
}
if (am_sender) {
if (delete_excluded)
args[ac++] = "--delete-excluded";
---- orig/receiver.c 2004-11-27 17:57:31
+--- orig/receiver.c 2005-01-17 23:11:45
+++ receiver.c 2004-11-03 23:10:06
-@@ -43,8 +43,11 @@ extern char *basis_dir[];
+@@ -44,8 +44,11 @@ extern int basis_dir_cnt;
extern int make_backups;
extern int do_progress;
extern char *backup_dir;
extern int cleanup_got_literal;
extern int module_id;
extern int ignore_errors;
-@@ -78,11 +81,14 @@ static void delete_one(char *fn, int is_
+@@ -79,11 +82,14 @@ static void delete_one(char *fn, int is_
}
}
}
-@@ -124,11 +130,12 @@ void delete_files(struct file_list *flis
+@@ -125,11 +131,12 @@ void delete_files(struct file_list *flis
if (flist_find(flist,local_file_list->files[i]) < 0) {
char *f = f_name(local_file_list->files[i]);
int mode = local_file_list->files[i]->mode;
This patch from Sami Farin lets you specify --fsync if you want fsync()
to be called on every file we write.
---- orig/options.c 2004-11-27 17:53:24
+--- orig/options.c 2005-01-17 23:11:45
+++ options.c 2004-11-27 18:10:44
@@ -38,6 +38,7 @@ int make_backups = 0;
**/
rprintf(F," --suffix=SUFFIX backup suffix (default %s w/o --backup-dir)\n",BACKUP_SUFFIX);
+ rprintf(F," --fsync fsync every written file\n");
rprintf(F," -u, --update update only (don't overwrite newer files)\n");
- rprintf(F," --inplace update destination files inplace (SEE MAN PAGE)\n");
+ rprintf(F," --inplace update destination files in-place (SEE MAN PAGE)\n");
rprintf(F," -K, --keep-dirlinks treat symlinked dir on receiver as dir\n");
-@@ -349,6 +351,7 @@ static struct poptOption long_options[]
+@@ -350,6 +352,7 @@ static struct poptOption long_options[]
{"safe-links", 0, POPT_ARG_NONE, &safe_symlinks, 0, 0, 0 },
{"help", 'h', POPT_ARG_NONE, 0, 'h', 0, 0 },
{"backup", 'b', POPT_ARG_NONE, &make_backups, 0, 0, 0 },
{"dry-run", 'n', POPT_ARG_NONE, &dry_run, 0, 0, 0 },
{"sparse", 'S', POPT_ARG_NONE, &sparse_files, 0, 0, 0 },
{"cvs-exclude", 'C', POPT_ARG_NONE, &cvs_exclude, 0, 0, 0 },
-@@ -1213,6 +1216,9 @@ void server_options(char **args,int *arg
+@@ -1208,6 +1211,9 @@ void server_options(char **args,int *arg
args[ac++] = tmpdir;
}
if (basis_dir[0] && am_sender) {
/* the server only needs this option if it is not the sender,
* and it may be an older version that doesn't know this
---- orig/receiver.c 2004-11-27 17:57:31
+--- orig/receiver.c 2005-01-17 23:11:45
+++ receiver.c 2004-07-16 20:13:31
@@ -37,6 +37,7 @@ extern int preserve_hard_links;
extern int preserve_perms;
extern char *tmpdir;
extern char *partial_dir;
extern char *basis_dir[];
-@@ -306,6 +307,12 @@ static int receive_data(int f_in, char *
+@@ -310,6 +311,12 @@ static int receive_data(int f_in, char *
exit_cleanup(RERR_FILEIO);
}
handle relative symlinks properly, and that has not yet been fixed
in this modified version.
---- orig/flist.c 2004-09-21 09:40:27
+--- orig/flist.c 2005-01-01 21:11:00
+++ flist.c 2004-07-16 16:58:04
@@ -50,6 +50,7 @@ extern int filesfrom_fd;
extern int one_file_system;
/**
* Create a file_struct for a named file by reading its stat()
* information and performing extensive checks against global
-@@ -845,7 +870,13 @@ skip_excludes:
+@@ -850,7 +875,13 @@ skip_excludes:
basename_len = strlen(basename) + 1; /* count the '\0' */
#if SUPPORT_LINKS
#else
linkname_len = 0;
#endif
---- orig/options.c 2004-09-23 17:42:07
+--- orig/options.c 2005-01-17 23:11:45
+++ options.c 2004-07-16 16:12:29
@@ -42,6 +42,7 @@ int archive_mode = 0;
int keep_dirlinks = 0;
int preserve_hard_links = 0;
int preserve_perms = 0;
int preserve_devices = 0;
-@@ -244,6 +245,7 @@ void usage(enum logcode F)
- rprintf(F," --inplace update destination files inplace (SEE MAN PAGE)\n");
+@@ -251,6 +252,7 @@ void usage(enum logcode F)
+ rprintf(F," --inplace update destination files in-place (SEE MAN PAGE)\n");
rprintf(F," -K, --keep-dirlinks treat symlinked dir on receiver as dir\n");
rprintf(F," -l, --links copy symlinks as symlinks\n");
+ rprintf(F," --links-depth=NUM follow symlinks up to NUM depth\n");
rprintf(F," -L, --copy-links copy the referent of all symlinks\n");
rprintf(F," --copy-unsafe-links copy the referent of \"unsafe\" symlinks\n");
rprintf(F," --safe-links ignore \"unsafe\" symlinks\n");
-@@ -353,6 +355,7 @@ static struct poptOption long_options[]
+@@ -357,6 +359,7 @@ static struct poptOption long_options[]
{"inplace", 0, POPT_ARG_NONE, &inplace, 0, 0, 0 },
{"keep-dirlinks", 'K', POPT_ARG_NONE, &keep_dirlinks, 0, 0, 0 },
{"links", 'l', POPT_ARG_NONE, &preserve_links, 0, 0, 0 },
+ preserve_gid = 2;
+ }
}
---- orig/options.c 2004-09-23 17:42:07
+--- orig/options.c 2005-01-17 23:11:45
+++ options.c 2004-09-09 01:59:08
-@@ -358,8 +358,8 @@ static struct poptOption long_options[]
+@@ -362,8 +362,8 @@ static struct poptOption long_options[]
{"no-whole-file", 0, POPT_ARG_VAL, &whole_file, 0, 0, 0 },
{"copy-unsafe-links", 0, POPT_ARG_NONE, ©_unsafe_links, 0, 0, 0 },
{"perms", 'p', POPT_ARG_NONE, &preserve_perms, 0, 0, 0 },
{"devices", 'D', POPT_ARG_NONE, &preserve_devices, 0, 0, 0 },
{"times", 't', POPT_ARG_NONE, &preserve_times, 0, 0, 0 },
{"checksum", 'c', POPT_ARG_NONE, &always_checksum, 0, 0, 0 },
-@@ -568,6 +568,14 @@ int parse_arguments(int *argc, const cha
+@@ -651,6 +651,14 @@ int parse_arguments(int *argc, const cha
usage(FINFO);
exit_cleanup(0);
case 'v':
verbose++;
break;
-@@ -707,8 +715,8 @@ int parse_arguments(int *argc, const cha
+@@ -846,8 +854,8 @@ int parse_arguments(int *argc, const cha
#endif
preserve_perms = 1;
preserve_times = 1;
preserve_devices = 1;
}
-@@ -942,10 +950,16 @@ void server_options(char **args,int *arg
+@@ -1067,10 +1075,16 @@ void server_options(char **args,int *arg
if (preserve_hard_links)
argstr[x++] = 'H';
if (preserve_devices)
argstr[x++] = 'D';
if (preserve_times)
---- orig/rsync.c 2004-09-07 21:45:30
+--- orig/rsync.c 2005-01-10 09:50:46
+++ rsync.c 2004-09-09 01:59:08
@@ -25,7 +25,6 @@
extern int verbose;
+ change_uid = preserve_uid > 1 && st->st_uid != file->uid;
change_gid = preserve_gid && file->gid != GID_NONE
&& st->st_gid != file->gid;
- if (change_uid || change_gid) {
+ #if !HAVE_LCHOWN && !CHOWN_MODIFIES_SYMLINK
--- orig/uidlist.c 2004-04-29 19:37:25
+++ uidlist.c 2004-09-09 01:59:08
@@ -35,7 +35,6 @@ extern int verbose;
make proto
---- orig/io.c 2005-01-14 18:30:18
+--- orig/io.c 2005-01-17 23:11:45
+++ io.c 2005-01-10 10:49:17
-@@ -243,6 +243,14 @@ static void read_msg_fd(void)
+@@ -244,6 +244,14 @@ static void read_msg_fd(void)
read_loop(fd, buf, 4);
redo_list_add(IVAL(buf,0));
break;
case MSG_INFO:
case MSG_ERROR:
case MSG_LOG:
-@@ -676,6 +684,16 @@ static int readfd_unbuffered(int fd, cha
+@@ -677,6 +685,16 @@ static int readfd_unbuffered(int fd, cha
read_loop(fd, iobuf_in, remaining);
iobuf_in_ndx = 0;
break;
case MSG_INFO:
case MSG_ERROR:
if (remaining >= sizeof line) {
---- orig/main.c 2005-01-14 18:30:18
+--- orig/main.c 2005-01-17 23:11:45
+++ main.c 2004-08-13 08:24:23
@@ -42,6 +42,7 @@ extern int list_only;
extern int local_server;
recv_exclude_list(f_in);
if (cvs_exclude)
-@@ -732,6 +735,9 @@ int client_run(int f_in, int f_out, pid_
+@@ -730,6 +733,9 @@ int client_run(int f_in, int f_out, pid_
exit_cleanup(status);
}
if (argc == 0)
list_only = 1;
---- orig/options.c 2005-01-15 04:40:15
+--- orig/options.c 2005-01-17 23:11:45
+++ options.c 2005-01-10 10:46:47
@@ -88,8 +88,10 @@ int daemon_bwlimit = 0;
int bwlimit = 0;
*argv = poptGetArgs(pc);
*argc = count_args(*argv);
-@@ -1240,6 +1247,9 @@ void server_options(char **args,int *arg
+@@ -1234,6 +1241,9 @@ void server_options(char **args,int *arg
args[ac++] = "--no-relative";
}
*argc = ac;
return;
---- orig/receiver.c 2005-01-10 09:46:01
+--- orig/receiver.c 2005-01-17 23:11:45
+++ receiver.c 2004-08-13 08:38:51
-@@ -46,6 +46,7 @@ extern char *backup_dir;
+@@ -47,6 +47,7 @@ extern char *backup_dir;
extern char *backup_suffix;
extern int backup_suffix_len;
extern int cleanup_got_literal;
extern int module_id;
extern int ignore_errors;
extern int orig_umask;
-@@ -342,7 +343,7 @@ int recv_files(int f_in, struct file_lis
+@@ -343,7 +344,7 @@ int recv_files(int f_in, struct file_lis
char *fname, fbuf[MAXPATHLEN];
char template[MAXPATHLEN];
char fnametmp[MAXPATHLEN];
char fnamecmpbuf[MAXPATHLEN];
struct file_struct *file;
struct stats initial_stats;
-@@ -583,7 +584,12 @@ int recv_files(int f_in, struct file_lis
+@@ -589,7 +590,12 @@ int recv_files(int f_in, struct file_lis
cleanup_disable();
int msgtype = csum_length == SUM_LENGTH || read_batch ?
FERROR : FINFO;
if (msgtype == FERROR || verbose) {
-@@ -607,9 +613,8 @@ int recv_files(int f_in, struct file_lis
+@@ -613,9 +619,8 @@ int recv_files(int f_in, struct file_lis
keptstr, redostr);
}
if (csum_length != SUM_LENGTH) {
}
}
}
---- orig/rsync.h 2005-01-10 00:21:12
+--- orig/rsync.h 2005-01-17 23:11:45
+++ rsync.h 2004-07-03 20:17:10
@@ -60,6 +60,7 @@
#define FLAG_TOP_DIR (1<<0)
+#define FLAG_SENT (1<<7) /* sender only */
/* update this if you make incompatible changes */
- #define PROTOCOL_VERSION 28
-@@ -134,6 +135,7 @@ enum logcode { FERROR=1, FINFO=2, FLOG=3
+ #define PROTOCOL_VERSION 29
+@@ -137,6 +138,7 @@ enum logcode { FERROR=1, FINFO=2, FLOG=3
/* Messages types that are sent over the message channel. The logcode
* values must all be present here with identical numbers. */
enum msgcode {
MSG_DONE=5, /* current phase is done */
MSG_REDO=4, /* reprocess indicated flist index */
MSG_ERROR=FERROR, MSG_INFO=FINFO, MSG_LOG=FLOG, /* remote logging */
---- orig/rsync.yo 2005-01-15 04:36:32
+--- orig/rsync.yo 2005-01-17 23:11:46
+++ rsync.yo 2004-07-03 20:17:10
@@ -343,6 +343,7 @@ verb(
--delete delete files that don't exist on sender
--ignore-errors delete even if there are I/O errors
--max-delete=NUM don't delete more than NUM files
--max-size=SIZE don't transfer any file larger than SIZE
-@@ -693,6 +694,11 @@ One reason to use --delete-after is to a
+@@ -695,6 +696,11 @@ One reason to use --delete-after is to a
the transfer (while the receiving side is scanned for deletions) as this
delay might cause the transfer to timeout.
dit(bf(--ignore-errors)) Tells --delete to go ahead and delete files
even when there are I/O errors.
---- orig/sender.c 2005-01-01 21:11:01
+--- orig/sender.c 2005-01-17 23:11:46
+++ sender.c 2004-07-26 16:49:19
@@ -26,6 +26,7 @@ extern int io_error;
extern int dry_run;
extern int am_daemon;
+extern int delete_sent_files;
extern int protocol_version;
+ extern int updating_basis_file;
extern int make_backups;
- extern struct stats stats;
-@@ -108,7 +109,29 @@ static struct sum_struct *receive_sums(i
+@@ -94,7 +95,29 @@ static struct sum_struct *receive_sums(i
return s;
}
void send_files(struct file_list *flist, int f_out, int f_in)
{
-@@ -127,6 +150,8 @@ void send_files(struct file_list *flist,
+@@ -113,6 +136,8 @@ void send_files(struct file_list *flist,
if (verbose > 2)
rprintf(FINFO, "send_files starting\n");
while (1) {
unsigned int offset;
-@@ -257,6 +282,9 @@ void send_files(struct file_list *flist,
+@@ -248,6 +273,9 @@ void send_files(struct file_list *flist,
rprintf(FINFO, "sender finished %s\n",
safe_fname(fname));
}
Do we need configure support for mktime()?
---- orig/io.c 2005-01-01 21:11:00
+--- orig/io.c 2005-01-17 23:11:45
+++ io.c 2004-07-17 15:28:36
-@@ -50,6 +50,7 @@ extern int am_generator;
- extern int eol_nulls;
+@@ -51,6 +51,7 @@ extern int eol_nulls;
+ extern int csum_length;
extern int checksum_seed;
extern int protocol_version;
+extern time_t stop_at_utime;
extern char *remote_filesfrom_file;
extern struct stats stats;
-@@ -136,17 +137,22 @@ static void check_timeout(void)
+@@ -137,17 +138,22 @@ static void check_timeout(void)
{
time_t t;
if (!am_server && !am_daemon) {
rprintf(FERROR, "io timeout after %d seconds - exiting\n",
(int)(t-last_io));
---- orig/options.c 2005-01-01 21:11:00
+--- orig/options.c 2005-01-17 23:11:45
+++ options.c 2005-01-01 21:19:56
@@ -98,6 +98,7 @@ int blocking_io = -1;
int checksum_seed = 0;
default:
/* A large opt value means that set_refuse_options()
* turned this option off (opt-BASE is its index). */
-@@ -1141,6 +1177,15 @@ void server_options(char **args,int *arg
+@@ -1135,6 +1171,15 @@ void server_options(char **args,int *arg
args[ac++] = arg;
}
if (backup_dir) {
args[ac++] = "--backup-dir";
args[ac++] = backup_dir;
---- orig/rsync.yo 2005-01-01 21:11:01
+--- orig/rsync.yo 2005-01-17 23:11:46
+++ rsync.yo 2004-07-15 02:44:40
@@ -376,6 +376,8 @@ verb(
--log-format=FORMAT log file transfers using specified format
--write-batch=FILE write a batch to FILE
--read-batch=FILE read a batch from FILE
--checksum-seed=NUM set block/file checksum seed
-@@ -1014,6 +1016,19 @@ transfer was too fast, it will wait befo
+@@ -1025,6 +1027,19 @@ transfer was too fast, it will wait befo
result is an average transfer rate equaling the specified limit. A value
of zero specifies no limit.