Bug#895560: s3cmd has a runtime dependency on python3-distutils

2018-04-29 Thread Matthias Klose
Control: reopen -1
Control: retitle -1 s3cmd: avoid the runtime dependency on distutils

Please don't depend on distutils, when the dependency can be avoided at runtime.
See the attached patch.

diff -Nru s3cmd-2.0.1/debian/changelog s3cmd-2.0.1/debian/changelog
--- s3cmd-2.0.1/debian/changelog	2018-04-12 17:09:38.0 +
+++ s3cmd-2.0.1/debian/changelog	2018-04-30 05:31:16.0 +
@@ -1,3 +1,10 @@
+s3cmd (2.0.1-2.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Avoid the use of distutils at runtime.
+
+ -- Matthias Klose   Mon, 30 Apr 2018 07:31:16 +0200
+
 s3cmd (2.0.1-2) unstable; urgency=medium
 
   [ Nishanth Aravamudan  ]
diff -Nru s3cmd-2.0.1/debian/control s3cmd-2.0.1/debian/control
--- s3cmd-2.0.1/debian/control	2018-04-12 17:09:38.0 +
+++ s3cmd-2.0.1/debian/control	2018-04-30 05:31:10.0 +
@@ -16,7 +16,7 @@
 
 Package: s3cmd
 Architecture: all
-Depends: ${misc:Depends}, ${python3:Depends}, python3-distutils
+Depends: ${misc:Depends}, ${python3:Depends}
 Description: command-line Amazon S3 client
  Command-line tool to upload, retrieve and manage data in Amazon S3 service
  (http://www.amazon.com/s3/), designed for use in scripts. Features:
diff -Nru s3cmd-2.0.1/debian/patches/avoid-distutils.diff s3cmd-2.0.1/debian/patches/avoid-distutils.diff
--- s3cmd-2.0.1/debian/patches/avoid-distutils.diff	1970-01-01 00:00:00.0 +
+++ s3cmd-2.0.1/debian/patches/avoid-distutils.diff	2018-04-30 05:31:16.0 +
@@ -0,0 +1,20 @@
+--- a/s3cmd
 b/s3cmd
+@@ -57,7 +57,7 @@ import tempfile
+ from copy import copy
+ from optparse import OptionParser, Option, OptionValueError, IndentedHelpFormatter
+ from logging import debug, info, warning, error
+-from distutils.spawn import find_executable
++from shutil import which
+ 
+ from ssl import SSLError
+ import io
+@@ -2267,7 +2267,7 @@ def run_configure(config_file, args):
+ ]
+ ## Option-specfic defaults
+ if getattr(cfg, "gpg_command") == "":
+-setattr(cfg, "gpg_command", find_executable("gpg"))
++setattr(cfg, "gpg_command", which("gpg"))
+ 
+ if getattr(cfg, "proxy_host") == "" and os.getenv("http_proxy"):
+ autodetected_encoding = locale.getpreferredencoding() or "UTF-8"
diff -Nru s3cmd-2.0.1/debian/patches/series s3cmd-2.0.1/debian/patches/series
--- s3cmd-2.0.1/debian/patches/series	1970-01-01 00:00:00.0 +
+++ s3cmd-2.0.1/debian/patches/series	2018-04-30 05:29:55.0 +
@@ -0,0 +1 @@
+avoid-distutils.diff


Bug#895560: s3cmd has a runtime dependency on python3-distutils

2018-04-12 Thread Nishanth Aravamudan
Package: s3cmd
Version: 2.0.1-1
Severity: important
Tags: patch
User: ubuntu-de...@lists.ubuntu.com
Usertags: origin-ubuntu bionic ubuntu-patch

Dear Maintainer,

As reported in Ubuntu, s3cmd on Debian also does not run by default (it
spits an error about distutils.spawn). This is because (I think) python2
had distutils as part of the core, while python3 does not.

In Ubuntu, the attached patch was applied to achieve the following:

  * d/control: add run-time dependency on python3-distutils.
- Upstream has required it in s3cmd since 2007. 
- LP: #1763398


Thanks for considering the patch.

*** /tmp/tmpLFbq1d/s3cmd_2.0.1-1ubuntu1.debdiff
diff -Nru s3cmd-2.0.1/debian/control s3cmd-2.0.1/debian/control
--- s3cmd-2.0.1/debian/control  2017-10-25 23:48:32.0 -0700
+++ s3cmd-2.0.1/debian/control  2018-04-12 09:03:35.0 -0700
@@ -16,7 +16,7 @@
 
 Package: s3cmd
 Architecture: all
-Depends: ${misc:Depends}, ${python3:Depends}
+Depends: ${misc:Depends}, ${python3:Depends}, python3-distutils
 Description: command-line Amazon S3 client
  Command-line tool to upload, retrieve and manage data in Amazon S3 service
  (http://www.amazon.com/s3/), designed for use in scripts. Features:


-- System Information:
Debian Release: buster/sid
  APT prefers bionic
  APT policy: (500, 'bionic')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.15.0-13-generic (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_US:en (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

-- 
Nishanth Aravamudan
Ubuntu Server
Canonical Ltd