diff options
author | Zac Medico <zmedico@gentoo.org> | 2007-07-30 03:45:08 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2007-07-30 03:45:08 +0000 |
commit | 08474a7948ea80c25955262b6f6d2d6fa2992fcf (patch) | |
tree | 2c6954c5b988c60efed051ce2f7afa484f5a910a /pym | |
parent | d6b4521ad656c51513a5bda6a88b38d714d7fcbd (diff) | |
download | portage-08474a7948ea80c25955262b6f6d2d6fa2992fcf.tar.gz portage-08474a7948ea80c25955262b6f6d2d6fa2992fcf.tar.bz2 portage-08474a7948ea80c25955262b6f6d2d6fa2992fcf.zip |
For bug #181355, detect parenthesis mismatch in paren_reduce(), raise an InvalidDependString exception, and make sure that all callers handle the exception properly. (branches/2.1.2 r6798)
svn path=/main/branches/2.1.2.9/; revision=7459
Diffstat (limited to 'pym')
-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 1e9d104af..ebe2c96a6 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -3064,9 +3064,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] @@ -4368,7 +4373,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() |