Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions s4cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,9 @@ def put_single_file(self, pool, source, target):
target_url = S3URL(target)
# deal with ./ or ../ here by normalizing the path.
joined_path = os.path.normpath(os.path.join(target_url.path, os.path.relpath(f, source)))
# deal with Windows and other non-/ path separators
if os.sep != PATH_SEP:
joined_path = joined_path.replace(os.sep, PATH_SEP)
pool.upload(None, f, S3URL.combine('s3', target_url.bucket, joined_path))
else:
message('omitting directory "%s".' % source)
Expand Down
13 changes: 7 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,16 @@
__maintainer__ = __author__
__status__ = "Development"

def _post_install():
os.chmod("/etc/bash_completion.d/s4cmd",755)

class install(_install):
def run(self):
def run(self):
_install.run(self)
mode = stat.S_IREAD | stat.S_IWRITE | stat.S_IRGRP | stat.S_IROTH
os.chmod("/etc/bash_completion.d/s4cmd", mode)

if bash_complete:
os.chmod("/etc/bash_completion.d/s4cmd", mode)

bash_complete = os.name == 'posix'
data_files = [('/etc/bash_completion.d/',['data/bash-completion/s4cmd'])] if bash_complete else None

setup(name='s4cmd',
version=__version__,
Expand All @@ -50,6 +51,6 @@ def run(self):
py_modules=['s4cmd'],
scripts=['s4cmd', 's4cmd.py'], # Added s4cmd.py as script for backward compatibility
install_requires=['boto>=2.3.0'],
data_files=[('/etc/bash_completion.d/',['data/bash-completion/s4cmd'])],
data_files=data_files,
cmdclass={'install': install},
)