[duplicity/el4] Use python-kitchen for subprocess on RHEL 4 (#745535)

Toshio くらとみ toshio at fedoraproject.org
Thu Nov 10 17:46:41 UTC 2011


commit c70be2f964c9775c8e0129dcabae62b20e41a9b5
Author: Toshio Kuratomi <toshio at fedoraproject.org>
Date:   Thu Nov 10 09:46:28 2011 -0800

    Use python-kitchen for subprocess on RHEL 4 (#745535)

 duplicity-0.6.14-subprocess_el4.patch |   48 +++++++++++++++++++++++++++++++++
 duplicity.spec                        |   10 +++++-
 2 files changed, 56 insertions(+), 2 deletions(-)
---
diff --git a/duplicity-0.6.14-subprocess_el4.patch b/duplicity-0.6.14-subprocess_el4.patch
new file mode 100644
index 0000000..b0face8
--- /dev/null
+++ b/duplicity-0.6.14-subprocess_el4.patch
@@ -0,0 +1,48 @@
+Index: b/src/backends/giobackend.py
+===================================================================
+--- a/src/backends/giobackend.py
++++ b/src/backends/giobackend.py
+@@ -20,7 +20,10 @@
+ 
+ import os
+ import types
+-import subprocess
++try:
++    import subprocess
++except ImportError:
++    from kitchen.pycompat27 import subprocess
+ import atexit
+ import signal
+ import gio #@UnresolvedImport
+Index: b/src/backends/u1backend.py
+===================================================================
+--- a/src/backends/u1backend.py
++++ b/src/backends/u1backend.py
+@@ -26,7 +26,10 @@ def ensure_dbus():
+     # environment points to it.
+     import atexit
+     import os
+-    import subprocess
++    try:
++        import subprocess
++    except ImportError:
++        from kitchen.pycompat27 import subprocess
+     import signal
+     if 'DBUS_SESSION_BUS_ADDRESS' not in os.environ:
+         output = subprocess.Popen(['dbus-launch'], stdout=subprocess.PIPE).communicate()[0]
+Index: b/src/backend.py
+===================================================================
+--- a/src/backend.py
++++ b/src/backend.py
+@@ -421,7 +421,10 @@ class Backend:
+         Execute the given command line, interpreted as a shell command.
+         Returns int Exitcode, string StdOut, string StdErr
+         """
+-        from subprocess import Popen, PIPE
++        try:
++            from subprocess import Popen, PIPE
++        except ImportError:
++            from kitchen.pycompat27.subprocess import Popen, PIPE
+         p = Popen(commandline, shell=True, stdout=PIPE, stderr=PIPE)
+         stdout, stderr = p.communicate()
+ 
diff --git a/duplicity.spec b/duplicity.spec
index e2ca853..577798f 100644
--- a/duplicity.spec
+++ b/duplicity.spec
@@ -1,19 +1,21 @@
-%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
+%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
 
 Summary:        Encrypted bandwidth-efficient backup using rsync algorithm
 Name:           duplicity
 Version:        0.6.14
-Release:        1%{?dist}
+Release:        2%{?dist}
 License:        GPLv2+
 Group:          Applications/Archiving
 URL:            http://www.nongnu.org/duplicity/
 Source:         http://savannah.nongnu.org/download/%{name}/%{name}-%{version}.tar.gz
 Patch0:         duplicity-0.6.14-python23.patch
 Patch1:         duplicity-0.6.14-optparse_el4.patch
+Patch2:         duplicity-0.6.14-subprocess_el4.patch
 Requires:       python-GnuPGInterface >= 0.3.2, gnupg >= 1.0.6
 Requires:       openssh-clients, ncftp >= 3.1.9, rsync, python-boto >= 0.9d
 %if 0%{?rhel}%{?fedora} <= 4
 Requires:       python-abi = %(%{__python} -c "import sys; print sys.version[:3]")
+Requires:       python-kitchen >= 1.0.0
 %endif
 BuildRequires:  python-devel >= 2.3, librsync-devel >= 0.9.6
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -36,6 +38,7 @@ but not hard links.
 %patch0 -p1 -b .python23
 %if 0%{?rhel}%{?fedora} <= 4
 %patch1 -p1 -b .optparse_el4
+%patch2 -p1 -b .subprocess_el4
 %endif
 
 %build
@@ -60,6 +63,9 @@ rm -rf $RPM_BUILD_ROOT
 %{python_sitearch}/%{name}*
 
 %changelog
+* Tue Oct 25 2011 Jérôme Benoit <jerome.benoit at steria.com> 0.6.14-2
+- Use python-kitchen for subprocess on RHEL 4 (#745535)
+
 * Sun Jul 17 2011 Robert Scheck <robert at fedoraproject.org> 0.6.14-1
 - Upgrade to 0.6.14 (#720589, #697222)
 - Backported optparse 1.5a2 from RHEL 5 for RHEL 4 (#717133)


More information about the scm-commits mailing list