[packages/s3cmd] Up to 2.4.0

arekm arekm at pld-linux.org
Thu Oct 29 09:06:38 CET 2026


commit d8426e2440764c9983d5fb237b5684de9e8e2c49
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Thu Oct 29 02:37:32 2026 +0100

    Up to 2.4.0
    
    Switch to Python 3.

 file-magic.patch             | 20 +++++++++---------
 s3cmd-py3-configparser.patch | 50 ++++++++++++++++++++++++++++++++++++++++++++
 s3cmd-py3-dict-keys.patch    | 31 +++++++++++++++++++++++++++
 s3cmd-regex-escapes.patch    | 49 +++++++++++++++++++++++++++++++++++++++++++
 s3cmd.spec                   | 32 ++++++++++++++++------------
 5 files changed, 159 insertions(+), 23 deletions(-)
---
diff --git a/s3cmd.spec b/s3cmd.spec
index 2f3dd84..8947d75 100644
--- a/s3cmd.spec
+++ b/s3cmd.spec
@@ -1,19 +1,22 @@
 Summary:	S3cmd tool for Amazon Simple Storage Service (S3)
 Summary(pl.UTF-8):	Narzędzie s3cmd do obsługi Amazon Simple Storage Service (S3)
 Name:		s3cmd
-Version:	1.6.1
-Release:	2
+Version:	2.4.0
+Release:	1
 License:	GPL v2
 Group:		Applications
-Source0:	http://downloads.sourceforge.net/s3tools/%{name}-%{version}.tar.gz
-# Source0-md5:	d7477e7000a98552932d23e279d69a11
+Source0:	https://downloads.sourceforge.net/s3tools/%{name}-%{version}.tar.gz
+# Source0-md5:	f206e8670b3f0cf9b40c5af72eb96eb6
 Patch0:		file-magic.patch
-URL:		http://s3tools.org/s3cmd
-BuildRequires:	python
-BuildRequires:	python-setuptools
+Patch1:		%{name}-regex-escapes.patch
+Patch2:		%{name}-py3-configparser.patch
+Patch3:		%{name}-py3-dict-keys.patch
+URL:		https://s3tools.org/s3cmd
+BuildRequires:	python3-modules
+BuildRequires:	python3-setuptools
 BuildRequires:	rpm-pythonprov
-BuildRequires:	rpmbuild(macros) >= 1.219
-Requires:	python-modules
+BuildRequires:	rpmbuild(macros) >= 1.714
+Requires:	python3-modules
 BuildArch:	noarch
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
@@ -34,14 +37,17 @@ treści Amazon CloudFront.
 %setup -q
 
 %patch -P0 -p1
+%patch -P1 -p1
+%patch -P2 -p1
+%patch -P3 -p1
 
 %build
-%py_build
+%py3_build
 
 %install
 rm -rf $RPM_BUILD_ROOT
 
-%py_install
+%py3_install
 
 rm -r $RPM_BUILD_ROOT%{_docdir}/packages
 
@@ -52,6 +58,6 @@ rm -rf $RPM_BUILD_ROOT
 %defattr(644,root,root,755)
 %doc README.md NEWS
 %attr(755,root,root) %{_bindir}/s3cmd
-%{py_sitescriptdir}/S3
-%{py_sitescriptdir}/s3cmd-%{version}-py*.egg-info
+%{py3_sitescriptdir}/S3
+%{py3_sitescriptdir}/s3cmd-%{version}-py*.egg-info
 %{_mandir}/man1/s3cmd.1*
diff --git a/file-magic.patch b/file-magic.patch
index 8b14bdf..dd81d7a 100644
--- a/file-magic.patch
+++ b/file-magic.patch
@@ -1,19 +1,19 @@
-diff -dur s3cmd-1.6.1.orig/s3cmd.egg-info/requires.txt s3cmd-1.6.1/s3cmd.egg-info/requires.txt
---- s3cmd-1.6.1.orig/s3cmd.egg-info/requires.txt	2016-01-20 19:13:39.000000000 +0100
-+++ s3cmd-1.6.1/s3cmd.egg-info/requires.txt	2016-09-18 20:28:31.186914202 +0200
+diff -ur s3cmd-2.4.0.orig/s3cmd.egg-info/requires.txt s3cmd-2.4.0/s3cmd.egg-info/requires.txt
+--- s3cmd-2.4.0.orig/s3cmd.egg-info/requires.txt	2023-12-12 03:47:59.000000000 +0100
++++ s3cmd-2.4.0/s3cmd.egg-info/requires.txt	2026-10-29 02:34:39.910896113 +0100
 @@ -1,2 +1,2 @@
  python-dateutil
 -python-magic
 +file-magic
