From 6b9995f6cf4d043cd8b79b56b4c021a375d11995 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Mon, 11 Apr 2011 15:30:13 -0700 Subject: [PATCH] extract_affecting_use: allow parens in atoms This fixes bug #363073 in which an InvalidDependString exception is erroneously triggered by atoms containing EAPI 4 USE dependency defaults. This case is very similar to bug #354003 which was fixed in commit 8735222b77e66850213e2aa6a7ea48e744ba0d4f. --- pym/portage/dep/__init__.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pym/portage/dep/__init__.py b/pym/portage/dep/__init__.py index a92b481d1..5911c8cd0 100644 --- a/pym/portage/dep/__init__.py +++ b/pym/portage/dep/__init__.py @@ -2310,6 +2310,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) mysplit = mystr.split() level = 0 stack = [[]] @@ -2322,9 +2323,10 @@ def extract_affecting_use(mystr, atom): else: flag = conditional[:-1] - if not flag: + if useflag_re.match(flag) is None: raise InvalidDependString( - _("malformed syntax: '%s'") % mystr) + _("invalid use flag '%s' in conditional '%s'") % \ + (flag, conditional)) return flag @@ -2397,7 +2399,7 @@ def extract_affecting_use(mystr, atom): 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) -- 2.26.2