summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2011-06-08 10:24:23 -0700
committerZac Medico <zmedico@gentoo.org>2011-06-08 10:24:23 -0700
commit706dd18b2a2936b0fe6a3bed7e1932eef54f0bd1 (patch)
treebf622135d78a175a9375add83219de2e14bfb4d3
parentc36d3ea4dec51781f0a1a3f45c3d2565e9ca2f95 (diff)
downloadportage-706dd18b2a2936b0fe6a3bed7e1932eef54f0bd1.tar.gz
portage-706dd18b2a2936b0fe6a3bed7e1932eef54f0bd1.tar.bz2
portage-706dd18b2a2936b0fe6a3bed7e1932eef54f0bd1.zip
extract_affecting_use: _get_useflag_re(eapi)
This is needed for EAPI="4-python" added in commit 586760f37fb9784327d8447182d49810662f4427.
-rw-r--r--pym/_emerge/depgraph.py6
-rw-r--r--pym/_emerge/resolver/circular_dependency.py3
-rw-r--r--pym/portage/dep/__init__.py4
-rw-r--r--pym/portage/tests/dep/testExtractAffectingUSE.py4
4 files changed, 10 insertions, 7 deletions
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 39179a455..b024b88e9 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -2618,7 +2618,8 @@ class depgraph(object):
for dep_str in "DEPEND", "RDEPEND", "PDEPEND":
try:
affecting_use.update(extract_affecting_use(
- node.metadata[dep_str], target_atom))
+ node.metadata[dep_str], target_atom,
+ eapi=node.metadata["EAPI"]))
except InvalidDependString:
if not node.installed:
raise
@@ -2662,7 +2663,8 @@ class depgraph(object):
affecting_use = set()
for dep_str in dep_strings:
- affecting_use.update(extract_affecting_use(dep_str, atom))
+ affecting_use.update(extract_affecting_use(dep_str, atom,
+ eapi=node.metadata["EAPI"]))
#Don't show flags as 'affecting' if the user can't change them,
affecting_use.difference_update(node.use.mask, \
diff --git a/pym/_emerge/resolver/circular_dependency.py b/pym/_emerge/resolver/circular_dependency.py
index e89fd51ed..08dd5c55f 100644
--- a/pym/_emerge/resolver/circular_dependency.py
+++ b/pym/_emerge/resolver/circular_dependency.py
@@ -112,7 +112,8 @@ class circular_dependency_handler(object):
parent_atom = atom.unevaluated_atom
break
- affecting_use = extract_affecting_use(dep, parent_atom)
+ affecting_use = extract_affecting_use(dep, parent_atom,
+ eapi=parent.metadata["EAPI"])
# Make sure we don't want to change a flag that is
# a) in use.mask or use.force
diff --git a/pym/portage/dep/__init__.py b/pym/portage/dep/__init__.py
index 9dfb12538..8332a05e4 100644
--- a/pym/portage/dep/__init__.py
+++ b/pym/portage/dep/__init__.py
@@ -2291,7 +2291,7 @@ def check_required_use(required_use, use, iuse_match):
tree._satisfied = False not in stack[0]
return tree
-def extract_affecting_use(mystr, atom):
+def extract_affecting_use(mystr, atom, eapi=None):
"""
Take a dep string and an atom and return the use flags
that decide if the given atom is in effect.
@@ -2308,7 +2308,7 @@ def extract_affecting_use(mystr, atom):
@rtype: Tuple of two lists of strings
@return: List of use flags that need to be enabled, List of use flag that need to be disabled
"""
- useflag_re = _get_useflag_re(None)
+ useflag_re = _get_useflag_re(eapi)
mysplit = mystr.split()
level = 0
stack = [[]]
diff --git a/pym/portage/tests/dep/testExtractAffectingUSE.py b/pym/portage/tests/dep/testExtractAffectingUSE.py
index 029cc6ee9..026a55274 100644
--- a/pym/portage/tests/dep/testExtractAffectingUSE.py
+++ b/pym/portage/tests/dep/testExtractAffectingUSE.py
@@ -63,7 +63,7 @@ class TestExtractAffectingUSE(TestCase):
for dep, atom, expected in test_cases:
expected = set(expected)
- result = extract_affecting_use(dep, atom)
+ result = extract_affecting_use(dep, atom, eapi="0")
fail_msg = "dep: " + dep + ", atom: " + atom + ", got: " + \
" ".join(sorted(result)) + ", expected: " + " ".join(sorted(expected))
self.assertEqual(result, expected, fail_msg)
@@ -72,4 +72,4 @@ class TestExtractAffectingUSE(TestCase):
fail_msg = "dep: " + dep + ", atom: " + atom + ", got: " + \
" ".join(sorted(result)) + ", expected: " + " ".join(sorted(expected))
self.assertRaisesMsg(fail_msg, \
- InvalidDependString, extract_affecting_use, dep, atom)
+ InvalidDependString, extract_affecting_use, dep, atom, eapi="0")