paren_reduce: allow parens in atoms, for EAPI 4
authorZac Medico <zmedico@gentoo.org>
Mon, 7 Feb 2011 21:59:23 +0000 (13:59 -0800)
committerZac Medico <zmedico@gentoo.org>
Mon, 7 Feb 2011 21:59:23 +0000 (13:59 -0800)
This will fix bug #354003.

pym/portage/dep/__init__.py
pym/portage/tests/dep/test_paren_reduce.py

index cf83e0a0a4e93897632db0462695feee6a55db08..a8d05f1f72d3f9ebed1186ac5326c7ee01ca2cd7 100644 (file)
@@ -178,7 +178,7 @@ def paren_reduce(mystr):
                        need_bracket = True
                        stack[level].append(token)
                else:
-                       if need_bracket or "(" in token or ")" in token or "|" in token:
+                       if need_bracket:
                                raise InvalidDependString(
                                        _("malformed syntax: '%s'") % mystr)
 
index 6aac955c59a13280e3fc71d9f7e66ce3c271425a..a7bbf974bdd224a750938c8e969ce8ca265cbcd4 100644 (file)
@@ -30,6 +30,8 @@ class TestParenReduce(TestCase):
 
                        ( "|| ( ( A B ) C )", [ "||", [ ["A", "B"], "C"] ]),
                        ( "|| ( ( A B ) ( C ) )", [ "||", [ ["A", "B"], "C"] ]),
+                       # test USE dep defaults for bug #354003
+                       ( ">=dev-lang/php-5.2[pcre(+)]", [ ">=dev-lang/php-5.2[pcre(+)]" ]),
                )
                
                test_cases_xfail = (