summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-08-06 08:05:44 +0000
committerZac Medico <zmedico@gentoo.org>2006-08-06 08:05:44 +0000
commitdae78267596c55251562c1eb7c267eb3990df977 (patch)
tree6e461beab27e09157667613a3b79ea12eba6f150
parent153b04160992b2efb801e11885712aaa99b8951b (diff)
downloadportage-dae78267596c55251562c1eb7c267eb3990df977.tar.gz
portage-dae78267596c55251562c1eb7c267eb3990df977.tar.bz2
portage-dae78267596c55251562c1eb7c267eb3990df977.zip
Fix rsync code to work with a username@ uri for bug #141185. Thanks to David-John Miller <anoyomouse@petermiller.co.za> for this patch.
svn path=/main/trunk/; revision=4179
-rwxr-xr-xbin/emerge9
1 files changed, 7 insertions, 2 deletions
diff --git a/bin/emerge b/bin/emerge
index 4d1a3c38e..bc830fac8 100755
--- a/bin/emerge
+++ b/bin/emerge
@@ -2654,9 +2654,12 @@ def action_sync(settings, trees, mtimedb, myopts, myaction):
maxretries=3 #default number of retries
retries=0
- hostname, port=re.split("rsync://([^:/]*)(:[0-9]+)?", syncuri)[1:3];
+ user_name, hostname, port = re.split(
+ "rsync://([^:/]+@)?([^:/]*)(:[0-9]+)?", syncuri, maxsplit=3)[1:4]
if port is None:
port=""
+ if user_name is None:
+ user_name=""
updatecache_flg=True
all_rsync_opts = set(rsync_opts)
all_rsync_opts.update(
@@ -2688,7 +2691,9 @@ def action_sync(settings, trees, mtimedb, myopts, myaction):
if ips:
try:
- dosyncuri=string.replace(syncuri, "//"+hostname+port+"/", "//"+ips[0]+port+"/", 1)
+ dosyncuri = syncuri.replace(
+ "//" + user_name + hostname + port + "/",
+ "//" + user_name + ips[0] + port + "/", 1)
except SystemExit, e:
raise # Needed else can't exit
except Exception, e: