aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabian Groffen <grobian@gentoo.org>2019-08-17 10:35:39 +0200
committerFabian Groffen <grobian@gentoo.org>2019-08-17 10:35:39 +0200
commit74219ab70d2a5bcad327c3795f5fa9b881d433ad (patch)
treebc53fc4715a15309b336b92010d1dc1b8843b6d2
parentman/qlop: q -> g (diff)
downloadportage-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.c9
1 files changed, 8 insertions, 1 deletions
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;
}