summaryrefslogtreecommitdiffstats
path: root/pym/getbinpkg.py
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-06-24 21:11:47 +0000
committerZac Medico <zmedico@gentoo.org>2007-06-24 21:11:47 +0000
commit04499f22f8a520f2a94044e47304d377f2a55398 (patch)
tree902230fa7a208a50f6abd7bc6a69fd7ed5211698 /pym/getbinpkg.py
parent7dbf02ccb608cb6afac31036e1a9dfdb731b46cd (diff)
downloadportage-04499f22f8a520f2a94044e47304d377f2a55398.tar.gz
portage-04499f22f8a520f2a94044e47304d377f2a55398.tar.bz2
portage-04499f22f8a520f2a94044e47304d377f2a55398.zip
dont break when the binhost url doesn't end with a slash (bug #144440, trunk r6978)
svn path=/main/branches/2.1.2/; revision=7003
Diffstat (limited to 'pym/getbinpkg.py')
-rw-r--r--pym/getbinpkg.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/pym/getbinpkg.py b/pym/getbinpkg.py
index 8c42c42bf..a506f4a13 100644
--- a/pym/getbinpkg.py
+++ b/pym/getbinpkg.py
@@ -78,14 +78,20 @@ def create_conn(baseurl,conn=None):
"""(baseurl,conn) --- Takes a protocol://site:port/address url, and an
optional connection. If connection is already active, it is passed on.
baseurl is reduced to address and is returned in tuple (conn,address)"""
+
parts = baseurl.split("://",1)
if len(parts) != 2:
raise ValueError, "Provided URL does not contain protocol identifier. '%s'" % baseurl
protocol,url_parts = parts
del parts
- host,address = url_parts.split("/",1)
+
+ url_parts = url_parts.split("/")
+ host = url_parts[0]
+ if len(url_parts) < 2:
+ address = "/"
+ else:
+ address = "/"+"/".join(url_parts[1:])
del url_parts
- address = "/"+address
userpass_host = host.split("@",1)
if len(userpass_host) == 1: