aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoakim Tjernlund <joakim.tjernlund@infinera.com>2019-05-14 18:58:18 +0200
committerFabian Groffen <grobian@gentoo.org>2019-05-16 19:10:37 +0200
commit4dc16c6cfcf2c3a4d2a439ee93999a4cd1864af2 (patch)
treef4cf714e6888b9830091b6fc3cce656e04187e70
parentqmerge: improve messages somewhat (diff)
downloadportage-utils-4dc16c6c.tar.gz
portage-utils-4dc16c6c.tar.bz2
portage-utils-4dc16c6c.zip
qmerge: ensure we respect SLOT while finding candidate package to unmerge
Signed-off-by: Joakim Tjernlund <joakim.tjernlund@infinera.com> Signed-off-by: Fabian Groffen <grobian@gentoo.org>
-rw-r--r--qmerge.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/qmerge.c b/qmerge.c
index 9ff7f28..a558701 100644
--- a/qmerge.c
+++ b/qmerge.c
@@ -1358,12 +1358,12 @@ pkg_merge(int level, const depend_atom *atom, const struct pkg_t *pkg)
pkg_ctx = tree_next_pkg(cat_ctx);
if (!pkg_ctx)
break;
-
- old_atom = atom_explode(pkg_ctx->name);
- /* This cast sucks, but we know for now the field isn't modified */
- old_atom->CATEGORY = (char *)cat_ctx->name;
+ old_atom = tree_get_atom(pkg_ctx, 1); /* retrieve SLOT */
+ if (!old_atom)
+ goto next_pkg;
+ old_atom->SUBSLOT = NULL; /* just match SLOT */
+ old_atom->REPO = NULL; /* REPO never matters, TODO atom_compare */
ret = atom_compare(atom, old_atom);
- atom_implode(old_atom);
switch (ret) {
case NEWER:
case OLDER: