diff options
author | Zac Medico <zmedico@gentoo.org> | 2009-09-26 23:37:34 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2009-09-26 23:37:34 +0000 |
commit | 7a6a2598c417b0079036a37e3203d3451bb49654 (patch) | |
tree | 8adbb1edb29eb85d0da461f35aca5227426c6196 /pym/_emerge/depgraph.py | |
parent | a24887033140f28a94c7e247e8ac3d48b8e2280e (diff) | |
download | portage-7a6a2598c417b0079036a37e3203d3451bb49654.tar.gz portage-7a6a2598c417b0079036a37e3203d3451bb49654.tar.bz2 portage-7a6a2598c417b0079036a37e3203d3451bb49654.zip |
Bug #286522 - Check all portdbapi.findname return values in case it
returns None, and raise 'ebuild not found' exceptions when necessary.
svn path=/main/trunk/; revision=14442
Diffstat (limited to 'pym/_emerge/depgraph.py')
-rw-r--r-- | pym/_emerge/depgraph.py | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py index d67eb341d..deaba1955 100644 --- a/pym/_emerge/depgraph.py +++ b/pym/_emerge/depgraph.py @@ -4097,10 +4097,11 @@ class depgraph(object): 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 - raise portage.exception.PackageNotFound(pkg_key) + if pkg.type_name == "ebuild": + ebuild_path = portdb.findname(pkg.cpv) + if ebuild_path is None: + raise AssertionError( + "ebuild not found for '%s'" % pkg.cpv) repo_path_real = os.path.dirname(os.path.dirname( os.path.dirname(ebuild_path))) else: @@ -4163,9 +4164,14 @@ class depgraph(object): if "--changelog" in self._frozen_config.myopts: inst_matches = vardb.match(pkg.slot_atom) if inst_matches: - changelogs.extend(calc_changelog( - portdb.findname(pkg_key), - inst_matches[0], pkg_key)) + ebuild_path_cl = ebuild_path + if ebuild_path_cl is None: + # binary package + ebuild_path_cl = portdb.findname(pkg.cpv) + + if ebuild_path_cl is not None: + changelogs.extend(calc_changelog( + ebuild_path_cl, inst_matches[0], pkg.cpv)) else: addl = " " + green("N") + " " + fetch + " " if ordered: |