diff options
author | Michał Górny <mgorny@gentoo.org> | 2010-11-19 19:58:26 +0100 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2010-11-19 11:27:12 -0800 |
commit | d3c2976a0dae1ec2b0f6bec9058a6225c5728461 (patch) | |
tree | 9595f86177162428513ca69af908bd86171240be | |
parent | d1da346694b1e86b6373fd99b890ab92f2752c41 (diff) | |
download | portage-d3c2976a0dae1ec2b0f6bec9058a6225c5728461.tar.gz portage-d3c2976a0dae1ec2b0f6bec9058a6225c5728461.tar.bz2 portage-d3c2976a0dae1ec2b0f6bec9058a6225c5728461.zip |
Support syncing over ssh with ssh://host//path.
-rw-r--r-- | pym/_emerge/actions.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py index 0247fd3f0..90d5dcd02 100644 --- a/pym/_emerge/actions.py +++ b/pym/_emerge/actions.py @@ -1999,7 +1999,7 @@ def action_sync(settings, trees, mtimedb, myopts, myaction): exitcode = git_sync_timestamps(settings, myportdir) if exitcode == os.EX_OK: updatecache_flg = True - elif syncuri[:8]=="rsync://": + elif syncuri[:8]=="rsync://" or syncuri[:6]=="ssh://": for vcs_dir in vcs_dirs: writemsg_level(("!!! %s appears to be under revision " + \ "control (contains %s).\n!!! Aborting rsync sync.\n") % \ @@ -2107,8 +2107,8 @@ def action_sync(settings, trees, mtimedb, myopts, myaction): maxretries = -1 #default number of retries retries=0 - user_name, hostname, port = re.split( - "rsync://([^:/]+@)?([^:/]*)(:[0-9]+)?", syncuri, maxsplit=3)[1:4] + proto, user_name, hostname, port = re.split( + "(rsync|ssh)://([^:/]+@)?([^:/]*)(:[0-9]+)?", syncuri, maxsplit=4)[1:5] if port is None: port="" if user_name is None: @@ -2213,6 +2213,9 @@ def action_sync(settings, trees, mtimedb, myopts, myaction): "\n\n>>> Starting retry %d of %d with %s\n" % \ (retries, effective_maxretries, dosyncuri), noiselevel=-1) + if dosyncuri.startswith('ssh://'): + dosyncuri = dosyncuri[6:].replace('/', ':', 1) + if mytimestamp != 0 and "--quiet" not in myopts: print(">>> Checking server timestamp ...") |