aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrice Clement <monsieurp@gentoo.org>2020-07-16 22:46:02 +0200
committerPatrice Clement <monsieurp@gentoo.org>2020-07-16 22:48:34 +0200
commitd9ac25402fa9ff918e1f1da4e3e0d97281e437c4 (patch)
tree4a37f3f9f44c8743c84fb87ba42a789ac0e9455a
parentcut release 2.3.1 (diff)
downloadjava-config-d9ac25402fa9ff918e1f1da4e3e0d97281e437c4.tar.gz
java-config-d9ac25402fa9ff918e1f1da4e3e0d97281e437c4.tar.bz2
java-config-d9ac25402fa9ff918e1f1da4e3e0d97281e437c4.zip
allow java-config to parse inverted conditions.
... aka exclamation marks. Patch courtesy of njsg on IRC. Signed-off-by: Patrice Clement <monsieurp@gentoo.org>
-rw-r--r--src/java_config_2/VersionManager.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/java_config_2/VersionManager.py b/src/java_config_2/VersionManager.py
index cb30e88..a876f02 100644
--- a/src/java_config_2/VersionManager.py
+++ b/src/java_config_2/VersionManager.py
@@ -110,7 +110,11 @@ class VersionManager:
for token in tokens:
if token[-1] == "?":
- if token[:-1] not in useflags:
+ if token.startswith("!"):
+ skip = token[1:-1] in useflags
+ else:
+ skip = token[:-1] not in useflags
+ if skip:
level = 0
while 1:
token = next(tokens)