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 823A7138334 for ; Mon, 29 Jul 2019 00:51:51 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A6FB3E0815; Mon, 29 Jul 2019 00:51:50 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (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 8B37BE0815 for ; Mon, 29 Jul 2019 00:51:50 +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 50D883480D4 for ; Mon, 29 Jul 2019 00:51:49 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id BED18731 for ; Mon, 29 Jul 2019 00:51:47 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <1564361423.8eeb4ee67da8ce2143f26f07545e666b3a4ad610.zmedico@gentoo> Subject: [gentoo-commits] proj/gentoolkit:master commit in: pym/gentoolkit/ X-VCS-Repository: proj/gentoolkit X-VCS-Files: pym/gentoolkit/flag.py X-VCS-Directories: pym/gentoolkit/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 8eeb4ee67da8ce2143f26f07545e666b3a4ad610 X-VCS-Branch: master Date: Mon, 29 Jul 2019 00:51:47 +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: 75442fdf-6d7e-41d3-990c-4e485bd9b51e X-Archives-Hash: cdc427a1811b9522d8d637e29b5d6864 commit: 8eeb4ee67da8ce2143f26f07545e666b3a4ad610 Author: Zac Medico gentoo org> AuthorDate: Mon Jul 29 00:48:07 2019 +0000 Commit: Zac Medico gentoo org> CommitDate: Mon Jul 29 00:50:23 2019 +0000 URL: https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=8eeb4ee6 filter_flags: handle default IUSE correctly with reduce_flag Fix comparisons to use the result of reduce_flag. Bug: https://bugs.gentoo.org/690786 Signed-off-by: Zac Medico gentoo.org> pym/gentoolkit/flag.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/pym/gentoolkit/flag.py b/pym/gentoolkit/flag.py index 90a931a..42e8196 100644 --- a/pym/gentoolkit/flag.py +++ b/pym/gentoolkit/flag.py @@ -116,22 +116,21 @@ def filter_flags(use, use_expand_hidden, usemasked, useforced): """ # clean out some environment flags, since they will most probably # be confusing for the user + use = dict((reduce_flag(flag), flag) for flag in use) for f in use_expand_hidden: f=f.lower() + "_" - for x in use: - if f in x: - use.remove(x) + for x in list(use): + if x.startswith(f): + del use[x] # clean out any arch's archlist = portage.settings["PORTAGE_ARCHLIST"].split() - for a in use[:]: - if a in archlist: - use.remove(a) + for a in archlist: + use.pop(a, None) # dbl check if any from usemasked or useforced are still there masked = usemasked + useforced - for a in use[:]: - if a in masked: - use.remove(a) - return use + for a in masked: + use.pop(a, None) + return list(use.values()) def get_all_cpv_use(cpv):