Gentoo Archives: gentoo-commits

From: Fabian Groffen <grobian@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/portage-utils:master commit in: /
Date: Sun, 04 Oct 2020 11:31:34
Message-Id: 1601810983.83325e68514d4d55554bff9439b61c03f12d4d8b.grobian@gentoo
1 commit: 83325e68514d4d55554bff9439b61c03f12d4d8b
2 Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
3 AuthorDate: Sun Oct 4 11:29:43 2020 +0000
4 Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
5 CommitDate: Sun Oct 4 11:29:43 2020 +0000
6 URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=83325e68
7
8 qlop: deal with optionally compressed buildlogs in probe_proc
9
10 Bug: https://bugs.gentoo.org/745798
11 Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>
12
13 qlop.c | 14 ++++++++++++++
14 1 file changed, 14 insertions(+)
15
16 diff --git a/qlop.c b/qlop.c
17 index f8248d4..316c9b0 100644
18 --- a/qlop.c
19 +++ b/qlop.c
20 @@ -1232,6 +1232,20 @@ static array_t *probe_proc(array_t *atoms)
21 continue;
22 rpath[rpathlen] = '\0';
23
24 + /* in bug #745798, it seems Portage optionally
25 + * compresses the buildlog -- to make matching below
26 + * here easier, strip such compression extension off
27 + * first here, leaving .log */
28 + if ((size_t)rpathlen > sizeof(".log.gz") &&
29 + (p = strrchr(rpath, '.')) != NULL &&
30 + p - (sizeof(".log") - 1) > rpath &&
31 + strncmp(p - (sizeof(".log") - 1), ".log",
32 + sizeof(".log") - 1) == 0)
33 + {
34 + *p = '\0';
35 + rpathlen -= rpath - p;
36 + }
37 +
38 /* check if this points to a portage build:
39 * <somepath>/portage/<cat>/<pf>/temp/build.log
40 * <somepath>/<cat>:<pf>:YYYYMMDD-HHMMSS.log */