1 |
commit: 7bbb7d1237d4fc6380c29059c7b0531d2adf0ee4 |
2 |
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Apr 29 15:03:18 2021 +0000 |
4 |
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Apr 29 15:03:18 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=7bbb7d12 |
7 |
|
8 |
libq/tree: return all pkgs found in Packages file, whether or not existant |
9 |
|
10 |
Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org> |
11 |
|
12 |
libq/tree.c | 15 +++++---------- |
13 |
1 file changed, 5 insertions(+), 10 deletions(-) |
14 |
|
15 |
diff --git a/libq/tree.c b/libq/tree.c |
16 |
index e692ee9..f66059b 100644 |
17 |
--- a/libq/tree.c |
18 |
+++ b/libq/tree.c |
19 |
@@ -1374,18 +1374,13 @@ tree_foreach_packages(tree_ctx *ctx, tree_pkg_cb callback, void *priv) |
20 |
cat->pkg_ctxs = NULL; |
21 |
tree_close_cat(cat); |
22 |
} |
23 |
- pkg.cat_ctx = cat = tree_open_cat(ctx, atom->CATEGORY); |
24 |
+ cat = tree_open_cat(ctx, atom->CATEGORY); |
25 |
if (cat == NULL) { |
26 |
- /* probably dir doesn't exist or something, skip |
27 |
- * this one */ |
28 |
- memset(&meta, 0, sizeof(meta)); |
29 |
- if (len > 0) { /* hop over \n */ |
30 |
- p++; |
31 |
- len--; |
32 |
- } |
33 |
- ctx->pkgs = c; |
34 |
- continue; |
35 |
+ /* probably dir doesn't exist or something, |
36 |
+ * generate a dummy cat */ |
37 |
+ cat = tree_open_cat(ctx, "."); |
38 |
} |
39 |
+ pkg.cat_ctx = cat; |
40 |
cat->pkg_ctxs = (tree_pkg_ctx **)atom; /* for name */ |
41 |
} |
42 |
pkgnamelen = snprintf(pkgname, sizeof(pkgname), |