From ba412e2656240f1ac5953fedd1f914797589f62b Mon Sep 17 00:00:00 2001 From: Matt Domsch Date: Wed, 20 Feb 2013 22:06:34 -0600 Subject: [PATCH] use --files-from only on local source (not remote, not dest) The restriction to use --files-from on the source and not the destination list comes from the equivalent behavior in rsync. The restriction on not using it for remote sources is only because I haven't figured out the best way to handle that. That may be added in the future. --- S3/FileLists.py | 4 ++-- s3cmd | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/S3/FileLists.py b/S3/FileLists.py index 4b84b0889..c043b8217 100644 --- a/S3/FileLists.py +++ b/S3/FileLists.py @@ -179,7 +179,7 @@ def _append(d, key, value): result.append((key, [], values)) return result -def fetch_local_list(args, recursive = None): +def fetch_local_list(args, is_src = False, recursive = None): def _get_filelist_local(loc_list, local_uri, cache): info(u"Compiling list of local files...") @@ -195,7 +195,7 @@ def _get_filelist_local(loc_list, local_uri, cache): if local_uri.isdir(): local_base = deunicodise(local_uri.basename()) local_path = deunicodise(local_uri.path()) - if len(cfg.files_from): + if is_src and len(cfg.files_from): filelist = _get_filelist_from_file(cfg, local_path) single_file = False else: diff --git a/s3cmd b/s3cmd index 0804db88b..7d67c1305 100755 --- a/s3cmd +++ b/s3cmd @@ -271,7 +271,7 @@ def cmd_object_put(args): if len(args) == 0: raise ParameterError("Nothing to upload. Expecting a local file or directory.") - local_list, single_file_local = fetch_local_list(args) + local_list, single_file_local = fetch_local_list(args, is_src = True) local_list, exclude_list = filter_exclude_include(local_list) @@ -717,7 +717,7 @@ def cmd_sync_remote2local(args): s3 = S3(Config()) destination_base = args[-1] - local_list, single_file_local = fetch_local_list(destination_base, recursive = True) + local_list, single_file_local = fetch_local_list(destination_base, is_src = False, recursive = True) remote_list = fetch_remote_list(args[:-1], recursive = True, require_attribs = True) local_count = len(local_list) @@ -1136,7 +1136,7 @@ def cmd_sync_local2remote(args): error(u"or disable encryption with --no-encrypt parameter.") sys.exit(1) - local_list, single_file_local = fetch_local_list(args[:-1], recursive = True) + local_list, single_file_local = fetch_local_list(args[:-1], is_src = True, recursive = True) destinations = [args[-1]] if cfg.additional_destinations: