diff options
author | Zac Medico <zmedico@gentoo.org> | 2011-04-11 15:30:13 -0700 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2011-04-11 15:30:13 -0700 |
commit | f6773621ee2b8aa617be8b8a9724e74bf65079b9 (patch) | |
tree | 4ba17a5663c82f6dad628bf5b023ad04177fd1a2 | |
parent | 1caaa48d23b1d39ee2e8e0632a08cceeba6a6b3a (diff) | |
download | portage-f6773621ee2b8aa617be8b8a9724e74bf65079b9.tar.gz portage-f6773621ee2b8aa617be8b8a9724e74bf65079b9.tar.bz2 portage-f6773621ee2b8aa617be8b8a9724e74bf65079b9.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) |