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 30A93138334 for ; Mon, 6 May 2019 16:05:01 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id ECFF7E0830; Mon, 6 May 2019 16:04:59 +0000 (UTC) Received: from smtp.gentoo.org (smtp.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 AC9B2E0830 for ; Mon, 6 May 2019 16:04:59 +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 54A7234394B for ; Mon, 6 May 2019 16:04:58 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 00A6758E for ; Mon, 6 May 2019 16:04: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: <1557158472.3253de392836e709cea75f4b3bf3b6e1053c955b.grobian@gentoo> Subject: [gentoo-commits] proj/portage-utils:master commit in: libq/ X-VCS-Repository: proj/portage-utils X-VCS-Files: libq/atom.c X-VCS-Directories: libq/ X-VCS-Committer: grobian X-VCS-Committer-Name: Fabian Groffen X-VCS-Revision: 3253de392836e709cea75f4b3bf3b6e1053c955b X-VCS-Branch: master Date: Mon, 6 May 2019 16:04: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: 65f2346a-6b9f-40d2-8251-b2be302235c0 X-Archives-Hash: d174199c669d3f505dcf6a67d28a7ea3 commit: 3253de392836e709cea75f4b3bf3b6e1053c955b Author: Fabian Groffen gentoo org> AuthorDate: Mon May 6 16:01:12 2019 +0000 Commit: Fabian Groffen gentoo org> CommitDate: Mon May 6 16:01:12 2019 +0000 URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=3253de39 libq/atom: ignore REPO like SLOT and CATEGORY iff not set on both sides Signed-off-by: Fabian Groffen gentoo.org> libq/atom.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/libq/atom.c b/libq/atom.c index 65c8a26..4df76a6 100644 --- a/libq/atom.c +++ b/libq/atom.c @@ -406,22 +406,21 @@ atom_compare(const depend_atom *a1, const depend_atom *a2) } /* check slot only when both sides have it */ - if (a1->SLOT && a2->SLOT && + if (a1->SLOT != NULL && a2->SLOT != NULL && a1->SLOT[0] != '\0' && a2->SLOT[0] != '\0' && (strcmp(a1->SLOT, a2->SLOT) != 0 || (a1->SUBSLOT != NULL && a2->SUBSLOT != NULL && strcmp(a1->SUBSLOT, a2->SUBSLOT) != 0))) return NOT_EQUAL; - /* check repo */ - if (a1->REPO || a2->REPO) { - if (!a1->REPO || !a2->REPO || strcmp(a1->REPO, a2->REPO)) - return NOT_EQUAL; - } + /* same for check repo */ + if (a1->REPO != NULL && a2->REPO != NULL && + a1->REPO[0] != '\0' && a2->REPO[0] != '\0' && + strcmp(a1->REPO, a2->REPO) != 0) + return NOT_EQUAL; /* Check category, iff both are specified. This way we can match - * atoms like "sys-devel/gcc" and "gcc". - */ + * atoms like "sys-devel/gcc" and "gcc". */ if (a1->CATEGORY && a2->CATEGORY) { if (strcmp(a1->CATEGORY, a2->CATEGORY)) return NOT_EQUAL;