summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-06-16 10:30:34 -0700
committerZac Medico <zmedico@gentoo.org>2010-06-16 10:30:34 -0700
commit707e125fe323f698430ea23bc8361f4d7290f4b7 (patch)
tree8699ab0780968c322ec1f567f90dd3e4b5c74ba6
parent6938064ec0b64c2896cb849a385910cc558c4032 (diff)
downloadportage-707e125fe323f698430ea23bc8361f4d7290f4b7.tar.gz
portage-707e125fe323f698430ea23bc8361f4d7290f4b7.tar.bz2
portage-707e125fe323f698430ea23bc8361f4d7290f4b7.zip
Add Atom._eval_qa_conditionals method, which unevaluated_atom support
that will be useful for repoman atom display.
-rw-r--r--pym/portage/dep/__init__.py13
-rw-r--r--pym/portage/dep/dep_check.py9
2 files changed, 13 insertions, 9 deletions
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: