summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-07-25 21:04:37 +0000
committerZac Medico <zmedico@gentoo.org>2008-07-25 21:04:37 +0000
commita4298d1054bbe5a219d53bf39745c1c88491c59b (patch)
tree5f736437a4e1c679d739f9afe8108c650c42f402
parentff490f6e06d4f30633c7f7e6ab1e82e15ea1292e (diff)
downloadportage-a4298d1054bbe5a219d53bf39745c1c88491c59b.tar.gz
portage-a4298d1054bbe5a219d53bf39745c1c88491c59b.tar.bz2
portage-a4298d1054bbe5a219d53bf39745c1c88491c59b.zip
Detect an invalid cpv passed into portdbapi.findname2() and raise an
InvalidPackageName exception. This avoids silent or nonsense errors later on. svn path=/main/trunk/; revision=11188
-rw-r--r--pym/portage/dbapi/porttree.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py
index 23fb67d32..872621e18 100644
--- a/pym/portage/dbapi/porttree.py
+++ b/pym/portage/dbapi/porttree.py
@@ -11,7 +11,7 @@ from portage.dep import use_reduce, paren_reduce, dep_getslot, dep_getkey, \
match_from_list, match_to_list, remove_slot
from portage.exception import OperationNotPermitted, PortageException, \
UntrustedSignature, SecurityViolation, InvalidSignature, MissingSignature, \
- FileNotFound, InvalidDependString
+ FileNotFound, InvalidDependString, InvalidPackageName
from portage.manifest import Manifest
from portage.output import red
from portage.util import ensure_dirs, writemsg, apply_recursive_permissions
@@ -216,6 +216,8 @@ class portdbapi(dbapi):
return "",0
mysplit = mycpv.split("/")
psplit = pkgsplit(mysplit[1])
+ if psplit is None or len(mysplit) != 2:
+ raise InvalidPackageName(mycpv)
if mytree:
mytrees = [mytree]