summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarius Mauch <genone@gentoo.org>2007-06-23 18:47:55 +0000
committerMarius Mauch <genone@gentoo.org>2007-06-23 18:47:55 +0000
commit8d92c6f70268c56e3351d01cd9fd2351e27d0bc9 (patch)
treef9d3e8f562cbdd2af4381e37ff46eb1908fb13b7
parent7171e9e58bd105648d2271a0c2b0506a01533c30 (diff)
downloadportage-8d92c6f70268c56e3351d01cd9fd2351e27d0bc9.tar.gz
portage-8d92c6f70268c56e3351d01cd9fd2351e27d0bc9.tar.bz2
portage-8d92c6f70268c56e3351d01cd9fd2351e27d0bc9.zip
dont break when the binhost url doesn't end with a slash (bug #144440)
svn path=/main/trunk/; revision=6978
-rw-r--r--pym/portage/getbinpkg.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/pym/portage/getbinpkg.py b/pym/portage/getbinpkg.py
index 410a48577..808eb64f9 100644
--- a/pym/portage/getbinpkg.py
+++ b/pym/portage/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: