From 2083dae3fc52e2387d1c137c8aa203d083f13fc9 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Mon, 26 Nov 2012 19:59:46 -0800 Subject: [PATCH] Use Package.repo where appropriate. --- pym/_emerge/FakeVartree.py | 8 +++----- pym/_emerge/resolver/output.py | 8 +++----- pym/portage/tests/resolver/ResolverPlayground.py | 4 ++-- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/pym/_emerge/FakeVartree.py b/pym/_emerge/FakeVartree.py index 398cde804..a0a506e36 100644 --- a/pym/_emerge/FakeVartree.py +++ b/pym/_emerge/FakeVartree.py @@ -12,8 +12,7 @@ from portage.const import VDB_PATH from portage.dbapi.vartree import vartree from portage.dep._slot_operator import find_built_slot_operator_atoms from portage.eapi import _get_eapi_attrs -from portage.exception import InvalidDependString -from portage.repository.config import _gen_valid_repo +from portage.exception import InvalidData, InvalidDependString from portage.update import grab_updates, parse_updates, update_dbentries from portage.versions import _pkg_str @@ -111,7 +110,6 @@ class FakeVartree(vartree): # a KeyError to the caller if appropriate. pkg_obj = self.dbapi._cpv_map[pkg] installed_eapi = pkg_obj.eapi - repo = pkg_obj.metadata['repository'] eapi_attrs = _get_eapi_attrs(installed_eapi) built_slot_operator_atoms = None @@ -123,9 +121,9 @@ class FakeVartree(vartree): try: # Use the live ebuild metadata if possible. - repo = _gen_valid_repo(repo) live_metadata = dict(zip(self._portdb_keys, - self._portdb.aux_get(pkg, self._portdb_keys, myrepo=repo))) + self._portdb.aux_get(pkg, self._portdb_keys, + myrepo=pkg_obj.repo))) # Use the metadata from the installed instance if the EAPI # of either instance is unsupported, since if the installed # instance has an unsupported or corrupt EAPI then we don't diff --git a/pym/_emerge/resolver/output.py b/pym/_emerge/resolver/output.py index 85e1dd7b0..cfacab149 100644 --- a/pym/_emerge/resolver/output.py +++ b/pym/_emerge/resolver/output.py @@ -340,10 +340,9 @@ class Display(object): if self.quiet_repo_display: # overlay verbose # assign index for a previous version in the same slot - slot_matches = self.vardb.match(pkg.slot_atom) + slot_matches = self.vardb.match_pkgs(pkg.slot_atom) if slot_matches: - repo_name_prev = self.vardb.aux_get(slot_matches[0], - ["repository"])[0] + repo_name_prev = slot_matches[0].repo else: repo_name_prev = None @@ -649,8 +648,7 @@ class Display(object): pkg_info.repo_path_real = os.path.dirname(os.path.dirname( os.path.dirname(pkg_info.ebuild_path))) else: - pkg_info.repo_path_real = \ - self.portdb.getRepositoryPath(pkg.metadata["repository"]) + pkg_info.repo_path_real = self.portdb.getRepositoryPath(pkg.repo) pkg_info.use = list(self.conf.pkg_use_enabled(pkg)) if not pkg.built and pkg.operation == 'merge' and \ 'fetch' in pkg.metadata.restrict: diff --git a/pym/portage/tests/resolver/ResolverPlayground.py b/pym/portage/tests/resolver/ResolverPlayground.py index f81e046c1..cd0944210 100644 --- a/pym/portage/tests/resolver/ResolverPlayground.py +++ b/pym/portage/tests/resolver/ResolverPlayground.py @@ -716,8 +716,8 @@ class ResolverPlaygroundResult(object): self.mergelist.append(x.atom) else: repo_str = "" - if x.metadata["repository"] != "test_repo": - repo_str = _repo_separator + x.metadata["repository"] + if x.repo != "test_repo": + repo_str = _repo_separator + x.repo mergelist_str = x.cpv + repo_str if x.built: if x.operation == "merge": -- 2.26.2