X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/f9998046a3b0898810f8ed3b6368643b4c5874d9..968061bb65203ca9b0683ade0bf4bf238b8ce062:/options.c diff --git a/options.c b/options.c index 4779cfa1..77cbe10e 100644 --- a/options.c +++ b/options.c @@ -478,6 +478,8 @@ static struct poptOption long_options[] = { {"no-times", 0, POPT_ARG_VAL, &preserve_times, 0, 0, 0 }, {"no-t", 0, POPT_ARG_VAL, &preserve_times, 0, 0, 0 }, {"omit-dir-times", 'O', POPT_ARG_VAL, &omit_dir_times, 1, 0, 0 }, + {"no-omit-dir-times",0, POPT_ARG_VAL, &omit_dir_times, 0, 0, 0 }, + {"no-O", 0, POPT_ARG_VAL, &omit_dir_times, 0, 0, 0 }, {"modify-window", 0, POPT_ARG_INT, &modify_window, OPT_MODIFY_WINDOW, 0, 0 }, {"super", 0, POPT_ARG_VAL, &am_root, 2, 0, 0 }, {"no-super", 0, POPT_ARG_VAL, &am_root, 0, 0, 0 }, @@ -1395,9 +1397,6 @@ int parse_arguments(int *argc, const char ***argv, int frommain) } } - if (omit_dir_times && preserve_times > 1) - preserve_times = 1; - if (!backup_suffix) backup_suffix = backup_dir ? "" : BACKUP_SUFFIX; backup_suffix_len = strlen(backup_suffix); @@ -1430,8 +1429,15 @@ int parse_arguments(int *argc, const char ***argv, int frommain) "P *%s", backup_suffix); parse_rule(&filter_list, backup_dir_buf, 0, 0); } - if (make_backups && !backup_dir && preserve_times > 1) - preserve_times = 1; + + if (make_backups && !backup_dir) { + omit_dir_times = 0; /* Implied, so avoid -O to sender. */ + if (preserve_times > 1) + preserve_times = 1; + } else if (omit_dir_times) { + if (preserve_times > 1) + preserve_times = 1; + } if (stdout_format) { if (am_server && log_format_has(stdout_format, 'I'))