Fix bugs in binarytree.invalids usage.
authorZac Medico <zmedico@gentoo.org>
Sun, 1 Jul 2012 08:11:12 +0000 (01:11 -0700)
committerZac Medico <zmedico@gentoo.org>
Sun, 1 Jul 2012 08:11:12 +0000 (01:11 -0700)
pym/portage/dbapi/bintree.py
pym/portage/dbapi/vartree.py

index fb315729c02c982e520e145854dfa5bc5c92af29..1048cc108f222793b7d4ca60649de644f0a2eb9a 100644 (file)
@@ -1312,6 +1312,8 @@ class binarytree(object):
                """Returns the URI to the Packages file for a given package."""
                return self._pkgindex_uri.get(pkgname)
 
+
+
        def gettbz2(self, pkgname):
                """Fetches the package from a remote site, if necessary.  Attempts to
                resume if the file appears to be partially downloaded."""
@@ -1319,7 +1321,7 @@ class binarytree(object):
                tbz2name = os.path.basename(tbz2_path)
                resume = False
                if os.path.exists(tbz2_path):
-                       if (tbz2name not in self.invalids):
+                       if tbz2name[:-5] not in self.invalids:
                                return
                        else:
                                resume = True
index 0d7327ad418fbea3154af370e95baf436ff9fa51..e5e1195361ef6fcea9fa894231fb49dcd24209dd 100644 (file)
@@ -4727,7 +4727,7 @@ class dblink(object):
                bintree = trees["bintree"]
                binpkg_path = bintree.getname(backup_dblink.mycpv)
                if os.path.exists(binpkg_path) and \
-                       backup_dblink.mycpv not in bintree.invalids:
+                       catsplit(backup_dblink.mycpv)[1] not in bintree.invalids:
                        return os.EX_OK
 
                self.lockdb()