summaryrefslogtreecommitdiffstats
path: root/pym/portage
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-09-26 23:37:34 +0000
committerZac Medico <zmedico@gentoo.org>2009-09-26 23:37:34 +0000
commit7a6a2598c417b0079036a37e3203d3451bb49654 (patch)
tree8adbb1edb29eb85d0da461f35aca5227426c6196 /pym/portage
parenta24887033140f28a94c7e247e8ac3d48b8e2280e (diff)
downloadportage-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/portage')
-rw-r--r--pym/portage/dbapi/porttree.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py
index eb68ae2b5..f7c8288d5 100644
--- a/pym/portage/dbapi/porttree.py
+++ b/pym/portage/dbapi/porttree.py
@@ -447,7 +447,7 @@ class portdbapi(dbapi):
the file we wanted.
"""
if not mycpv:
- return ("", 0)
+ return (None, 0)
mysplit = mycpv.split("/")
psplit = pkgsplit(mysplit[1])
if psplit is None or len(mysplit) != 2:
@@ -614,9 +614,8 @@ class portdbapi(dbapi):
myebuild, mylocation = self.findname2(mycpv, mytree)
if not myebuild:
- writemsg(_("!!! aux_get(): ebuild path for '%s' not specified:\n") % mycpv,
- noiselevel=1)
- writemsg("!!! %s\n" % myebuild, noiselevel=1)
+ writemsg("!!! aux_get(): %s\n" % \
+ _("ebuild not found for '%s'") % mycpv, noiselevel=1)
raise KeyError(mycpv)
mydata, st, emtime = self._pull_valid_cache(mycpv, myebuild, mylocation)
@@ -783,6 +782,8 @@ class portdbapi(dbapi):
def getfetchsizes(self, mypkg, useflags=None, debug=0):
# returns a filename:size dictionnary of remaining downloads
myebuild = self.findname(mypkg)
+ if myebuild is None:
+ raise AssertionError("ebuild not found for '%s'" % mypkg)
pkgdir = os.path.dirname(myebuild)
mf = Manifest(pkgdir, self.mysettings["DISTDIR"])
checksums = mf.getDigests()
@@ -826,6 +827,8 @@ class portdbapi(dbapi):
useflags = mysettings["USE"].split()
myfiles = self.getFetchMap(mypkg, useflags=useflags)
myebuild = self.findname(mypkg)
+ if myebuild is None:
+ raise AssertionError("ebuild not found for '%s'" % mypkg)
pkgdir = os.path.dirname(myebuild)
mf = Manifest(pkgdir, self.mysettings["DISTDIR"])
mysums = mf.getDigests()