commit:     2e83b5bd31ee989b79fbed7d2a9882f98c2771a5
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Tue Nov 20 14:24:33 2018 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Tue Nov 20 14:24:33 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=2e83b5bd

qdepends: match reverse deps without SLOT if not given

Continuation of bug #668418, atom_compare is strict about SLOT matches.

Bug: https://bugs.gentoo.org/668418
Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>

 qdepends.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/qdepends.c b/qdepends.c
index 3ff0ebb..e6b9bcf 100644
--- a/qdepends.c
+++ b/qdepends.c
@@ -1,9 +1,10 @@
 /*
- * Copyright 2005-2018 Gentoo Foundation
+ * Copyright 2005-2018 Gentoo Authors
  * Distributed under the terms of the GNU General Public License v2
  *
  * Copyright 2005-2010 Ned Ludd        - <[email protected]>
  * Copyright 2005-2014 Mike Frysinger  - <[email protected]>
+ * Copyright 2018-     Fabian Groffen  - <[email protected]>
  */
 
 #ifdef APPLET_qdepends
@@ -486,6 +487,7 @@ qdepends_vdb_deep_cb(q_vdb_pkg_ctx *pkg_ctx, void *priv)
        depend_atom *as;
        depend_atom *ac;
        char firstmatch = 0;
+       char *sslot;
 
        if (!q_vdb_pkg_eat(pkg_ctx, state->depend_file, &depend, &depend_len))
                return 0;
@@ -569,7 +571,13 @@ qdepends_vdb_deep_cb(q_vdb_pkg_ctx *pkg_ctx, void *priv)
                                        ptr + match.rm_so);
                ac = atom_explode(qbuf);
 
+               /* drop SLOT when not present in aq so we can match atoms
+                * regardless */
+               sslot = ac->SLOT;
+               if (aq->SLOT == NULL && ac->SLOT != NULL)
+                       ac->SLOT = NULL;
                ret = atom_compare(ac, aq);
+               ac->SLOT = sslot;
                if (ret != EQUAL) {
                        atom_implode(ac);
                        break;

Reply via email to