From 74219ab70d2a5bcad327c3795f5fa9b881d433ad Mon Sep 17 00:00:00 2001 From: Fabian Groffen Date: Sat, 17 Aug 2019 10:35:39 +0200 Subject: 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 --- 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; } -- cgit v1.2.3-65-gdbad