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 D71C5138334 for ; Fri, 26 Oct 2018 13:50:35 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id B057EE092D; Fri, 26 Oct 2018 13:50:34 +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 89DCEE092D for ; Fri, 26 Oct 2018 13:50:34 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (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 18435335CCD for ; Fri, 26 Oct 2018 13:50:32 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 678B544B for ; Fri, 26 Oct 2018 13:50:30 +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: <1540561745.d7cf583b6be5b29e5607fe0d90b8f566baf65f34.grobian@gentoo> Subject: [gentoo-commits] proj/portage-utils:master commit in: / X-VCS-Repository: proj/portage-utils X-VCS-Files: qatom.c qdepends.c X-VCS-Directories: / X-VCS-Committer: grobian X-VCS-Committer-Name: Fabian Groffen X-VCS-Revision: d7cf583b6be5b29e5607fe0d90b8f566baf65f34 X-VCS-Branch: master Date: Fri, 26 Oct 2018 13:50:30 +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-Archives-Salt: c89c9bd6-5317-4637-956d-9a54151ff525 X-Archives-Hash: 0309a06ec98f8f7248f2fe27bf1bd322 commit: d7cf583b6be5b29e5607fe0d90b8f566baf65f34 Author: Fabian Groffen gentoo org> AuthorDate: Fri Oct 26 13:49:05 2018 +0000 Commit: Fabian Groffen gentoo org> CommitDate: Fri Oct 26 13:49:05 2018 +0000 URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=d7cf583b depends: fix matching atoms for bug #668418 atoms in dependency strings can contain built-with-use declarations in bracket notation, so ensure we ignore that when feeding this into atom_explode. Bug: https://bugs.gentoo.org/668418 qatom.c | 3 ++- qdepends.c | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/qatom.c b/qatom.c index f079299..d7782ea 100644 --- a/qatom.c +++ b/qatom.c @@ -133,7 +133,8 @@ int qatom_main(int argc, char **argv) for (i = optind; i < argc; ++i) { switch (action) { case _COMPARE: - printf("%s %s %s\n", argv[i], booga[atom_compare_str(argv[i], argv[i+1])], argv[i+1]); + printf("%s %s %s\n", argv[i], + booga[atom_compare_str(argv[i], argv[i+1])], argv[i+1]); ++i; break; case _EXPLODE: diff --git a/qdepends.c b/qdepends.c index e89216b..3ff0ebb 100644 --- a/qdepends.c +++ b/qdepends.c @@ -555,10 +555,13 @@ qdepends_vdb_deep_cb(q_vdb_pkg_ctx *pkg_ctx, void *priv) if (ret != 0) break; - /* find the boundaries for matched atom */ + /* find the boundaries for matched atom, dep specifications can + * include built-with-use deps using [xxx] notation, so ensure + * we exclude that as part of the atom */ while (match.rm_so > 0 && !isspace(ptr[match.rm_so - 1])) match.rm_so--; - while (ptr[match.rm_eo] != '\0' && !isspace(ptr[match.rm_eo])) + while (ptr[match.rm_eo] != '\0' && ptr[match.rm_eo] != '[' && + !isspace(ptr[match.rm_eo])) match.rm_eo++; snprintf(qbuf, sizeof(qbuf), "%.*s",