diff options
-rw-r--r-- | pym/portage/dep/__init__.py | 5 | ||||
-rw-r--r-- | pym/portage/tests/dep/test_use_reduce.py | 10 |
2 files changed, 8 insertions, 7 deletions
diff --git a/pym/portage/dep/__init__.py b/pym/portage/dep/__init__.py index d9f6a2155..010d88351 100644 --- a/pym/portage/dep/__init__.py +++ b/pym/portage/dep/__init__.py @@ -453,7 +453,10 @@ def use_reduce(depstr, uselist=[], masklist=[], matchall=False, excludeall=[], i else: stack[level].extend(l) else: - stack[level].append(l) + if opconvert and stack[level] and stack[level][-1] == '||': + stack[level][-1] = ['||'] + l + else: + stack[level].append(l) if l and not ignore: #The current list is not empty and we don't want to ignore it because diff --git a/pym/portage/tests/dep/test_use_reduce.py b/pym/portage/tests/dep/test_use_reduce.py index 162d7cdf2..32a9e50d5 100644 --- a/pym/portage/tests/dep/test_use_reduce.py +++ b/pym/portage/tests/dep/test_use_reduce.py @@ -304,12 +304,10 @@ class UseReduce(TestCase): "|| ( A B ) C", opconvert = True, expected_result = [['||', 'A', 'B'], 'C']), - - # ['A', '||', ['B', 'C']] != ['A', ['||', 'B', 'C']] - #UseReduceTestCase( - # "A || ( B C )", - # opconvert = True, - # expected_result = ['A', ['||', 'B', 'C']]), + UseReduceTestCase( + "A || ( B C )", + opconvert = True, + expected_result = ['A', ['||', 'B', 'C']]), UseReduceTestCase( "|| ( A )", |