diff options
author | Fabian Groffen <grobian@gentoo.org> | 2019-08-17 10:35:39 +0200 |
---|---|---|
committer | Fabian Groffen <grobian@gentoo.org> | 2019-08-17 10:35:39 +0200 |
commit | 74219ab70d2a5bcad327c3795f5fa9b881d433ad (patch) | |
tree | bc53fc4715a15309b336b92010d1dc1b8843b6d2 | |
parent | man/qlop: q -> g (diff) | |
download | portage-utils-74219ab7.tar.gz portage-utils-74219ab7.tar.bz2 portage-utils-74219ab7.zip |
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 <grobian@gentoo.org>
-rw-r--r-- | qlop.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -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; } |