diff options
author | Zac Medico <zmedico@gentoo.org> | 2008-04-28 22:23:32 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2008-04-28 22:23:32 +0000 |
commit | a3a836d3a2ad8905e50755bfddcd3e7245f69167 (patch) | |
tree | 8cd4e3435804c95dc57760f75d5184d158f54101 /bin | |
parent | fc5025c5cd9e9bdcd8ec4eb4c1787b002416d98a (diff) | |
download | portage-a3a836d3a2ad8905e50755bfddcd3e7245f69167.tar.gz portage-a3a836d3a2ad8905e50755bfddcd3e7245f69167.tar.bz2 portage-a3a836d3a2ad8905e50755bfddcd3e7245f69167.zip |
Handle a potential KeyError in depgraph.display() when in --resume mode
and a package scheduled for uninstall is no longer installed. (trunk r10032)
svn path=/main/branches/2.1.2/; revision=10033
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/emerge | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/bin/emerge b/bin/emerge index 20bb8dd7e..34b57fde3 100755 --- a/bin/emerge +++ b/bin/emerge @@ -4191,16 +4191,27 @@ class depgraph(object): else: blockers.append(addl) else: - pkg = self._pkg_cache[tuple(x)] - metadata = pkg.metadata pkg_status = x[3] pkg_merge = ordered and pkg_status == "merge" if not pkg_merge and pkg_status == "merge": pkg_status = "nomerge" - ebuild_path = None - repo_name = metadata["repository"] built = pkg_type != "ebuild" installed = pkg_type == "installed" + try: + pkg = self._pkg_cache[tuple(x)] + except KeyError: + if pkg_status != "uninstall": + raise + # A package scheduled for uninstall apparently + # isn't installed anymore. Since it's already + # been uninstalled, move on to the next task. + # This case should only be reachable in --resume + # mode, since otherwise the package would have + # been cached. + continue + metadata = pkg.metadata + ebuild_path = None + repo_name = metadata["repository"] if pkg_type == "ebuild": ebuild_path = portdb.findname(pkg_key) if not ebuild_path: # shouldn't happen |