From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 60413138359 for ; Thu, 16 Jul 2020 20:50:37 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 9F042E0828; Thu, 16 Jul 2020 20:50:36 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 8285BE0828 for ; Thu, 16 Jul 2020 20:50:36 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 0027934F18D for ; Thu, 16 Jul 2020 20:50:34 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 0D15B2B3 for ; Thu, 16 Jul 2020 20:50:06 +0000 (UTC) From: "Patrice Clement" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Patrice Clement" Message-ID: <1594932514.d9ac25402fa9ff918e1f1da4e3e0d97281e437c4.monsieurp@gentoo> Subject: [gentoo-commits] proj/java-config:master commit in: src/java_config_2/ X-VCS-Repository: proj/java-config X-VCS-Files: src/java_config_2/VersionManager.py X-VCS-Directories: src/java_config_2/ X-VCS-Committer: monsieurp X-VCS-Committer-Name: Patrice Clement X-VCS-Revision: d9ac25402fa9ff918e1f1da4e3e0d97281e437c4 X-VCS-Branch: master Date: Thu, 16 Jul 2020 20:50:06 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: e88b7f0e-3b4a-4d36-bd1e-83038d6e1912 X-Archives-Hash: 031572199aa3243cfc5158f1d82859f0 commit: d9ac25402fa9ff918e1f1da4e3e0d97281e437c4 Author: Patrice Clement gentoo org> AuthorDate: Thu Jul 16 20:46:02 2020 +0000 Commit: Patrice Clement gentoo org> CommitDate: Thu Jul 16 20:48:34 2020 +0000 URL: https://gitweb.gentoo.org/proj/java-config.git/commit/?id=d9ac2540 allow java-config to parse inverted conditions. ... aka exclamation marks. Patch courtesy of njsg on IRC. Signed-off-by: Patrice Clement gentoo.org> src/java_config_2/VersionManager.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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)