diff options
author | Zac Medico <zmedico@gentoo.org> | 2010-08-26 08:06:37 -0700 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2010-08-26 08:06:37 -0700 |
commit | a3c4ea7d0e76f4172263526f06ed9dce0be6fd8a (patch) | |
tree | 27258a133fa02bbe1a978faa16e815cacad16e79 | |
parent | f8433f1fde7b87a876689e2fcf9c6c658095a9ce (diff) | |
download | portage-a3c4ea7d0e76f4172263526f06ed9dce0be6fd8a.tar.gz portage-a3c4ea7d0e76f4172263526f06ed9dce0be6fd8a.tar.bz2 portage-a3c4ea7d0e76f4172263526f06ed9dce0be6fd8a.zip |
Add code to dep_check(), borrowed from _expand_new_virtuals(), to pass
eapi to use_reduce() when available.
-rw-r--r-- | pym/portage/dep/dep_check.py | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/pym/portage/dep/dep_check.py b/pym/portage/dep/dep_check.py index 132103719..9b4e97097 100644 --- a/pym/portage/dep/dep_check.py +++ b/pym/portage/dep/dep_check.py @@ -6,11 +6,10 @@ __all__ = ['dep_check', 'dep_eval', 'dep_wordreduce', 'dep_zapdeps'] import logging import portage -from portage.dep import Atom, match_from_list, \ - remove_slot, use_reduce +from portage.dep import Atom, match_from_list, use_reduce from portage.eapi import eapi_has_strong_blocks, eapi_has_use_deps, eapi_has_slot_deps, \ eapi_has_use_dep_defaults -from portage.exception import InvalidAtom, InvalidDependString, ParseError +from portage.exception import InvalidDependString, ParseError from portage.localization import _ from portage.util import writemsg, writemsg_level from portage.versions import catpkgsplit, cpv_getkey, pkgcmp @@ -538,9 +537,22 @@ def dep_check(depstring, mydbapi, mysettings, use="yes", mode=None, myuse=None, mymasks.discard(mysettings["ARCH"]) useforce.update(mysettings.useforce) useforce.difference_update(mymasks) + + # eapi code borrowed from _expand_new_virtuals() + mytrees = trees[myroot] + parent = mytrees.get("parent") + virt_parent = mytrees.get("virt_parent") + eapi = None + if parent is not None: + if virt_parent is not None: + eapi = virt_parent[0].metadata['EAPI'] + else: + eapi = parent.metadata["EAPI"] + try: mysplit = use_reduce(depstring, uselist=myusesplit, masklist=mymasks, \ - matchall=(use=="all"), excludeall=useforce, opconvert=True, token_class=Atom) + matchall=(use=="all"), excludeall=useforce, opconvert=True, \ + token_class=Atom, eapi=eapi) except InvalidDependString as e: return [0, str(e)] |