commit: 4dc16c6cfcf2c3a4d2a439ee93999a4cd1864af2 Author: Joakim Tjernlund <joakim.tjernlund <AT> infinera <DOT> com> AuthorDate: Tue May 14 16:58:18 2019 +0000 Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org> CommitDate: Thu May 16 17:10:37 2019 +0000 URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=4dc16c6c
qmerge: ensure we respect SLOT while finding candidate package to unmerge Signed-off-by: Joakim Tjernlund <joakim.tjernlund <AT> infinera.com> Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org> qmerge.c | 10 +++++----- 1 file 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: