diff options
author | Zac Medico <zmedico@gentoo.org> | 2010-12-07 01:10:34 -0800 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2010-12-07 01:12:33 -0800 |
commit | 76975f6a269695f65fbda4296590dc91822b70ad (patch) | |
tree | b818a2a71a17a11e372bece7a76aa049d09c709d | |
parent | ecaa391a9a3bcfa338b9f29d9da6ec6bea4ed5d8 (diff) | |
download | portage-76975f6a269695f65fbda4296590dc91822b70ad.tar.gz portage-76975f6a269695f65fbda4296590dc91822b70ad.tar.bz2 portage-76975f6a269695f65fbda4296590dc91822b70ad.zip |
Scheduler: fix pkg cache for reposyntax
-rw-r--r-- | pym/_emerge/Scheduler.py | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py index 0d7e8a3d1..4e63a67e1 100644 --- a/pym/_emerge/Scheduler.py +++ b/pym/_emerge/Scheduler.py @@ -657,7 +657,9 @@ class Scheduler(PollScheduler): type_name = RootConfig.tree_pkg_map[pkg_dblink.treetype] root_config = self.trees[pkg_dblink.myroot]["root_config"] installed = type_name == "installed" - return self._pkg(cpv, type_name, root_config, installed=installed) + repo = pkg_dblink.settings.get("PORTAGE_REPO_NAME") + return self._pkg(cpv, type_name, root_config, + installed=installed, myrepo=repo) def _dblink_elog(self, pkg_dblink, phase, func, msgs): @@ -1977,21 +1979,34 @@ class Scheduler(PollScheduler): if world_locked: world_set.unlock() - def _pkg(self, cpv, type_name, root_config, installed=False): + def _pkg(self, cpv, type_name, root_config, installed=False, myrepo=None): """ Get a package instance from the cache, or create a new one if necessary. Raises KeyError from aux_get if it failures for some reason (package does not exist or is corrupt). """ + + if type_name != "ebuild": + # For installed (and binary) packages we don't care for the repo + # when it comes to hashing, because there can only be one cpv. + # So overwrite the repo_key with type_name. + repo_key = type_name + myrepo = None + elif myrepo is None: + raise AssertionError( + "Scheduler._pkg() called without 'myrepo' argument") + else: + repo_key = myrepo + operation = "merge" if installed: operation = "nomerge" - if self._digraph is not None: + if self._graph_config is not None: # Reuse existing instance when available. - pkg = self._digraph.get( - (type_name, root_config.root, cpv, operation)) + pkg = self._graph_config.pkg_cache.get( + (type_name, root_config.root, cpv, operation, repo_key)) if pkg is not None: return pkg |