Don't use urljoin() in binarytree.gettbz2() since it doesn't work correctly wih unrec...
authorZac Medico <zmedico@gentoo.org>
Mon, 25 Jun 2007 06:21:33 +0000 (06:21 -0000)
committerZac Medico <zmedico@gentoo.org>
Mon, 25 Jun 2007 06:21:33 +0000 (06:21 -0000)
svn path=/main/trunk/; revision=7027

pym/portage/dbapi/bintree.py

index 5cc959615bc94ac0b24d09fa603d9f18009b2523..9898639e195dde56675904f9fa10c55294c9fb10 100644 (file)
@@ -864,14 +864,15 @@ class binarytree(object):
                        os.makedirs(mydest, 0775)
                except (OSError, IOError):
                        pass
-               from urlparse import urljoin, urlparse
+               from urlparse import urlparse
+               # urljoin doesn't work correctly with unrecognized protocols like sftp
                if self._remote_has_index:
                        rel_url = self._remotepkgs[pkgname].get("PATH")
                        if not rel_url:
                                rel_url = pkgname+".tbz2"
-                       url = urljoin(self._remote_base_uri, rel_url)
+                       url = self._remote_base_uri.rstrip("/") + "/" + rel_url.lstrip("/")
                else:
-                       url = urljoin(self.settings["PORTAGE_BINHOST"], tbz2name)
+                       url = self.settings["PORTAGE_BINHOST"].rstrip("/") + "/" + tbz2name
                protocol = urlparse(url)[0]
                fcmd_prefix = "FETCHCOMMAND"
                if resume: