From: Zac Medico Date: Thu, 14 Oct 2010 18:37:19 +0000 (-0700) Subject: Fix use_reduce() case from bug #340973. X-Git-Tag: v2.1.9.19~18 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=954de19e3a8330194e82e4faae7da7cf8ad7f7b5;p=portage.git Fix use_reduce() case from bug #340973. --- 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(