From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 11109138335 for ; Fri, 10 May 2019 15:33:05 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 5AE7DE0844; Fri, 10 May 2019 15:33:03 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 0356EE0826 for ; Fri, 10 May 2019 15:33:02 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id CF30C343F7C for ; Fri, 10 May 2019 15:33:01 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 9A5D2266 for ; Fri, 10 May 2019 15:32:59 +0000 (UTC) From: "Fabian Groffen" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Fabian Groffen" Message-ID: <1557489704.5725e66ffa06bff4edf349e4afb834e66f671b69.grobian@gentoo> Subject: [gentoo-commits] proj/portage-utils:master commit in: libq/ X-VCS-Repository: proj/portage-utils X-VCS-Files: libq/tree.c X-VCS-Directories: libq/ X-VCS-Committer: grobian X-VCS-Committer-Name: Fabian Groffen X-VCS-Revision: 5725e66ffa06bff4edf349e4afb834e66f671b69 X-VCS-Branch: master Date: Fri, 10 May 2019 15:32:59 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 351536fa-e048-45d8-9faf-c06ac3d4c159 X-Archives-Hash: 58048ad9d2e007a5f21ac43f842ea1ac commit: 5725e66ffa06bff4edf349e4afb834e66f671b69 Author: Fabian Groffen gentoo org> AuthorDate: Fri May 10 12:01:44 2019 +0000 Commit: Fabian Groffen gentoo org> CommitDate: Fri May 10 12:01:44 2019 +0000 URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=5725e66f 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 gentoo.org> libq/tree.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/libq/tree.c b/libq/tree.c index bb7eefa..c8b4b5e 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); }