pld-builder.new: PLD_Builder/file_sender.py Support rsync over ssh.

arekm arekm at pld-linux.org
Wed Apr 23 20:52:13 CEST 2008


Author: arekm                        Date: Wed Apr 23 18:52:13 2008 GMT
Module: pld-builder.new               Tag: HEAD
---- Log message:
Support rsync over ssh.

---- Files affected:
pld-builder.new/PLD_Builder:
   file_sender.py (1.20 -> 1.21) 

---- Diffs:

================================================================
Index: pld-builder.new/PLD_Builder/file_sender.py
diff -u pld-builder.new/PLD_Builder/file_sender.py:1.20 pld-builder.new/PLD_Builder/file_sender.py:1.21
--- pld-builder.new/PLD_Builder/file_sender.py:1.20	Mon Dec 24 10:38:08 2007
+++ pld-builder.new/PLD_Builder/file_sender.py	Wed Apr 23 20:52:08 2008
@@ -74,6 +74,14 @@
     if password != None: os.unlink(".rsync.pass")
     return f.close()
 
+def rsync_ssh_file(src, target, host):
+    global problem
+    rsync = "rsync --verbose --archive -e ssh"
+    f = os.popen("%s %s %s 2>&1 < /dev/null" % (rsync, src, target))
+    problem = f.read()
+    res = f.close()
+    return f.close()
+
 def post_file(src, url):
     global problem
     try:
@@ -98,6 +106,9 @@
     m = re.match('scp://([^@:]+@[^/:]+)(:|)(.*)', target)
     if m:
         return scp_file(src, m.group(1) + ":" + m.group(3))
+    m = re.match('ssh\+rsync://([^@:]+@[^/:]+)(:|)(.*)', target)
+    if m:
+        return rsync_ssh_file(src, m.group(1) + ":" + m.group(3))
     m = re.match('http://.*', target)
     if m:
         return post_file(src, target)
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/pld-builder.new/PLD_Builder/file_sender.py?r1=1.20&r2=1.21&f=u



More information about the pld-cvs-commit mailing list