- Moved setting of list_only and xfer_dirs from main.c to options.c.
- Fixed the ability of the user to force --no-dirs.
- Added the --old-dirs/--old-d option to make it easier to interact
in list-only mode with an older rsync.
- Suggest the use of --old-d instead of "-r --exclude='/*/*'".
+ - Added the --old-dirs (--old-d) option to make it easier for a user to
+ ask for file-listings with older rsync versions (this is easier than
+ having to type "-r --exclude='/*/*'" manually).
+
- When getting an error while asking an older rsync daemon for a file
listing, rsync will try to notice if the error is a rejection of the
--dirs (-d) option and let the user know how to work around the issue.
- When getting an error while asking an older rsync daemon for a file
listing, rsync will try to notice if the error is a rejection of the
--dirs (-d) option and let the user know how to work around the issue.
if (saw_d) {
rprintf(FWARNING,
if (saw_d) {
rprintf(FWARNING,
- "*** Try adding \"-r --exclude='/*/*'\" "
- "if remote rsync is <= 2.6.3 ***\n");
+ "*** Try using \"--old-d\" if remote rsync is <= 2.6.3 ***\n");
io_start_multiplex_out();
}
io_start_multiplex_out();
}
- if (argc == 0) {
- list_only |= 1;
- xfer_dirs |= 1;
- }
-
send_filter_list(read_batch ? -1 : f_out);
if (filesfrom_fd >= 0) {
send_filter_list(read_batch ? -1 : f_out);
if (filesfrom_fd >= 0) {
static char *dotarg[1] = { "." };
p = dotarg[0];
remote_argv = dotarg;
static char *dotarg[1] = { "." };
p = dotarg[0];
remote_argv = dotarg;
- list_only |= 1;
- xfer_dirs |= 1;
}
remote_argv[i] = arg;
}
}
remote_argv[i] = arg;
}
- if (argc == 0) {
- list_only |= 1;
- xfer_dirs |= 1;
- }
}
if (daemon_over_rsh < 0)
}
if (daemon_over_rsh < 0)
{"dirs", 'd', POPT_ARG_VAL, &xfer_dirs, 2, 0, 0 },
{"no-dirs", 0, POPT_ARG_VAL, &xfer_dirs, 0, 0, 0 },
{"no-d", 0, POPT_ARG_VAL, &xfer_dirs, 0, 0, 0 },
{"dirs", 'd', POPT_ARG_VAL, &xfer_dirs, 2, 0, 0 },
{"no-dirs", 0, POPT_ARG_VAL, &xfer_dirs, 0, 0, 0 },
{"no-d", 0, POPT_ARG_VAL, &xfer_dirs, 0, 0, 0 },
+ {"old-dirs", 0, POPT_ARG_VAL, &xfer_dirs, 4, 0, 0 },
+ {"old-d", 0, POPT_ARG_VAL, &xfer_dirs, 4, 0, 0 },
{"perms", 'p', POPT_ARG_VAL, &preserve_perms, 1, 0, 0 },
{"no-perms", 0, POPT_ARG_VAL, &preserve_perms, 0, 0, 0 },
{"no-p", 0, POPT_ARG_VAL, &preserve_perms, 0, 0, 0 },
{"perms", 'p', POPT_ARG_VAL, &preserve_perms, 1, 0, 0 },
{"no-perms", 0, POPT_ARG_VAL, &preserve_perms, 0, 0, 0 },
{"no-p", 0, POPT_ARG_VAL, &preserve_perms, 0, 0, 0 },
if (protect_args == 1 && am_server)
return 1;
if (protect_args == 1 && am_server)
return 1;
+ *argv_p = argv = poptGetArgs(pc);
+ *argc_p = argc = count_args(argv);
+
#ifndef SUPPORT_LINKS
if (preserve_links && !am_sender) {
snprintf(err_buf, sizeof err_buf,
#ifndef SUPPORT_LINKS
if (preserve_links && !am_sender) {
snprintf(err_buf, sizeof err_buf,
- if (xfer_dirs < 1)
- xfer_dirs = recurse || list_only;
+ if (argc < 2 && !read_batch)
+ list_only |= 1;
+
+ if (xfer_dirs >= 4) {
+ parse_rule(&filter_list, "- /*/*", 0, 0);
+ recurse = xfer_dirs = 1;
+ } else if (recurse)
+ xfer_dirs = 1;
+ else if (xfer_dirs < 0)
+ xfer_dirs = list_only ? 1 : 0;
if (relative_paths < 0)
relative_paths = files_from? 1 : 0;
if (relative_paths < 0)
relative_paths = files_from? 1 : 0;
need_messages_from_generator = 1;
}
need_messages_from_generator = 1;
}
- *argv_p = argv = poptGetArgs(pc);
- *argc_p = argc = count_args(argv);
-
if (sanitize_paths) {
int i;
for (i = argc; i-- > 0; )
if (sanitize_paths) {
int i;
for (i = argc; i-- > 0; )
argstr[x++] = 'n';
if (preserve_links)
argstr[x++] = 'l';
argstr[x++] = 'n';
if (preserve_links)
argstr[x++] = 'l';
- if ((list_only && !recurse) || xfer_dirs > 1
- || (xfer_dirs && !recurse && delete_mode && am_sender))
+ if ((xfer_dirs >= 2 && xfer_dirs < 4)
+ || (xfer_dirs && !recurse && (list_only || (delete_mode && am_sender))))
argstr[x++] = 'd';
if (am_sender) {
if (keep_dirlinks)
argstr[x++] = 'd';
if (am_sender) {
if (keep_dirlinks)
output a message to that effect for each one). If you specify both
bf(--dirs) and bf(--recursive), bf(--recursive) takes precedence.
output a message to that effect for each one). If you specify both
bf(--dirs) and bf(--recursive), bf(--recursive) takes precedence.
-This option is implied by the bf(--list-only) option (including an implied
+The bf(--dirs) option is implied by the bf(--files-from) option
+or the bf(--list-only) option (including an implied
bf(--list-only) usage) if bf(--recursive) wasn't specified (so that
directories are seen in the listing). Specify bf(--no-dirs) (or bf(--no-d))
bf(--list-only) usage) if bf(--recursive) wasn't specified (so that
directories are seen in the listing). Specify bf(--no-dirs) (or bf(--no-d))
-if you want to override this. This option is also implied by
-bf(--files-from).
+if you want to turn this off.
+
+There is also a backward-compatibility helper option, bf(--old-dirs) (or
+bf(--old-d)) that tells rsync to use a hack of "-r --exclude='/*/*'" to get
+an older rsync to list a single directory without recursing.
dit(bf(-l, --links)) When symlinks are encountered, recreate the
symlink on the destination.
dit(bf(-l, --links)) When symlinks are encountered, recreate the
symlink on the destination.