From: Zac Medico Date: Sun, 10 Jun 2012 23:16:25 +0000 (-0700) Subject: use_reduce: use _eapi_attrs X-Git-Tag: v2.2.0_alpha111~62 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=daa04443e97f62555efd4a2a301103a27b7579b7;p=portage.git use_reduce: use _eapi_attrs --- diff --git a/pym/portage/dep/__init__.py b/pym/portage/dep/__init__.py index 6c2a3addd..4d0c4e288 100644 --- a/pym/portage/dep/__init__.py +++ b/pym/portage/dep/__init__.py @@ -37,7 +37,7 @@ portage.proxy.lazyimport.lazyimport(globals(), ) from portage import _unicode_decode -from portage.eapi import eapi_has_src_uri_arrows, _get_eapi_attrs +from portage.eapi import _get_eapi_attrs from portage.exception import InvalidAtom, InvalidData, InvalidDependString from portage.localization import _ from portage.versions import catpkgsplit, catsplit, \ @@ -438,6 +438,7 @@ def use_reduce(depstr, uselist=[], masklist=[], matchall=False, excludeall=[], i if matchall and matchnone: raise ValueError("portage.dep.use_reduce: 'matchall' and 'matchnone' are mutually exclusive") + eapi_attrs = _get_eapi_attrs(eapi) useflag_re = _get_useflag_re(eapi) def is_active(conditional): @@ -653,7 +654,7 @@ def use_reduce(depstr, uselist=[], masklist=[], matchall=False, excludeall=[], i if not is_src_uri: raise InvalidDependString( _("SRC_URI arrow are only allowed in SRC_URI: token %s") % (pos+1,)) - if eapi is None or not eapi_has_src_uri_arrows(eapi): + if not eapi_attrs.src_uri_arrows: raise InvalidDependString( _("SRC_URI arrow not allowed in EAPI %s: token %s") % (eapi, pos+1)) need_simple_token = True diff --git a/pym/portage/eapi.py b/pym/portage/eapi.py index 4dd02db02..ca8af9c5b 100644 --- a/pym/portage/eapi.py +++ b/pym/portage/eapi.py @@ -65,7 +65,7 @@ def eapi_allows_dots_in_use_flags(eapi): _eapi_attrs = collections.namedtuple('_eapi_attrs', 'dots_in_PN dots_in_use_flags repo_deps slot_deps ' - 'strong_blocks use_deps use_dep_defaults') + 'src_uri_arrows strong_blocks use_deps use_dep_defaults') _eapi_attrs_cache = {} @@ -83,6 +83,7 @@ def _get_eapi_attrs(eapi): dots_in_use_flags = (eapi is None or eapi_allows_dots_in_use_flags(eapi)), repo_deps = (eapi is None or eapi_has_repo_deps(eapi)), slot_deps = (eapi is None or eapi_has_slot_deps(eapi)), + src_uri_arrows = (eapi is None or eapi_has_src_uri_arrows(eapi)), strong_blocks = (eapi is None or eapi_has_strong_blocks(eapi)), use_deps = (eapi is None or eapi_has_use_deps(eapi)), use_dep_defaults = (eapi is None or eapi_has_use_dep_defaults(eapi))