From: Zac Medico Date: Wed, 16 Jun 2010 17:30:34 +0000 (-0700) Subject: Add Atom._eval_qa_conditionals method, which unevaluated_atom support X-Git-Tag: v2.2_rc68~547 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=707e125fe323f698430ea23bc8361f4d7290f4b7;p=portage.git Add Atom._eval_qa_conditionals method, which unevaluated_atom support that will be useful for repoman atom display. --- diff --git a/pym/portage/dep/__init__.py b/pym/portage/dep/__init__.py index 5de6de1ae..5fbe0dc3b 100644 --- a/pym/portage/dep/__init__.py +++ b/pym/portage/dep/__init__.py @@ -687,7 +687,7 @@ class Atom(_atom_base): if self.slot: atom += ":%s" % self.slot atom += str(self.use.evaluate_conditionals(use)) - return Atom(atom, self) + return Atom(atom, unevaluated_atom=self) def violated_conditionals(self, other_use, parent_use=None): """ @@ -706,7 +706,16 @@ class Atom(_atom_base): if self.slot: atom += ":%s" % self.slot atom += str(self.use.violated_conditionals(other_use, parent_use)) - return Atom(atom, self) + return Atom(atom, unevaluated_atom=self) + + def _eval_qa_conditionals(self, use_mask, use_force): + if not (self.use and self.use.conditional): + return self + atom = remove_slot(self) + if self.slot: + atom += ":%s" % self.slot + atom += str(self.use._eval_qa_conditionals(use_mask, use_force)) + return Atom(atom, unevaluated_atom=self) def __copy__(self): """Immutable, so returns self.""" diff --git a/pym/portage/dep/dep_check.py b/pym/portage/dep/dep_check.py index 73bcfabc0..f4a446118 100644 --- a/pym/portage/dep/dep_check.py +++ b/pym/portage/dep/dep_check.py @@ -76,13 +76,8 @@ def _expand_new_virtuals(mysplit, edebug, mydbapi, mysettings, myroot="/", raise ParseError( _("invalid atom: '%s'") % (x,)) - if repoman and x.use and x.use.conditional: - evaluated_atom = remove_slot(x) - if x.slot: - evaluated_atom += ":%s" % x.slot - evaluated_atom += str(x.use._eval_qa_conditionals( - use_mask, use_force)) - x = Atom(evaluated_atom) + 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: