rpms/duplicity/devel duplicity-0.4.1-timeout.patch, NONE, 1.1 duplicity-0.4.2-scp.patch, NONE, 1.1 duplicity.spec, 1.10, 1.11
Robert Scheck (robert)
fedora-extras-commits at redhat.com
Sun Dec 17 14:03:31 UTC 2006
Author: robert
Update of /cvs/extras/rpms/duplicity/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv14468
Modified Files:
duplicity.spec
Added Files:
duplicity-0.4.1-timeout.patch duplicity-0.4.2-scp.patch
Log Message:
- own %{python_sitearch}/%{name} and not only %{python_sitearch}
- added two small fixing patches (upstream items #4486, #5183)
- many spec file cleanups and try to silence rpmlint a bit more
duplicity-0.4.1-timeout.patch:
--- NEW FILE duplicity-0.4.1-timeout.patch ---
Fixes ftp timeout exception when backing up huge files with small changes - thanks
to Stefan Schimanski <schimmi at debian.org>.
--- duplicity-0.4.1/src/backends.py 2003-08-10 04:17:21.000000000 +0200
+++ duplicity-0.4.1/src/backends.py.timeout 2005-10-17 10:47:10.000000000 +0200
@@ -20,6 +20,7 @@
import os, types, ftplib, tempfile
import log, path, dup_temp, file_naming
+import time
class BackendException(Exception): pass
class ParsingException(Exception): pass
@@ -316,6 +317,7 @@
class ftpBackend(Backend):
"""Connect to remote store using File Transfer Protocol"""
+ SLEEP = 10 # time in seconds before we try to reconnect on temporary errors
def __init__(self, parsed_url):
"""Create a new ftp backend object, log in to host"""
self.ftp = ftplib.FTP()
@@ -330,6 +332,12 @@
def error_wrap(self, command, *args):
"""Run self.ftp.command(*args), but raise BackendException on error"""
try: return ftplib.FTP.__dict__[command](self.ftp, *args)
+ except ftplib.error_temp, e:
+ log.Log("Temporary error '%s'. Trying to reconnect in %d seconds." %
+ (str(e), self.SLEEP), 3)
+ time.sleep(self.SLEEP)
+ self.__init__(self.parsed_url)
+ self.error_wrap(command, *args)
except ftplib.all_errors, e: raise BackendException(e)
def get_password(self):
duplicity-0.4.2-scp.patch:
--- NEW FILE duplicity-0.4.2-scp.patch ---
Adds support for port numbers in a SCP url like: scp://user@host:port - thanks to
Christian Schneider <mail at christian-schneider.net>.
--- duplicity-0.4.2/src/backends.py 2006-05-12 19:31:59.000000000 +0200
+++ duplicity-0.4.2/src/backends.py.scp 2006-05-12 19:42:37.000000000 +0200
@@ -264,23 +264,25 @@
"""This backend copies files using scp. List not supported"""
def __init__(self, parsed_url):
"""scpBackend initializer"""
- self.host_string = parsed_url.server # of form user at hostname:port
+ self.host_string = parsed_url.host # of form user at hostname:port
self.remote_dir = parsed_url.path # can be empty string
+ if parsed_url.port: self.port_string = parsed_url.port
+ else: self.port_string = 22
if self.remote_dir: self.remote_prefix = self.remote_dir + "/"
else: self.remote_prefix = ""
def put(self, source_path, remote_filename = None):
"""Use scp to copy source_dir/filename to remote computer"""
if not remote_filename: remote_filename = source_path.get_filename()
- commandline = "%s %s %s:%s%s" % \
- (scp_command, source_path.name, self.host_string,
+ commandline = "%s -P %s %s %s:%s%s" % \
+ (scp_command, self.port_string, source_path.name, self.host_string,
self.remote_prefix, remote_filename)
self.run_command(commandline)
def get(self, remote_filename, local_path):
"""Use scp to get a remote file"""
- commandline = "%s %s:%s%s %s" % \
- (scp_command, self.host_string, self.remote_prefix,
+ commandline = "%s -P %s %s:%s%s %s" % \
+ (scp_command, self.port_string, self.host_string, self.remote_prefix,
remote_filename, local_path.name)
self.run_command(commandline)
local_path.setdata()
@@ -295,8 +297,8 @@
be distinguished from the file boundaries.
"""
- commandline = ("echo -e 'cd %s\nls -1' | %s -b - %s" %
- (self.remote_dir, sftp_command, self.host_string))
+ commandline = ("echo -e 'cd %s\nls -1' | %s -p %s -b - %s" %
+ (self.remote_dir, sftp_command, self.port_string, self.host_string))
l = self.popen(commandline).split('\n')[2:] # omit sftp prompts
return filter(lambda x: x, l)
@@ -305,8 +307,8 @@
assert len(filename_list) > 0
pathlist = map(lambda fn: self.remote_prefix + fn, filename_list)
del_prefix = "echo 'rm "
- del_postfix = ("' | %s -b - %s 1>/dev/null" %
- (sftp_command, self.host_string))
+ del_postfix = ("' | %s -p %s -b - %s 1>/dev/null" %
+ (sftp_command, self.port_string, self.host_string))
for fn in filename_list:
commandline = del_prefix + self.remote_prefix + fn + del_postfix
self.run_command(commandline)
Index: duplicity.spec
===================================================================
RCS file: /cvs/extras/rpms/duplicity/devel/duplicity.spec,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- duplicity.spec 8 Sep 2006 04:39:06 -0000 1.10
+++ duplicity.spec 17 Dec 2006 14:03:01 -0000 1.11
@@ -1,40 +1,45 @@
-%define PYTHON_VERSION %(python -c 'import sys; print sys.version[:3],')
-%define NEXT_PYTHON_VERSION %(python -c 'import sys; print "%d.%d" % (sys.version_info[0], sys.version_info[1]+1),')
+%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
-Version: 0.4.2
-Summary: Untrusted/encrypted backup using rsync algorithm
-Name: duplicity
-Release: 3%{?dist}
-URL: http://www.nongnu.org/duplicity/
-Source: http://savannah.nongnu.org/download/duplicity/%{name}-%{version}.tar.gz
-License: GPL
-Group: Applications/Archiving
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-
-Requires: python >= %{PYTHON_VERSION}, python < %{NEXT_PYTHON_VERSION}, gnupg >= 1.0.6
-BuildRequires: python-devel >= 2.2, librsync-devel >= 0.9.6
+Summary: Encrypted bandwidth-efficient backup using rsync algorithm
+Name: duplicity
+Version: 0.4.2
+Release: 5%{?dist}
+License: GPL
+Group: Applications/Archiving
+URL: http://www.nongnu.org/duplicity/
+Source: http://savannah.nongnu.org/download/%{name}/%{name}-%{version}.tar.gz
+Patch0: duplicity-0.4.1-timeout.patch
+Patch1: duplicity-0.4.2-scp.patch
+Requires: gnupg >= 1.0.6
+%if "%{?fedora}" <= "3"
+Requires: python-abi = %(%{__python} -c "import sys ; print sys.version[:3]")
+%endif
+BuildRequires: python-devel >= 2.2, librsync-devel >= 0.9.6
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
%description
Duplicity incrementally backs up files and directory by encrypting
tar-format volumes with GnuPG and uploading them to a remote (or
-local) file server. In theory many remote backends are possible;
+local) file server. In theory many remote backends are possible;
right now local, ssh/scp, ftp, and rsync backends are written.
+
Because duplicity uses librsync, the incremental archives are space
efficient and only record the parts of files that have changed since
-the last backup. Currently duplicity supports deleted files, full
+the last backup. Currently duplicity supports deleted files, full
unix permissions, directories, symbolic links, fifos, etc., but not
hard links.
%prep
%setup -q
+%patch0 -p1 -b .timeout
+%patch1 -p1 -b .scp
%build
-python setup.py build
+%{__python} setup.py build
%install
-python setup.py install --root $RPM_BUILD_ROOT
-# Produce .pyo files for %ghost directive later
-python -Oc 'from compileall import *; compile_dir("'$RPM_BUILD_ROOT/%{_libdir}/python%{PYTHON_VERSION}/site-packages/duplicity'")'
+rm -rf $RPM_BUILD_ROOT
+%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
%clean
rm -rf $RPM_BUILD_ROOT
@@ -43,14 +48,21 @@
%defattr(-,root,root)
%doc CHANGELOG COPYING README
%{_bindir}/rdiffdir
-%{_bindir}/duplicity
-%{_mandir}/man1/duplicity*
+%{_bindir}/%{name}
+%{_mandir}/man1/%{name}*
%{_mandir}/man1/rdiffdir*
-%dir %{_libdir}/python%{PYTHON_VERSION}/site-packages/duplicity
-%{_libdir}/python%{PYTHON_VERSION}/site-packages/duplicity/*.py*
-%{_libdir}/python%{PYTHON_VERSION}/site-packages/duplicity/*.so
+%dir %{python_sitearch}/%{name}
+%{python_sitearch}/%{name}/*.py*
+%{python_sitearch}/%{name}/*.so
%changelog
+* Sun Dec 17 2006 Robert Scheck <robert at fedoraproject.org> 0.4.2-5
+- own %%{python_sitearch}/%%{name} and not only %%{python_sitearch}
+
+* Sat Dec 16 2006 Robert Scheck <robert at fedoraproject.org> 0.4.2-4
+- added two small fixing patches (upstream items #4486, #5183)
+- many spec file cleanups and try to silence rpmlint a bit more
+
* Fri Sep 08 2006 Michael J. Knox <michael[AT]knox.net.nz> - 0.4.2-3
- don't ghost pyo files
@@ -58,7 +70,7 @@
- Rebuild for FC6
* Tue May 16 2006 Michael J. Knox <michael[AT]knox.net.nz> - 0.4.2-1
-- verion bump
+- version bump
* Fri Apr 7 2005 Michael Schwendt <mschwendt[AT]users.sf.net>
- rebuilt
More information about the fedora-extras-commits
mailing list