From d4021b6d9b9a644a539746c98fe24f61d95e8ea5 Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Mon, 21 Feb 2005 10:03:23 +0000 Subject: [PATCH] - Set omit_dir_times if backing up files w/o a backup dir. - Only send an explicitly specified -O (--omit-dir-times) if it won't be inferred by the receiver. --- options.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/options.c b/options.c index a02e6188..09b4055f 100644 --- a/options.c +++ b/options.c @@ -407,7 +407,7 @@ static struct poptOption long_options[] = { {"group", 'g', POPT_ARG_NONE, &preserve_gid, 0, 0, 0 }, {"devices", 'D', POPT_ARG_NONE, &preserve_devices, 0, 0, 0 }, {"times", 't', POPT_ARG_NONE, &preserve_times, 0, 0, 0 }, - {"omit-dir-times", 'O', POPT_ARG_NONE, &omit_dir_times, 0, 0, 0 }, + {"omit-dir-times", 'O', POPT_ARG_VAL, &omit_dir_times, 2, 0, 0 }, {"checksum", 'c', POPT_ARG_NONE, &always_checksum, 0, 0, 0 }, {"verbose", 'v', POPT_ARG_NONE, 0, 'v', 0, 0 }, {"quiet", 'q', POPT_ARG_NONE, 0, 'q', 0, 0 }, @@ -1088,6 +1088,8 @@ int parse_arguments(int *argc, const char ***argv, int frommain) "--suffix cannot be a null string without --backup-dir\n"); return 0; } + if (make_backups && !backup_dir) + omit_dir_times = 1; if (log_format) { if (strstr(log_format, "%i") != NULL) @@ -1272,7 +1274,7 @@ void server_options(char **args,int *argc) argstr[x++] = 'D'; if (preserve_times) argstr[x++] = 't'; - if (omit_dir_times && am_sender) + if (omit_dir_times == 2 && am_sender) argstr[x++] = 'O'; if (preserve_perms) argstr[x++] = 'p'; -- 2.34.1