diff options
author | Zac Medico <zmedico@gentoo.org> | 2011-04-11 15:30:13 -0700 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2011-04-13 00:50:25 -0700 |
commit | 6b9995f6cf4d043cd8b79b56b4c021a375d11995 (patch) | |
tree | f5a0f6f7609818b81ce7a90baa6a9ecdf3511a0d | |
parent | f7fbe17d589f5d404131e41cff55a68e4fb19df6 (diff) | |
download | portage-6b9995f6cf4d043cd8b79b56b4c021a375d11995.tar.gz portage-6b9995f6cf4d043cd8b79b56b4c021a375d11995.tar.bz2 portage-6b9995f6cf4d043cd8b79b56b4c021a375d11995.zip |
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.
-rw-r--r-- | pym/portage/dep/__init__.py | 8 |
1 files 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) |