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 022E71382C5 for ; Sat, 20 Feb 2021 12:07:03 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 418D8E081A; Sat, 20 Feb 2021 12:07:02 +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 09BA2E081A for ; Sat, 20 Feb 2021 12:07:01 +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 F002C33FE74 for ; Sat, 20 Feb 2021 12:07:00 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id A79EB4E1 for ; Sat, 20 Feb 2021 12:06:56 +0000 (UTC) From: "Fabian Groffen" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Fabian Groffen" Message-ID: <1613822672.a94a9e688526d776c808fee96e9a3b9e1733764c.grobian@gentoo> Subject: [gentoo-commits] proj/portage-utils:master commit in: libq/ X-VCS-Repository: proj/portage-utils X-VCS-Files: libq/tree.c libq/tree.h X-VCS-Directories: libq/ X-VCS-Committer: grobian X-VCS-Committer-Name: Fabian Groffen X-VCS-Revision: a94a9e688526d776c808fee96e9a3b9e1733764c X-VCS-Branch: master Date: Sat, 20 Feb 2021 12:06:56 +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: 3f614232-3ad1-40d6-9259-aac6bbcbfd3a X-Archives-Hash: 59c2164b23e648333b94492bb422ceff commit: a94a9e688526d776c808fee96e9a3b9e1733764c Author: Fabian Groffen gentoo org> AuthorDate: Sat Feb 20 12:04:32 2021 +0000 Commit: Fabian Groffen gentoo org> CommitDate: Sat Feb 20 12:04:32 2021 +0000 URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=a94a9e68 libq/tree: allow tree_match_atom to skip over acct-* categories Signed-off-by: Fabian Groffen gentoo.org> libq/tree.c | 4 ++++ libq/tree.h | 7 ++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/libq/tree.c b/libq/tree.c index df52171..9b06720 100644 --- a/libq/tree.c +++ b/libq/tree.c @@ -1736,6 +1736,10 @@ tree_match_atom(tree_ctx *ctx, depend_atom *query, int flags) if (!(flags & TREE_MATCH_VIRTUAL || \ strcmp(atom->CATEGORY, "virtual") != 0)) \ continue; \ + /* skip acct-* package as requested */ \ + if (!(flags & TREE_MATCH_ACCT || \ + strncmp(atom->CATEGORY, "acct-", sizeof("acct-") - 1) != 0)) \ + continue; \ /* see if this atom matches the query */ \ if (atom_compare(atom, query) == EQUAL) { \ tree_match_ctx *n; \ diff --git a/libq/tree.h b/libq/tree.h index 53fee67..5a12c92 100644 --- a/libq/tree.h +++ b/libq/tree.h @@ -158,9 +158,10 @@ tree_match_ctx *tree_match_atom(tree_ctx *t, depend_atom *q, int flags); #define TREE_MATCH_FULL_ATOM (1<<1) #define TREE_MATCH_METADATA (1<<2) #define TREE_MATCH_LATEST (1<<3) -#define TREE_MATCH_VIRTUAL (1<<4) -#define TREE_MATCH_FIRST (1<<5) -#define TREE_MATCH_DEFAULT TREE_MATCH_VIRTUAL +#define TREE_MATCH_FIRST (1<<4) +#define TREE_MATCH_VIRTUAL (1<<5) +#define TREE_MATCH_ACCT (1<<6) +#define TREE_MATCH_DEFAULT (TREE_MATCH_VIRTUAL | TREE_MATCH_ACCT) void tree_match_close(tree_match_ctx *t); #endif