commit:     8c250dbea673d5b3bd9f168186e566dd743ed891
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Fri Jan 23 21:10:41 2026 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Fri Jan 23 21:10:41 2026 +0000
URL:        https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=8c250dbe

libq/tree: fix gtree interactions

- pick up gtree as created by q -c
- enumerate ebuild entries within the parent gtree path

Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>

 libq/tree.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/libq/tree.c b/libq/tree.c
index aa96cef..00b4102 100644
--- a/libq/tree.c
+++ b/libq/tree.c
@@ -313,8 +313,8 @@ static int tree_foreach_pkg_gtree
       }
 
       /* we point to the ebuild, so it looks like md5-cache */
-      snprintf(buf, sizeof(buf), "ebuilds/%s/%s/%s.ebuild",
-               atom->CATEGORY, atom->PN, atom->PF);
+      snprintf(buf, sizeof(buf), "%s/ebuilds/%s/%s/%s.ebuild",
+               tree->path, atom->CATEGORY, atom->PN, atom->PF);
 
       pkg = xzalloc(sizeof(*pkg));
       pkg->name = xstrdup(atom->PN);
@@ -394,6 +394,8 @@ static int tree_foreach_pkg_gtree
 
   free(rbuf);
 
+  tree->cats_complete = true;
+
   return ret;
 }
 #endif
@@ -464,7 +466,7 @@ tree_ctx *tree_new
 #ifdef ENABLE_GTREE
       /* look for gtree, in which case we will ignore this tree in
        * favour of the gtree container */
-      snprintf(buf, sizeof(buf), "%s/metadata/metadata.gtree.tar", path);
+      snprintf(buf, sizeof(buf), "%s/metadata/repo.gtree.tar", path);
       VAL_CLEAR(st);
       if (fstatat(ret->portroot_fd, buf, &st, 0) == 0 &&
           S_ISREG(st.st_mode))

Reply via email to