duplicity-talk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Duplicity-talk] Patch for using a different port with FTP-backend


From: Stefan Hoth
Subject: [Duplicity-talk] Patch for using a different port with FTP-backend
Date: Thu, 27 Sep 2007 16:01:37 +0200
User-agent: Thunderbird 2.0.0.6 (Windows/20070728)

Hi list, dear developers,

I created a patch for using duplicity with ftp backend with another port.

The url should be the "normal" style like address@hidden:port/dir as it is
already supported.

The patch changes the ftp backend to look for a given port different
from 21 (standard) and applys the parameter -P of ncftp to use the given
port.

Please test this patch (works for me). I would be glad if the patch
could make it in the final version of 0.4.4.

RFC.

Greetz,
Stefan Hoth
Berlin, Germany

See attached file.
--- 
/root/downloads/duplicity-0.4.4.RC2/build/lib.linux-x86_64-2.4/duplicity/backends.py
        2007-09-26 20:19:21.000000000 +0200
+++ /usr/lib/python2.4/site-packages/duplicity/backends.py      2007-09-27 
10:38:35.000000000 +0200
@@ -532,8 +532,12 @@
                        self.conn_opt = '-E'
                else:
                        self.conn_opt = '-F'
-               self.flags = "%s -t %s -u '%s' -p '%s'" % \
-                                        (self.conn_opt, globals.timeout, 
parsed_url.user, self.password)
+               if parsed_url.port != None and parsed_url.port != 21:
+                       self.flags = "%s -t %s -u '%s' -p '%s' -P '%s'" % \
+                                        (self.conn_opt, globals.timeout, 
parsed_url.user, self.password, parsed_url.port)
+               else:
+                       self.flags = "%s -t %s -u '%s' -p '%s'" % \
+                                        (self.conn_opt, globals.timeout, 
parsed_url.user, self.password)                        
 
        def put(self, source_path, remote_filename = None):
                """Transfer source_path to remote_filename"""

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]