Use Package.repo where appropriate.
authorZac Medico <zmedico@gentoo.org>
Tue, 27 Nov 2012 03:59:46 +0000 (19:59 -0800)
committerZac Medico <zmedico@gentoo.org>
Tue, 27 Nov 2012 03:59:46 +0000 (19:59 -0800)
pym/_emerge/FakeVartree.py
pym/_emerge/resolver/output.py
pym/portage/tests/resolver/ResolverPlayground.py

index 398cde8042dadae9a5850661c06b4af4bf847895..a0a506e36f3a48948ccf88333b92b952146741ba 100644 (file)
@@ -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
index 85e1dd7b011b3a89d41c44f761a5f95a652ce3b8..cfacab1494d4c7d048ce037755b38079643dfcb9 100644 (file)
@@ -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:
index f81e046c1c8e49a6c3eb51b26d9902ecd425543b..cd09442103b1fe73c2aba3b2af51262e4038c574 100644 (file)
@@ -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":