From 2996589fcbe536878e19c0b0113a0082291029ae Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Mon, 25 Jun 2007 02:42:54 +0000 Subject: [PATCH] For bug #175891, support ${FETCHCOMMAND}_${PROTOCOL} in binarytree.gettbz2(). (trunk r7016) svn path=/main/branches/2.1.2/; revision=7017 --- pym/portage.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/pym/portage.py b/pym/portage.py index 5dca355b7..99ae092d6 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -6805,10 +6805,12 @@ class binarytree(object): print "Fetching '"+str(pkgname)+"'" mysplit = pkgname.split("/") tbz2name = mysplit[1]+".tbz2" + resume = False if not self.isremote(pkgname): if (tbz2name not in self.invalids): return else: + resume = True writemsg("Resuming download of this tbz2, but it is possible that it is corrupt.\n", noiselevel=-1) mydest = self.pkgdir+"/All/" @@ -6816,9 +6818,16 @@ class binarytree(object): os.makedirs(mydest, 0775) except (OSError, IOError): pass - return getbinpkg.file_get( - self.settings["PORTAGE_BINHOST"] + "/" + tbz2name, - mydest, fcmd=self.settings["RESUMECOMMAND"]) + from urlparse import urljoin, urlparse + url = urljoin(self.settings["PORTAGE_BINHOST"], tbz2name) + protocol = urlparse(url)[0] + fcmd_prefix = "FETCHCOMMAND" + if resume: + fcmd_prefix = "RESUMECOMMAND" + fcmd = self.settings.get(fcmd_prefix + "_" + protocol.upper()) + if not fcmd: + fcmd = self.settings.get(fcmd_prefix) + return getbinpkg.file_get(url, mydest, fcmd=fcmd) def getslot(self,mycatpkg): "Get a slot for a catpkg; assume it exists." -- 2.26.2