1 |
commit: 74219ab70d2a5bcad327c3795f5fa9b881d433ad |
2 |
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Aug 17 08:35:39 2019 +0000 |
4 |
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Aug 17 08:35:39 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=74219ab7 |
7 |
|
8 |
qlop: add ROOT support, bug #692224 |
9 |
|
10 |
Respect ROOT when set, to ease scripting of qlop interaction with |
11 |
chroots. |
12 |
|
13 |
Bug: https://bugs.gentoo.org/692224 |
14 |
Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org> |
15 |
|
16 |
qlop.c | 9 ++++++++- |
17 |
1 file changed, 8 insertions(+), 1 deletion(-) |
18 |
|
19 |
diff --git a/qlop.c b/qlop.c |
20 |
index fce0f69..7acb855 100644 |
21 |
--- a/qlop.c |
22 |
+++ b/qlop.c |
23 |
@@ -351,7 +351,14 @@ static int do_emerge_log( |
24 |
struct pkg_match *pkg; |
25 |
struct pkg_match *pkgw; |
26 |
|
27 |
- if ((fp = fopen(log, "r")) == NULL) { |
28 |
+ /* support relative path in here and now, when using ROOT, stick to |
29 |
+ * it, turning relative into a moot point */ |
30 |
+ if (portroot[1] == '\0') |
31 |
+ snprintf(buf, sizeof(buf), "%s", log); |
32 |
+ else |
33 |
+ snprintf(buf, sizeof(buf), "%s%s", portroot, log); |
34 |
+ if ((fp = fopen(buf, "r")) == NULL) |
35 |
+ { |
36 |
warnp("Could not open logfile '%s'", log); |
37 |
return 1; |
38 |
} |