int quiet = 0;
int itemize_changes = 0;
int log_before_transfer = 0;
+int log_format_has_i = 0;
+int log_format_has_o_or_i = 0;
int always_checksum = 0;
int list_only = 0;
if (!op->longName && !*shortname)
break;
if ((op->longName && wildmatch(bp, op->longName))
- || (*shortname && wildmatch(bp, shortname))
- || op->val == OPT_DAEMON) {
+ || (*shortname && wildmatch(bp, shortname))) {
if (op->argInfo == POPT_ARG_VAL)
op->argInfo = POPT_ARG_NONE;
op->val = (op - long_options) + OPT_REFUSED_BASE;
*cp = ' ';
bp = cp + 1;
}
+
+ for (op = long_options; ; op++) {
+ *shortname = op->shortName;
+ if (!op->longName && !*shortname)
+ break;
+ if (op->val == OPT_DAEMON) {
+ if (op->argInfo == POPT_ARG_VAL)
+ op->argInfo = POPT_ARG_NONE;
+ op->val = (op - long_options) + OPT_REFUSED_BASE;
+ }
+ }
}
if (log_format) {
if (strstr(log_format, "%i") != NULL)
- itemize_changes = 1;
+ log_format_has_i = 1;
if (strstr(log_format, "%b") == NULL
&& strstr(log_format, "%c") == NULL)
log_before_transfer = !am_server;
} else if (itemize_changes) {
log_format = "%i %n%L";
+ log_format_has_i = 1;
log_before_transfer = !am_server;
}
log_format = "%n%L";
log_before_transfer = !am_server;
}
+ if (log_format_has_i
+ || (log_format && strstr(log_format, "%o") != NULL))
+ log_format_has_o_or_i = 1;
if (daemon_bwlimit && (!bwlimit || bwlimit > daemon_bwlimit))
bwlimit = daemon_bwlimit;
* default for remote transfers, and in any case old versions
* of rsync will not understand it. */
- if (itemize_changes)
- argstr[x++] = 'i';
if (preserve_hard_links)
argstr[x++] = 'H';
if (preserve_uid)
if (list_only > 1)
args[ac++] = "--list-only";
- /* The server side doesn't use our log-format, but if verbose isn't
- * on, they may need to know that we want some extra messages. */
- if (log_format && !verbose && !itemize_changes)
- args[ac++] = "--log-format=specified";
+ /* The server side doesn't use our log-format, but in certain
+ * circumstances they need to know a little about the option. */
+ if (log_format && am_sender) {
+ if (log_format_has_i)
+ args[ac++] = "--log-format=%i";
+ else if (log_format_has_o_or_i)
+ args[ac++] = "--log-format=%o";
+ else if (!verbose)
+ args[ac++] = "--log-format=X";
+ }
if (block_size) {
if (asprintf(&arg, "-B%lu", block_size) < 0)