From ada7f4f6f009d2eab5d98e5e6f284a80738bb55b Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Thu, 26 Aug 2010 16:49:20 -0700 Subject: Bug #334365 - Make dep_check() less strict with respect to EAPI constraints for installed packages since previous validation will have already marked them as invalid when necessary and now we're more interested in evaluating dependencies so that things like --depclean work as well as possible in spite of partial invalidity. Also, remove obsolete EAPI atom validation code from _expand_new_virtuals() since it's handled by use_reduce() and the Atom constructor now. --- pym/portage/dep/dep_check.py | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) (limited to 'pym/portage/dep/dep_check.py') diff --git a/pym/portage/dep/dep_check.py b/pym/portage/dep/dep_check.py index bfbdc608e..07a38d0c5 100644 --- a/pym/portage/dep/dep_check.py +++ b/pym/portage/dep/dep_check.py @@ -62,21 +62,6 @@ def _expand_new_virtuals(mysplit, edebug, mydbapi, mysettings, myroot="/", 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) @@ -537,12 +522,22 @@ def dep_check(depstring, mydbapi, mysettings, use="yes", mode=None, myuse=None, mytrees = trees[myroot] parent = mytrees.get("parent") virt_parent = mytrees.get("virt_parent") + current_parent = None eapi = None if parent is not None: if virt_parent is not None: - eapi = virt_parent[0].metadata['EAPI'] + current_parent = virt_parent[0] else: - eapi = parent.metadata["EAPI"] + current_parent = parent + + if current_parent is not None: + # Don't pass the eapi argument to use_reduce() for installed packages + # since previous validation will have already marked them as invalid + # when necessary and now we're more interested in evaluating + # dependencies so that things like --depclean work as well as possible + # in spite of partial invalidity. + if not current_parent.installed: + eapi = current_parent.metadata['EAPI'] try: mysplit = use_reduce(depstring, uselist=myusesplit, masklist=mymasks, \ -- cgit v1.2.3-1-g7c22