diff options
author | Fabian Groffen <grobian@gentoo.org> | 2019-05-10 14:01:44 +0200 |
---|---|---|
committer | Fabian Groffen <grobian@gentoo.org> | 2019-05-10 14:01:44 +0200 |
commit | 5725e66ffa06bff4edf349e4afb834e66f671b69 (patch) | |
tree | 355027cb92be848f660998549520829371fefd09 | |
parent | tests/qmerge: DEFINED_PHASES of test package is empty (diff) | |
download | portage-utils-5725e66f.tar.gz portage-utils-5725e66f.tar.bz2 portage-utils-5725e66f.zip |
libq/tree: use tree_get_atom in tree_pkg_metadata
apart from that it is simpler, it also allows for reuse
Signed-off-by: Fabian Groffen <grobian@gentoo.org>
-rw-r--r-- | libq/tree.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/libq/tree.c b/libq/tree.c index bb7eefae..c8b4b5ee 100644 --- a/libq/tree.c +++ b/libq/tree.c @@ -821,7 +821,6 @@ tree_pkg_metadata(tree_pkg_ctx *pkg_ctx) size_t len; tree_metadata_xml *ret = NULL; struct elist *emailw = NULL; - char buf[_Q_PATH_MAX]; /* lame @$$ XML parsing, I don't want to pull in a real parser * library because we only retrieve one element for now: email @@ -832,13 +831,10 @@ tree_pkg_metadata(tree_pkg_ctx *pkg_ctx) if (ctx->cachetype == CACHE_EBUILD) { fd = openat(pkg_ctx->cat_ctx->fd, "metadata", O_RDONLY | O_CLOEXEC); } else { - depend_atom *atom; - snprintf(buf, sizeof(buf), "%s/%s", - pkg_ctx->cat_ctx->name, pkg_ctx->name); - atom = atom_explode(buf); + char buf[_Q_PATH_MAX]; + depend_atom *atom = tree_get_atom(pkg_ctx, false); snprintf(buf, sizeof(buf), "../../%s/%s/metadata.xml", atom->CATEGORY, atom->PN); - atom_implode(atom); fd = openat(ctx->tree_fd, buf, O_RDONLY | O_CLOEXEC); } |