diff options
-rw-r--r-- | pym/portage/dbapi/porttree.py | 5 | ||||
-rw-r--r-- | pym/portage/tests/resolver/test_multirepo.py | 14 |
2 files changed, 11 insertions, 8 deletions
diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py index d5fb0a18c..44dfa2503 100644 --- a/pym/portage/dbapi/porttree.py +++ b/pym/portage/dbapi/porttree.py @@ -265,6 +265,9 @@ class portdbapi(dbapi): self._repo_info[path] = _repo_info(repo_name, path, eclass_db) + #Keep a list of repo names, sorted by priority (highest priority first). + self._ordered_repo_name_list = tuple(self._repo_info[path].name for path in reversed(self.porttrees)) + self.auxdbmodule = self.settings.load_best_module("portdbapi.auxdbmodule") self.auxdb = {} self._pregen_auxdb = {} @@ -388,7 +391,7 @@ class portdbapi(dbapi): repository IDs TreeMap = {id: path} """ - return [k for k in self.treemap if k] + return self._ordered_repo_name_list def findname2(self, mycpv, mytree=None, myrepo = None): """ diff --git a/pym/portage/tests/resolver/test_multirepo.py b/pym/portage/tests/resolver/test_multirepo.py index 4ff7ce3de..14f415c99 100644 --- a/pym/portage/tests/resolver/test_multirepo.py +++ b/pym/portage/tests/resolver/test_multirepo.py @@ -75,19 +75,19 @@ class MultirepoTestCase(TestCase): check_repo_names = True, mergelist = ["dev-libs/C-1::repo1"]), - #Package in repository 1 and 2, but 1 must be used + #Package in repository 1 and 2, but 2 must be used ResolverPlaygroundTestCase( ["dev-libs/D"], success = True, check_repo_names = True, - mergelist = ["dev-libs/D-1::repo1"]), + mergelist = ["dev-libs/D-1::repo2"]), #Atoms with slots ResolverPlaygroundTestCase( ["dev-libs/E"], success = True, check_repo_names = True, - mergelist = ["dev-libs/E-1::repo1"]), + mergelist = ["dev-libs/E-1::repo2"]), ResolverPlaygroundTestCase( ["dev-libs/E:1::repo2"], success = True, @@ -102,17 +102,17 @@ class MultirepoTestCase(TestCase): ["dev-libs/F:1"], success = True, check_repo_names = True, - mergelist = ["dev-libs/F-1::repo1"]), + mergelist = ["dev-libs/F-1::repo2"]), ResolverPlaygroundTestCase( ["=dev-libs/F-1:1"], success = True, check_repo_names = True, - mergelist = ["dev-libs/F-1::repo1"]), + mergelist = ["dev-libs/F-1::repo2"]), ResolverPlaygroundTestCase( - ["=dev-libs/F-1:1::repo2"], + ["=dev-libs/F-1:1::repo1"], success = True, check_repo_names = True, - mergelist = ["dev-libs/F-1::repo2"]), + mergelist = ["dev-libs/F-1::repo1"]), ) playground = ResolverPlayground(ebuilds=ebuilds, sets=sets) |