From e26ac28af7a6dc4cff2bf00737841d14dea669a5 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sun, 1 Jul 2012 01:11:12 -0700 Subject: [PATCH] Fix bugs in binarytree.invalids usage. --- pym/portage/dbapi/bintree.py | 4 +++- pym/portage/dbapi/vartree.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pym/portage/dbapi/bintree.py b/pym/portage/dbapi/bintree.py index fb315729c..1048cc108 100644 --- a/pym/portage/dbapi/bintree.py +++ b/pym/portage/dbapi/bintree.py @@ -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 diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index 0d7327ad4..e5e119536 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -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() -- 2.26.2