summaryrefslogtreecommitdiffstats
path: root/pym/portage/dep/dep_check.py
diff options
context:
space:
mode:
authorSebastian Luther <SebastianLuther@gmx.de>2010-08-16 21:41:02 +0200
committerZac Medico <zmedico@gentoo.org>2010-08-16 17:40:27 -0700
commitc9f7930883d62fc26af72bff0c4623db0bbc8221 (patch)
tree5a7715ef593ee43085714150f1b5e784a01a551f /pym/portage/dep/dep_check.py
parent2fd3ea367e0b7f7978a3fc85e5cb57e7191ee431 (diff)
downloadportage-c9f7930883d62fc26af72bff0c4623db0bbc8221.tar.gz
portage-c9f7930883d62fc26af72bff0c4623db0bbc8221.tar.bz2
portage-c9f7930883d62fc26af72bff0c4623db0bbc8221.zip
Pass token_class parameter if possible to use_reduce
Diffstat (limited to 'pym/portage/dep/dep_check.py')
-rw-r--r--pym/portage/dep/dep_check.py43
1 files changed, 20 insertions, 23 deletions
diff --git a/pym/portage/dep/dep_check.py b/pym/portage/dep/dep_check.py
index 74e14882b..4e0d319db 100644
--- a/pym/portage/dep/dep_check.py
+++ b/pym/portage/dep/dep_check.py
@@ -60,32 +60,29 @@ def _expand_new_virtuals(mysplit, edebug, mydbapi, mysettings, myroot="/",
continue
if not isinstance(x, Atom):
- try:
- x = Atom(x)
- except InvalidAtom:
- raise ParseError(
- _("invalid atom: '%s'") % x)
- else:
- if x.blocker and x.blocker.overlap.forbid and \
- not eapi_has_strong_blocks(eapi):
- raise ParseError(
- _("invalid atom: '%s'") % (x,))
- if x.use and not eapi_has_use_deps(eapi):
- raise ParseError(
- _("invalid atom: '%s'") % (x,))
- if x.slot and not eapi_has_slot_deps(eapi):
- raise ParseError(
- _("invalid atom: '%s'") % (x,))
- if x.use and (x.use.missing_enabled or x.use.missing_disabled) \
- and not eapi_has_use_dep_defaults(eapi):
- raise ParseError(
- _("invalid atom: '%s'") % (x,))
+ raise ParseError(
+ _("invalid token: '%s'") % x)
+
+ if x.blocker and x.blocker.overlap.forbid and \
+ not eapi_has_strong_blocks(eapi):
+ raise ParseError(
+ _("strong blocks are not allowed in EAPI %s: '%s'") % (eapi, x))
+ if x.use and not eapi_has_use_deps(eapi):
+ raise ParseError(
+ _("use deps are not allowed in EAPI %s: '%s'") % (eapi, x))
+ if x.slot and not eapi_has_slot_deps(eapi):
+ raise ParseError(
+ _("slot deps are not allowed in EAPI %s: '%s'") % (eapi, x))
+ if x.use and (x.use.missing_enabled or x.use.missing_disabled) \
+ and not eapi_has_use_dep_defaults(eapi):
+ raise ParseError(
+ _("use dep defaults are not allowed in EAPI %s: '%s'") % (eapi, x))
if repoman:
x = x._eval_qa_conditionals(use_mask, use_force)
if not repoman and \
- myuse is not None and isinstance(x, Atom) and x.use:
+ myuse is not None and x.use:
if x.use.conditional:
x = x.evaluate_conditionals(myuse)
@@ -542,8 +539,8 @@ def dep_check(depstring, mydbapi, mysettings, use="yes", mode=None, myuse=None,
useforce.update(mysettings.useforce)
useforce.difference_update(mymasks)
try:
- mysplit = use_reduce(depstring, uselist=myusesplit,
- masklist=mymasks, matchall=(use=="all"), excludeall=useforce, opconvert=True)
+ mysplit = use_reduce(depstring, uselist=myusesplit, masklist=mymasks, \
+ matchall=(use=="all"), excludeall=useforce, opconvert=True, token_class=Atom)
except InvalidDependString as e:
return [0, str(e)]