-diff -dur s3cmd-1.6.1.orig/setup.py s3cmd-1.6.1/setup.py
---- s3cmd-1.6.1.orig/setup.py	2016-01-20 19:01:08.000000000 +0100
-+++ s3cmd-1.6.1/setup.py	2016-09-18 20:28:54.377099309 +0200
-@@ -102,7 +102,7 @@
+diff -ur s3cmd-2.4.0.orig/setup.py s3cmd-2.4.0/setup.py
+--- s3cmd-2.4.0.orig/setup.py	2023-12-06 10:07:23.000000000 +0100
++++ s3cmd-2.4.0/setup.py	2026-10-29 02:34:39.913251411 +0100
+@@ -121,7 +121,7 @@
          'Topic :: Utilities',
      ],
  
--    install_requires = ["python-dateutil", "python-magic"]
-+    install_requires = ["python-dateutil", "file-magic"]
-     )
+-    install_requires=["python-dateutil", "python-magic"]
++    install_requires=["python-dateutil", "file-magic"]
+ )
  
  # vim:et:ts=4:sts=4:ai
diff --git a/s3cmd-py3-configparser.patch b/s3cmd-py3-configparser.patch
new file mode 100644
index 0000000..242de58
--- /dev/null
+++ b/s3cmd-py3-configparser.patch
@@ -0,0 +1,50 @@
+From 1a793a9153286e9327ef90895715edfbb116b447 Mon Sep 17 00:00:00 2001
+From: dogisgreat <github at bigly.dog>
+Date: Sun, 19 Jan 2025 22:42:00 -0500
+Subject: [PATCH] Fixes #1361 and #1027 - fix python 3 compat for configparser
+ (#1365)
+
+Trimmed to the readfp() part; readfp() was removed in Python 3.12.
+https://github.com/s3tools/s3cmd/commit/1a793a9153286e9327ef90895715edfbb116b447
+---
+diff --git a/S3/Config.py b/S3/Config.py
+index 58ecafc3..b2af74a1 100644
+--- a/S3/Config.py
++++ b/S3/Config.py
+@@ -73,6 +73,8 @@
+     # In python 3, unicode -> str, and str -> bytes
+     unicode = str
+ 
++PY3 = (sys.version_info >= (3, 0))
++
+ 
+ def is_bool_true(value):
+     """Check to see if a string is true, yes, on, or 1
+@@ -455,9 +457,11 @@ def aws_credential_file(self):
+                 config_string = fp.read()
+             try:
+                 try:
+-                    # readfp is replaced by read_file in python3,
+-                    # but so far readfp it is still available.
+-                    config.readfp(io.StringIO(config_string))
++                    buf = io.StringIO(config_string)
++                    if PY3:
++                      config.read_file(buf)
++                    else:
++                      config.readfp(buf)
+                 except MissingSectionHeaderError:
+                     # if header is missing, this could be deprecated
+                     # credentials file format as described here:
+@@ -465,7 +469,11 @@ def aws_credential_file(self):
+                     # then do the hacky-hack and add default header
+                     # to be able to read the file with PyConfigParser()
+                     config_string = u'[default]\n' + config_string
+-                    config.readfp(io.StringIO(config_string))
++                    buf = io.StringIO(config_string)
++                    if PY3:
++                      config.read_file(buf)
++                    else:
++                      config.readfp(buf)
+             except ParsingError as exc:
+                 raise ValueError(
+                     "Error reading aws_credential_file "
diff --git a/s3cmd-py3-dict-keys.patch b/s3cmd-py3-dict-keys.patch
new file mode 100644
index 0000000..6ff1b9d
--- /dev/null
+++ b/s3cmd-py3-dict-keys.patch
@@ -0,0 +1,31 @@
+From dae680c53ea6973ce88e531ae5a4a9dedc97123a Mon Sep 17 00:00:00 2001
+From: Florent Viard <florent at sodria.com>
+Date: Mon, 27 Jan 2025 03:26:00 +0100
+Subject: [PATCH] Fixes #1363 - Fixes 'dict_keys' not subscriptable for
+ remote2local with one local copy
+
+_set_local_filename can be called with copy_paris as remote_list,
+and "copy_pairs" is a normal dict and not a FileDict.
+So, in that case, copy_pairs.keys() will be a view in py3 and so not
+subscriptable.
+---
+ s3cmd | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/s3cmd b/s3cmd
+index 036138c7..e3b526fa 100755
+--- a/s3cmd
++++ b/s3cmd
+@@ -1411,10 +1411,10 @@ def cmd_sync_remote2local(args):
+             if not os.path.isdir(deunicodise(destination_base)):
+                 raise ParameterError("Destination is not an existing directory")
+         elif len(remote_list) == 1 and \
+-             source_args[0] == remote_list[remote_list.keys()[0]].get(u'object_uri_str', ''):
++             source_args[0] == remote_list[next(iter(remote_list.keys()))].get(u'object_uri_str', ''):
+             if os.path.isdir(deunicodise(destination_base)):
+                 raise ParameterError("Destination already exists and is a directory")
+-            remote_list[remote_list.keys()[0]]['local_filename'] = destination_base
++            remote_list[next(iter(remote_list.keys()))]['local_filename'] = destination_base
+             return
+ 
+         if destination_base[-1] != os.path.sep:
diff --git a/s3cmd-regex-escapes.patch b/s3cmd-regex-escapes.patch
new file mode 100644
index 0000000..44f4240
--- /dev/null
+++ b/s3cmd-regex-escapes.patch
@@ -0,0 +1,49 @@
+From dd8908d782d27327527cf2acff800bddba4bc323 Mon Sep 17 00:00:00 2001
+From: Jessie Murray <jessie.murray at protonmail.com>
+Date: Sat, 6 Apr 2024 12:36:21 -0700
+Subject: [PATCH] cleanup: fixes regex escape warnings in S3Uri.py,
+ FileLists.py
+
+Mark two strings in S3Uri.py and one string in FileLists.py as
+literal regex strings to address "invalid escape sequence" syntax
+warnings.
+---
+ S3/FileLists.py | 2 +-
+ S3/S3Uri.py     | 4 ++--
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/S3/FileLists.py b/S3/FileLists.py
+index 40d49c58..de2b88f2 100644
+--- a/S3/FileLists.py
++++ b/S3/FileLists.py
+@@ -522,7 +522,7 @@ def _get_filelist_remote(remote_uri, recursive = True):
+             uri_str = uri.uri()
+             ## Wildcards used in remote URI?
+             ## If yes we'll need a bucket listing...
+-            wildcard_split_result = re.split("\*|\?", uri_str, maxsplit=1)
++            wildcard_split_result = re.split(r"\*|\?", uri_str, maxsplit=1)
+ 
+             if len(wildcard_split_result) == 2:
+                 ## If wildcards found
+diff --git a/S3/S3Uri.py b/S3/S3Uri.py
+index f03101f4..b2f0c9f2 100644
+--- a/S3/S3Uri.py
++++ b/S3/S3Uri.py
+@@ -119,7 +119,7 @@ def httpurl_to_s3uri(http_url):
+ 
+         # Worst case scenario, we would like to be able to match something like
+         # my.website.com.s3-fips.dualstack.us-west-1.amazonaws.com.cn
+-        m = re.match("(.*\.)?s3(?:\-[^\.]*)?(?:\.dualstack)?(?:\.[^\.]*)?\.amazonaws\.com(?:\.cn)?$",
++        m = re.match(r"(.*\.)?s3(?:\-[^\.]*)?(?:\.dualstack)?(?:\.[^\.]*)?\.amazonaws\.com(?:\.cn)?$",
+                      hostname, re.IGNORECASE | re.UNICODE)
+         if not m:
+             raise ValueError("Unable to parse URL: %s" % http_url)
+@@ -167,7 +167,7 @@ def uri(self):
+ 
+ class S3UriFile(S3Uri):
+     type = "file"
+-    _re = re.compile("^(\w+://)?(.*)", re.UNICODE)
++    _re = re.compile(r"^(\w+://)?(.*)", re.UNICODE)
+     def __init__(self, string):
+         match = self._re.match(string)
+         groups = match.groups()
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/s3cmd.git/commitdiff/d8426e2440764c9983d5fb237b5684de9e8e2c49



More information about the pld-cvs-commit mailing list