summaryrefslogtreecommitdiffstats
path: root/pym/portage.py
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-12-16 23:25:03 +0000
committerZac Medico <zmedico@gentoo.org>2006-12-16 23:25:03 +0000
commit31e2c6934be25c49eda90f7271eee79fa42737a5 (patch)
treeb1abad50b4cfacaf45b7a4dccb39a2109e9f3907 /pym/portage.py
parent5d96649ac61ab51295b125b0dae33312fc009024 (diff)
downloadportage-31e2c6934be25c49eda90f7271eee79fa42737a5.tar.gz
portage-31e2c6934be25c49eda90f7271eee79fa42737a5.tar.bz2
portage-31e2c6934be25c49eda90f7271eee79fa42737a5.zip
Make use_reduce raise an InvalidDependString exception for use? conditionals that aren't followed by parenthesis and add appropriate exception handling in dep_check.
svn path=/main/trunk/; revision=5305
Diffstat (limited to 'pym/portage.py')
-rw-r--r--pym/portage.py37
1 files changed, 19 insertions, 18 deletions
diff --git a/pym/portage.py b/pym/portage.py
index 0f1ba998f..7688b5aba 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -3884,26 +3884,27 @@ def dep_check(depstring, mydbapi, mysettings, use="yes", mode=None, myuse=None,
#convert parenthesis to sublists
mysplit = portage_dep.paren_reduce(depstring)
- if mysettings:
- mymasks = set()
- useforce = set([mysettings["ARCH"]])
- if use == "all":
- # These masks are only for repoman. In other cases, relevant masks
- # should have already been applied via config.regenerate(). Also,
- # binary or installed packages may have been built with flags that
- # are now masked, and it would be inconsistent to mask them now.
- # Additionally, myuse may consist of flags from a parent package
- # that is being merged to a $ROOT that is different from the one
- # that mysettings represents.
- mymasks.update(mysettings.usemask)
- mymasks.update(mysettings.archlist())
- mymasks.discard(mysettings["ARCH"])
- useforce.update(mysettings.useforce)
- useforce.difference_update(mymasks)
+ mymasks = set()
+ useforce = set()
+ useforce.add(mysettings["ARCH"])
+ if use == "all":
+ # This masking/forcing is only for repoman. In other cases, relevant
+ # masking/forcing should have already been applied via
+ # config.regenerate(). Also, binary or installed packages may have
+ # been built with flags that are now masked, and it would be
+ # inconsistent to mask them now. Additionally, myuse may consist of
+ # flags from a parent package that is being merged to a $ROOT that is
+ # different from the one that mysettings represents.
+ mymasks.update(mysettings.usemask)
+ mymasks.update(mysettings.archlist())
+ mymasks.discard(mysettings["ARCH"])
+ useforce.update(mysettings.useforce)
+ useforce.difference_update(mymasks)
+ try:
mysplit = portage_dep.use_reduce(mysplit, uselist=myusesplit,
masklist=mymasks, matchall=(use=="all"), excludeall=useforce)
- else:
- mysplit = portage_dep.use_reduce(mysplit,uselist=myusesplit,matchall=(use=="all"))
+ except portage_exception.InvalidDependString, e:
+ return [0, str(e)]
# Do the || conversions
mysplit=portage_dep.dep_opconvert(mysplit)