Fix resume logic in binarytree.gettbz2(). (trunk r7017:7019)
authorZac Medico <zmedico@gentoo.org>
Mon, 25 Jun 2007 02:59:26 +0000 (02:59 -0000)
committerZac Medico <zmedico@gentoo.org>
Mon, 25 Jun 2007 02:59:26 +0000 (02:59 -0000)
svn path=/main/branches/2.1.2/; revision=7020

pym/portage.py

index 99ae092d60ce86efa03831af1dff2f09ad597f1b..9307ce8be4eac315341584ad83041409b4f754fd 100644 (file)
@@ -6803,12 +6803,12 @@ class binarytree(object):
                """Fetches the package from a remote site, if necessary.  Attempts to
                resume if the file appears to be partially downloaded."""
                print "Fetching '"+str(pkgname)+"'"
-               mysplit  = pkgname.split("/")
-               tbz2name = mysplit[1]+".tbz2"
+               tbz2_path = self.getname(pkgname)
+               tbz2name = os.path.basename(tbz2_path)
                resume = False
-               if not self.isremote(pkgname):
+               if os.path.exists(tbz2_path):
                        if (tbz2name not in self.invalids):
-                               return
+                               return 1
                        else:
                                resume = True
                                writemsg("Resuming download of this tbz2, but it is possible that it is corrupt.\n",