Changed the variable names for --existing and --ignore-existing.
authorWayne Davison <wayned@samba.org>
Thu, 29 Sep 2005 18:07:55 +0000 (18:07 +0000)
committerWayne Davison <wayned@samba.org>
Thu, 29 Sep 2005 18:07:55 +0000 (18:07 +0000)
generator.c
options.c

index b795f0f..d50c090 100644 (file)
@@ -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)
index b475774..ba7347a 100644 (file)
--- 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)