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 AD3C3138334 for ; Sat, 17 Aug 2019 08:37:09 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id EE504E08A8; Sat, 17 Aug 2019 08:37:08 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (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 D37C1E08B0 for ; Sat, 17 Aug 2019 08:37:08 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (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 CE420349B9A for ; Sat, 17 Aug 2019 08:37:07 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 750A9762 for ; Sat, 17 Aug 2019 08:37:05 +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: <1566030939.74219ab70d2a5bcad327c3795f5fa9b881d433ad.grobian@gentoo> Subject: [gentoo-commits] proj/portage-utils:master commit in: / X-VCS-Repository: proj/portage-utils X-VCS-Files: qlop.c X-VCS-Directories: / X-VCS-Committer: grobian X-VCS-Committer-Name: Fabian Groffen X-VCS-Revision: 74219ab70d2a5bcad327c3795f5fa9b881d433ad X-VCS-Branch: master Date: Sat, 17 Aug 2019 08:37:05 +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: 17855d38-5ac5-49ce-b2af-3ba4833c85c1 X-Archives-Hash: 9fa58d52d76fce6b7d79accabad6944e commit: 74219ab70d2a5bcad327c3795f5fa9b881d433ad Author: Fabian Groffen gentoo org> AuthorDate: Sat Aug 17 08:35:39 2019 +0000 Commit: Fabian Groffen gentoo org> CommitDate: Sat Aug 17 08:35:39 2019 +0000 URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=74219ab7 qlop: add ROOT support, bug #692224 Respect ROOT when set, to ease scripting of qlop interaction with chroots. Bug: https://bugs.gentoo.org/692224 Signed-off-by: Fabian Groffen gentoo.org> qlop.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/qlop.c b/qlop.c index fce0f69..7acb855 100644 --- a/qlop.c +++ b/qlop.c @@ -351,7 +351,14 @@ static int do_emerge_log( struct pkg_match *pkg; struct pkg_match *pkgw; - if ((fp = fopen(log, "r")) == NULL) { + /* support relative path in here and now, when using ROOT, stick to + * it, turning relative into a moot point */ + if (portroot[1] == '\0') + snprintf(buf, sizeof(buf), "%s", log); + else + snprintf(buf, sizeof(buf), "%s%s", portroot, log); + if ((fp = fopen(buf, "r")) == NULL) + { warnp("Could not open logfile '%s'", log); return 1; }