1 |
commit: be7090b77585c7c4af0d46ca0cde805d370c6cc0 |
2 |
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu May 19 08:15:34 2022 +0000 |
4 |
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu May 19 08:15:34 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=be7090b7 |
7 |
|
8 |
libq/atom: make atom_compare consider BUILDID |
9 |
|
10 |
PR: https://github.com/gentoo/portage-utils/pull/16 |
11 |
Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org> |
12 |
|
13 |
libq/atom.c | 18 +++++++++++++----- |
14 |
1 file changed, 13 insertions(+), 5 deletions(-) |
15 |
|
16 |
diff --git a/libq/atom.c b/libq/atom.c |
17 |
index d1eb9a4..6f88698 100644 |
18 |
--- a/libq/atom.c |
19 |
+++ b/libq/atom.c |
20 |
@@ -954,16 +954,24 @@ atom_compare_flg(const depend_atom *data, const depend_atom *query, int flags) |
21 |
* 6: return A < B |
22 |
* 7: end if |
23 |
*/ |
24 |
- /* Make sure the -r# is the same. 3.7 */ |
25 |
+ /* first handle wildcarding cases */ |
26 |
if ((sfx_op == ATOM_OP_STAR && query->PR_int == 0) || |
27 |
pfx_op == ATOM_OP_PV_EQUAL || |
28 |
- flags & ATOM_COMP_NOREV || |
29 |
- data->PR_int == query->PR_int) |
30 |
+ flags & ATOM_COMP_NOREV) |
31 |
return _atom_compare_match(EQUAL, pfx_op); |
32 |
- else if (data->PR_int < query->PR_int) |
33 |
+ /* Make sure the -r# is the same. 3.7 */ |
34 |
+ if (data->PR_int < query->PR_int) |
35 |
+ return _atom_compare_match(OLDER, pfx_op); |
36 |
+ else if (data->PR_int > query->PR_int) |
37 |
+ return _atom_compare_match(NEWER, pfx_op); |
38 |
+ |
39 |
+ /* binpkg-multi-instance support */ |
40 |
+ if (data->BUILDID < query->BUILDID) |
41 |
return _atom_compare_match(OLDER, pfx_op); |
42 |
- else |
43 |
+ if (data->BUILDID > query->BUILDID) |
44 |
return _atom_compare_match(NEWER, pfx_op); |
45 |
+ |
46 |
+ return _atom_compare_match(EQUAL, pfx_op); |
47 |
} |
48 |
|
49 |
atom_equality |