Gentoo Archives: gentoo-commits

From: Fabian Groffen <grobian@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/portage-utils:master commit in: libq/
Date: Mon, 06 May 2019 16:05:01
Message-Id: 1557158472.3253de392836e709cea75f4b3bf3b6e1053c955b.grobian@gentoo
1 commit: 3253de392836e709cea75f4b3bf3b6e1053c955b
2 Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
3 AuthorDate: Mon May 6 16:01:12 2019 +0000
4 Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
5 CommitDate: Mon May 6 16:01:12 2019 +0000
6 URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=3253de39
7
8 libq/atom: ignore REPO like SLOT and CATEGORY iff not set on both sides
9
10 Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>
11
12 libq/atom.c | 15 +++++++--------
13 1 file changed, 7 insertions(+), 8 deletions(-)
14
15 diff --git a/libq/atom.c b/libq/atom.c
16 index 65c8a26..4df76a6 100644
17 --- a/libq/atom.c
18 +++ b/libq/atom.c
19 @@ -406,22 +406,21 @@ atom_compare(const depend_atom *a1, const depend_atom *a2)
20 }
21
22 /* check slot only when both sides have it */
23 - if (a1->SLOT && a2->SLOT &&
24 + if (a1->SLOT != NULL && a2->SLOT != NULL &&
25 a1->SLOT[0] != '\0' && a2->SLOT[0] != '\0' &&
26 (strcmp(a1->SLOT, a2->SLOT) != 0 ||
27 (a1->SUBSLOT != NULL && a2->SUBSLOT != NULL &&
28 strcmp(a1->SUBSLOT, a2->SUBSLOT) != 0)))
29 return NOT_EQUAL;
30
31 - /* check repo */
32 - if (a1->REPO || a2->REPO) {
33 - if (!a1->REPO || !a2->REPO || strcmp(a1->REPO, a2->REPO))
34 - return NOT_EQUAL;
35 - }
36 + /* same for check repo */
37 + if (a1->REPO != NULL && a2->REPO != NULL &&
38 + a1->REPO[0] != '\0' && a2->REPO[0] != '\0' &&
39 + strcmp(a1->REPO, a2->REPO) != 0)
40 + return NOT_EQUAL;
41
42 /* Check category, iff both are specified. This way we can match
43 - * atoms like "sys-devel/gcc" and "gcc".
44 - */
45 + * atoms like "sys-devel/gcc" and "gcc". */
46 if (a1->CATEGORY && a2->CATEGORY) {
47 if (strcmp(a1->CATEGORY, a2->CATEGORY))
48 return NOT_EQUAL;