Package: duplicity
Version: 0.4.2-10.1

Hello!

There was a patch to do ftp reconnects in version 0.4.1-8:

> duplicity (0.4.1-8) unstable; urgency=high
> 
>   * added patch to fix ftp timeout exception when backing up huge files with
>     small changes (patch by Stefan Schimanski <[EMAIL PROTECTED]>)
> 
>  -- Martin Wuertele <[EMAIL PROTECTED]>  Mon,  6 Sep 2004 18:57:42 +0200

It existed as file 'duplicity-temp_error_recovery.patch'.


Maybe it got lost with the following change?

> duplicity (0.4.2-6) unstable; urgency=low
> 
>   * switch to dpatch for patch management
>   * fix private module search path and make sure postint/postrm work
>     (Closes: #384489)
>   * updated copyright
> 
>  -- Martin Wuertele <[EMAIL PROTECTED]>  Sat, 26 Aug 2006 23:25:57 +0200

Just guessing, I did no further research. 


I've built and are currently testing a package with this patch readded. 

See attached patch file.


I'd love to see this patch (re-)added to the Debian package. At least for 
unstable of course. But perhaps there is a small possibility to get this
into etch, too? If the patch really got lost with the change mentioned
above it would have been in etch up to end of August 2006 - so it is not 
really new code for etch, just code back from vacation.  ;)


 Regards
   Florian


-- 
  Florian Hinzmann                         private: [EMAIL PROTECTED]
                                            Debian: [EMAIL PROTECTED]
PGP Key / ID: 1024D/B4071A65
Fingerprint : F9AB 00C1 3E3A 8125 DD3F  DF1C DF79 A374 B407 1A65
diff -ruN duplicity-0.4.2/debian/changelog duplicity-0.4.2_with-ftp-patch/debian/changelog
--- duplicity-0.4.2/debian/changelog	2007-03-04 11:37:55.000000000 +0100
+++ duplicity-0.4.2_with-ftp-patch/debian/changelog	2007-03-04 11:22:38.000000000 +0100
@@ -1,3 +1,10 @@
+duplicity (0.4.2-10.1.0.1) LOCAL-MY; urgency=low
+
+  * (Re-)Added ftp retry patch from 0.4.1.
+  * Local build.
+
+ -- Florian Hinzmann <[EMAIL PROTECTED]>  Sun,  4 Mar 2007 11:21:51 +0100
+
 duplicity (0.4.2-10.1) unstable; urgency=medium
 
   * Switch back to python 2.4, as python-central can apparently no longer cope
diff -ruN duplicity-0.4.2/debian/patches/00list duplicity-0.4.2_with-ftp-patch/debian/patches/00list
--- duplicity-0.4.2/debian/patches/00list	2007-03-04 11:37:55.000000000 +0100
+++ duplicity-0.4.2_with-ftp-patch/debian/patches/00list	2007-03-04 11:21:17.000000000 +0100
@@ -1,2 +1,3 @@
 02bzip2-compress
 03sftp-command
+06ftp-retry.dpatch
diff -ruN duplicity-0.4.2/debian/patches/06ftp-retry.dpatch duplicity-0.4.2_with-ftp-patch/debian/patches/06ftp-retry.dpatch
--- duplicity-0.4.2/debian/patches/06ftp-retry.dpatch	1970-01-01 01:00:00.000000000 +0100
+++ duplicity-0.4.2_with-ftp-patch/debian/patches/06ftp-retry.dpatch	2007-03-04 11:39:48.000000000 +0100
@@ -0,0 +1,42 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 06ftp-retry.dpatch by  <[EMAIL PROTECTED]>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: No description.
+
[EMAIL PROTECTED]@
+diff -urNad duplicity-0.4.2_with-ftp-patch~/src/backends.py duplicity-0.4.2_with-ftp-patch/src/backends.py
+--- duplicity-0.4.2_with-ftp-patch~/src/backends.py	2007-03-04 11:07:59.000000000 +0100
++++ duplicity-0.4.2_with-ftp-patch/src/backends.py	2007-03-04 11:39:40.062198571 +0100
+@@ -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
+@@ -318,8 +319,10 @@
+ 
+ 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.parsed_url = parsed_url
+ 		self.ftp = ftplib.FTP()
+ 		if parsed_url.port is None: self.error_wrap('connect', parsed_url.host)
+ 		else: self.error_wrap('connect', parsed_url.host, parsed_url.port)
+@@ -332,6 +335,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):

Reply via email to