summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pym/portage/dep/__init__.py7
-rw-r--r--pym/portage/tests/dep/test_use_reduce.py11
2 files changed, 10 insertions, 8 deletions
diff --git a/pym/portage/dep/__init__.py b/pym/portage/dep/__init__.py
index b829e8045..4de9c8422 100644
--- a/pym/portage/dep/__init__.py
+++ b/pym/portage/dep/__init__.py
@@ -441,8 +441,11 @@ def use_reduce(depstr, uselist=[], masklist=[], matchall=False, excludeall=[], i
if opconvert and ends_in_any_of_dep(level):
#In opconvert mode, we have to move the operator from the level
#above into the current list.
- stack[level].pop()
- stack[level].append(["||"] + l)
+ if l[0] == '||':
+ stack[level].extend(l[1:])
+ else:
+ stack[level].pop()
+ stack[level].append(["||"] + l)
else:
special_append()
diff --git a/pym/portage/tests/dep/test_use_reduce.py b/pym/portage/tests/dep/test_use_reduce.py
index b9551db61..ac7b585be 100644
--- a/pym/portage/tests/dep/test_use_reduce.py
+++ b/pym/portage/tests/dep/test_use_reduce.py
@@ -342,12 +342,11 @@ class UseReduce(TestCase):
uselist = ["foo"],
opconvert = True,
expected_result = ["A", "B"]),
- # FIXME: Bug #340973: [['||', '||', 'A', 'B']] != ["||", "A", "B"]
- #UseReduceTestCase(
- # "|| ( foo? ( || ( A B ) ) )",
- # uselist = ["foo"],
- # opconvert = True,
- # expected_result = ["||", "A", "B"]),
+ UseReduceTestCase(
+ "|| ( foo? ( || ( A B ) ) )",
+ uselist = ["foo"],
+ opconvert = True,
+ expected_result = ["||", "A", "B"]),
#flat test
UseReduceTestCase(