aboutsummaryrefslogtreecommitdiff
path: root/qlop.c
diff options
context:
space:
mode:
authorFabian Groffen <grobian@gentoo.org>2020-10-04 13:29:43 +0200
committerFabian Groffen <grobian@gentoo.org>2020-10-04 13:29:43 +0200
commit83325e68514d4d55554bff9439b61c03f12d4d8b (patch)
tree60db4c0017db937ef95f2fe1b608d02e49e697b6 /qlop.c
parentqlop: ensure running merges are calculated of off package names #731122 (diff)
downloadportage-utils-83325e68514d4d55554bff9439b61c03f12d4d8b.tar.gz
portage-utils-83325e68514d4d55554bff9439b61c03f12d4d8b.tar.bz2
portage-utils-83325e68514d4d55554bff9439b61c03f12d4d8b.zip
qlop: deal with optionally compressed buildlogs in probe_proc
Bug: https://bugs.gentoo.org/745798 Signed-off-by: Fabian Groffen <grobian@gentoo.org>
Diffstat (limited to 'qlop.c')
-rw-r--r--qlop.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/qlop.c b/qlop.c
index f8248d4..316c9b0 100644
--- a/qlop.c
+++ b/qlop.c
@@ -1232,6 +1232,20 @@ static array_t *probe_proc(array_t *atoms)
continue;
rpath[rpathlen] = '\0';
+ /* in bug #745798, it seems Portage optionally
+ * compresses the buildlog -- to make matching below
+ * here easier, strip such compression extension off
+ * first here, leaving .log */
+ if ((size_t)rpathlen > sizeof(".log.gz") &&
+ (p = strrchr(rpath, '.')) != NULL &&
+ p - (sizeof(".log") - 1) > rpath &&
+ strncmp(p - (sizeof(".log") - 1), ".log",
+ sizeof(".log") - 1) == 0)
+ {
+ *p = '\0';
+ rpathlen -= rpath - p;
+ }
+
/* check if this points to a portage build:
* <somepath>/portage/<cat>/<pf>/temp/build.log
* <somepath>/<cat>:<pf>:YYYYMMDD-HHMMSS.log */