diff options
author | Zac Medico <zmedico@gentoo.org> | 2007-06-11 02:49:15 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2007-06-11 02:49:15 +0000 |
commit | c69b0f404b40e56e05c9ab443353cb7332c61183 (patch) | |
tree | 93f8494b3265a635ce7f660790e3b9bfc80bcb75 /pym/portage.py | |
parent | d0dc4df791e8500e89c955a09436f5f2a0385d7e (diff) | |
download | portage-c69b0f404b40e56e05c9ab443353cb7332c61183.tar.gz portage-c69b0f404b40e56e05c9ab443353cb7332c61183.tar.bz2 portage-c69b0f404b40e56e05c9ab443353cb7332c61183.zip |
For bug #181355, detect parenthesis mismatch in paren_reduce(), raise an InvalidDependString exception, and make sure that all callers handle the exception properly. (trunk r6795:6797)
svn path=/main/branches/2.1.2/; revision=6798
Diffstat (limited to 'pym/portage.py')
-rw-r--r-- | pym/portage.py | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/pym/portage.py b/pym/portage.py index c59edb941..ee7b9c4a0 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -3092,9 +3092,14 @@ def doebuild_environment(myebuild, mydo, myroot, mysettings, debug, use_cache, m if not eapi_is_supported(eapi): # can't do anything with this. raise portage_exception.UnsupportedAPIException(mycpv, eapi) - mysettings["PORTAGE_RESTRICT"] = " ".join(flatten( - portage_dep.use_reduce(portage_dep.paren_reduce( - mysettings["RESTRICT"]), uselist=mysettings["USE"].split()))) + try: + mysettings["PORTAGE_RESTRICT"] = " ".join(flatten( + portage_dep.use_reduce(portage_dep.paren_reduce( + mysettings.get("RESTRICT","")), + uselist=mysettings.get("USE","").split()))) + except portage_exception.InvalidDependString: + # RESTRICT is validated again inside doebuild, so let this go + mysettings["PORTAGE_RESTRICT"] = "" if mysplit[2] == "r0": mysettings["PVR"]=mysplit[1] @@ -4398,7 +4403,10 @@ def dep_check(depstring, mydbapi, mysettings, use="yes", mode=None, myuse=None, myusesplit=[] #convert parenthesis to sublists - mysplit = portage_dep.paren_reduce(depstring) + try: + mysplit = portage_dep.paren_reduce(depstring) + except portage_exception.InvalidDependString, e: + return [0, str(e)] mymasks = set() useforce = set() |