Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: bloomreach/s4cmd
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 4a1323f7d651d6ce58dd696fdb62d133e6e172d9
Choose a base ref
..
head repository: bloomreach/s4cmd
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 514e948c99082120d94996b0db9722b62e6dcdc5
Choose a head ref
Showing with 5 additions and 5 deletions.
  1. +5 −5 s4cmd.py
10 changes: 5 additions & 5 deletions s4cmd.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python3.10
#!/usr/bin/env python

#
# Copyright 2012-2018 BloomReach, Inc.
@@ -60,8 +60,8 @@ def cmp(a, b):
TEMP_FILES = set()

# Environment variable names for S3 credentials.
S3_ACCESS_KEY_NAME = "S3_ACCESS_KEY"
S3_SECRET_KEY_NAME = "S3_SECRET_KEY"
S3_ACCESS_KEY_NAME = "AWS_ACCESS_KEY_ID"
S3_SECRET_KEY_NAME = "AWS_SECRET_ACCESS_KEY"
S4CMD_ENV_KEY = "S4CMD_OPTS"


@@ -659,7 +659,7 @@ def s3_keys_from_s3cfg(opt):
config = ConfigParser.ConfigParser()
config.read(s3cfg_path)
keys = config.get("default", "access_key"), config.get("default", "secret_key")
debug("read S3 keys from $HOME/.s3cfg file")
debug("read S3 keys from %s file", s3cfg_path)
return keys
except Exception as e:
info("could not read S3 keys from %s file; skipping (%s)", s3cfg_path, e)
@@ -1162,7 +1162,7 @@ def partial_match(self, path, filter_path):
fi = filter_path.split(PATH_SEP)

# Here, if we are in recursive mode, we allow the pi to be longer than fi.
# Otherwise, length of pi should be equal or less than the lenght of fi.
# Otherwise, length of pi should be equal or less than the length of fi.
min_len = min(len(pi), len(fi))
matched = fnmatch.fnmatch(PATH_SEP.join(pi[0:min_len]), PATH_SEP.join(fi[0:min_len]))
return matched and (self.opt.recursive or len(pi) <= len(fi))