summaryrefslogtreecommitdiffstats
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-03-02 21:08:03 +0000
committerZac Medico <zmedico@gentoo.org>2010-03-02 21:08:03 +0000
commit71ffd96ceb12f0f4f2d77a1cfbed0516d4290960 (patch)
tree2343a8a523c7d5a56ca29e71a5e3133873425a82 /pym
parent18dcc0902a22f10192b7377aa08887ea1056f5e5 (diff)
downloadportage-71ffd96ceb12f0f4f2d77a1cfbed0516d4290960.tar.gz
portage-71ffd96ceb12f0f4f2d77a1cfbed0516d4290960.tar.bz2
portage-71ffd96ceb12f0f4f2d77a1cfbed0516d4290960.zip
Make _global_updates ensure that the binarytree is only populated with local
packages (getbinpkgs=0), and fix binarytree.populate() to behave properly when called more than once. (trunk r15487) svn path=/main/branches/2.1.7/; revision=15688
Diffstat (limited to 'pym')
-rw-r--r--pym/portage/_global_updates.py4
-rw-r--r--pym/portage/dbapi/bintree.py12
2 files changed, 12 insertions, 4 deletions
diff --git a/pym/portage/_global_updates.py b/pym/portage/_global_updates.py
index baf2e9b72..040de276a 100644
--- a/pym/portage/_global_updates.py
+++ b/pym/portage/_global_updates.py
@@ -94,6 +94,10 @@ def _global_updates(trees, prev_mtimes):
bindb = trees["/"]["bintree"].dbapi
if not os.access(bindb.bintree.pkgdir, os.W_OK):
bindb = None
+ else:
+ # Call binarytree.populate(), since we want to make sure it's
+ # only populated with local packages here (getbinpkgs=0).
+ bindb.bintree.populate()
for update_cmd in myupd:
if update_cmd[0] == "move":
moves = vardb.move_ent(update_cmd)
diff --git a/pym/portage/dbapi/bintree.py b/pym/portage/dbapi/bintree.py
index fa68ba7d7..626e55808 100644
--- a/pym/portage/dbapi/bintree.py
+++ b/pym/portage/dbapi/bintree.py
@@ -482,6 +482,13 @@ class binarytree(object):
if (not os.path.isdir(self.pkgdir) and not getbinpkgs):
return 0
+ # Clear all caches in case populate is called multiple times
+ # as may be the case when _global_updates calls populate()
+ # prior to performing package moves since it only wants to
+ # operate on local packages (getbinpkgs=0).
+ self._remotepkgs = None
+ self.dbapi._clear_cache()
+ self.dbapi._aux_cache.clear()
if True:
pkg_paths = {}
self._pkg_paths = pkg_paths
@@ -693,10 +700,7 @@ class binarytree(object):
writemsg(_("!!! PORTAGE_BINHOST unset, but use is requested.\n"),
noiselevel=-1)
- if getbinpkgs and \
- "PORTAGE_BINHOST" in self.settings and \
- not self._remotepkgs:
-
+ if getbinpkgs and 'PORTAGE_BINHOST' in self.settings:
base_url = self.settings["PORTAGE_BINHOST"]
from portage.const import CACHE_PATH
try: