Gentoo Archives: gentoo-commits

From: Fabian Groffen <grobian@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/portage-utils:master commit in: /
Date: Mon, 06 May 2019 16:05:01
Message-Id: 1557158599.96a398aa2a3f63af154b3af12da5d5103b37b613.grobian@gentoo
1 commit: 96a398aa2a3f63af154b3af12da5d5103b37b613
2 Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
3 AuthorDate: Mon May 6 16:03:19 2019 +0000
4 Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
5 CommitDate: Mon May 6 16:03:19 2019 +0000
6 URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=96a398aa
7
8 qdepends: use q_vdb_get_atom instead of constructing manually
9
10 Using vdb's atom, atom_format() will be able to print SLOT and REPO.
11
12 Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>
13
14 qdepends.c | 11 ++---------
15 1 file changed, 2 insertions(+), 9 deletions(-)
16
17 diff --git a/qdepends.c b/qdepends.c
18 index 9cfe095..7bb8818 100644
19 --- a/qdepends.c
20 +++ b/qdepends.c
21 @@ -95,8 +95,6 @@ static int
22 qdepends_results_cb(q_vdb_pkg_ctx *pkg_ctx, void *priv)
23 {
24 struct qdepends_opt_state *state = priv;
25 - const char *catname = pkg_ctx->cat_ctx->name;
26 - const char *pkgname = pkg_ctx->name;
27 depend_atom *atom;
28 depend_atom *datom;
29 depend_atom *fatom;
30 @@ -118,8 +116,7 @@ qdepends_results_cb(q_vdb_pkg_ctx *pkg_ctx, void *priv)
31 * *DEPEND alters the search somewhat and affects results printing.
32 */
33
34 - snprintf(buf, sizeof(buf), "%s/%s", catname, pkgname);
35 - datom = atom_explode(buf);
36 + datom = q_vdb_get_atom(pkg_ctx);
37 if (datom == NULL)
38 return ret;
39
40 @@ -133,10 +130,8 @@ qdepends_results_cb(q_vdb_pkg_ctx *pkg_ctx, void *priv)
41 }
42
43 /* nothing matched */
44 - if (atom != NULL) {
45 - atom_implode(datom);
46 + if (atom != NULL)
47 return ret;
48 - }
49
50 ret = 1;
51
52 @@ -237,8 +232,6 @@ qdepends_results_cb(q_vdb_pkg_ctx *pkg_ctx, void *priv)
53 }
54 }
55
56 - atom_implode(datom);
57 -
58 return ret;
59 }