Skip to content

Commit

Permalink
use --files-from only on local source (not remote, not dest)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Matt Domsch authored and mdomsch committed Feb 21, 2013
1 parent bc547d1 commit ba412e2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions S3/FileLists.py
Expand Up @@ -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...")

Expand All @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions s3cmd
Expand Up @@ -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)

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit ba412e2

Please sign in to comment.