From e90aab4982c4ce8b3f778cc072d677dd0dbb3dca Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Thu, 29 Sep 2005 18:07:55 +0000 Subject: [PATCH] Changed the variable names for --existing and --ignore-existing. --- generator.c | 19 +++++++++---------- options.c | 18 ++++++++++-------- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/generator.c b/generator.c index b795f0f1..d50c090f 100644 --- a/generator.c +++ b/generator.c @@ -52,7 +52,8 @@ extern int ignore_errors; extern int remove_sent_files; extern int delay_updates; extern int update_only; -extern int opt_ignore_existing; +extern int ignore_existing; +extern int ignore_non_existing; extern int inplace; extern int append_mode; extern int make_backups; @@ -75,7 +76,6 @@ extern int link_dest; extern int whole_file; extern int list_only; extern int read_batch; -extern int only_existing; extern int orig_umask; extern int safe_symlinks; extern long block_size; /* "long" because popt can't set an int32. */ @@ -675,8 +675,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx, stat_errno = errno; } - if (only_existing && statret == -1 && stat_errno == ENOENT) { - /* we only want to update existing files */ + if (ignore_non_existing && statret == -1 && stat_errno == ENOENT) { if (verbose > 1) { rprintf(FINFO, "not creating new %s \"%s\"\n", S_ISDIR(file->mode) ? "directory" : "file", @@ -874,7 +873,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx, return; } - if (opt_ignore_existing && statret == 0) { + if (ignore_existing && statret == 0) { if (verbose > 1) rprintf(FINFO, "%s exists\n", safe_fname(fname)); return; @@ -1178,8 +1177,8 @@ void generate_files(int f_out, struct file_list *flist, char *local_name) int lull_mod = allowed_lull * 5; int need_retouch_dir_times = preserve_times && !omit_dir_times; int need_retouch_dir_perms = 0; - int save_only_existing = only_existing; - int save_opt_ignore_existing = opt_ignore_existing; + int save_ignore_existing = ignore_existing; + int save_ignore_non_existing = ignore_non_existing; int save_do_progress = do_progress; int save_make_backups = make_backups; @@ -1266,7 +1265,7 @@ void generate_files(int f_out, struct file_list *flist, char *local_name) phase++; csum_length = SUM_LENGTH; - only_existing = max_size = opt_ignore_existing = 0; + max_size = ignore_existing = ignore_non_existing = 0; update_only = always_checksum = size_only = 0; ignore_times = 1; if (append_mode) /* resend w/o append mode */ @@ -1288,8 +1287,8 @@ void generate_files(int f_out, struct file_list *flist, char *local_name) } phase++; - only_existing = save_only_existing; - opt_ignore_existing = save_opt_ignore_existing; + ignore_non_existing = save_ignore_non_existing; + ignore_existing = save_ignore_existing; make_backups = save_make_backups; if (verbose > 2) diff --git a/options.c b/options.c index b4757747..ba7347ae 100644 --- a/options.c +++ b/options.c @@ -94,8 +94,8 @@ int daemon_bwlimit = 0; int bwlimit = 0; int fuzzy_basis = 0; size_t bwlimit_writemax = 0; -int only_existing = 0; -int opt_ignore_existing = 0; +int ignore_existing = 0; +int ignore_non_existing = 0; int need_messages_from_generator = 0; int max_delete = 0; OFF_T max_size = 0; @@ -415,8 +415,9 @@ static struct poptOption long_options[] = { {"size-only", 0, POPT_ARG_NONE, &size_only, 0, 0, 0 }, {"one-file-system", 'x', POPT_ARG_NONE, &one_file_system, 0, 0, 0 }, {"update", 'u', POPT_ARG_NONE, &update_only, 0, 0, 0 }, - {"existing", 0, POPT_ARG_NONE, &only_existing, 0, 0, 0 }, - {"ignore-existing", 0, POPT_ARG_NONE, &opt_ignore_existing, 0, 0, 0 }, + {"existing", 0, POPT_ARG_NONE, &ignore_non_existing, 0, 0, 0 }, + {"ignore-existing", 0, POPT_ARG_NONE, &ignore_existing, 0, 0, 0 }, + {"ignore-non-existing",0,POPT_ARG_NONE, &ignore_non_existing, 0, 0, 0 }, {"max-size", 0, POPT_ARG_STRING, &max_size_arg, OPT_MAX_SIZE, 0, 0 }, {"sparse", 'S', POPT_ARG_NONE, &sparse_files, 0, 0, 0 }, {"inplace", 0, POPT_ARG_NONE, &inplace, 0, 0, 0 }, @@ -1498,12 +1499,13 @@ void server_options(char **args,int *argc) if (numeric_ids) args[ac++] = "--numeric-ids"; - if (only_existing && am_sender) - args[ac++] = "--existing"; - - if (opt_ignore_existing && am_sender) + if (ignore_existing && am_sender) args[ac++] = "--ignore-existing"; + /* Backward compatibility: send --existing, not --ignore-non-existing. */ + if (ignore_non_existing && am_sender) + args[ac++] = "--existing"; + if (append_mode) args[ac++] = "--append"; else if (inplace) -- 2.34.1