From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 9BC7D138359 for ; Sun, 4 Oct 2020 11:31:34 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 0896DE092F; Sun, 4 Oct 2020 11:31:32 +0000 (UTC) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 6E3A6E092F for ; Sun, 4 Oct 2020 11:31:31 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 30A32335D40 for ; Sun, 4 Oct 2020 11:31:30 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 98CAC26 for ; Sun, 4 Oct 2020 11:31:28 +0000 (UTC) From: "Fabian Groffen" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Fabian Groffen" Message-ID: <1601810983.83325e68514d4d55554bff9439b61c03f12d4d8b.grobian@gentoo> Subject: [gentoo-commits] proj/portage-utils:master commit in: / X-VCS-Repository: proj/portage-utils X-VCS-Files: qlop.c X-VCS-Directories: / X-VCS-Committer: grobian X-VCS-Committer-Name: Fabian Groffen X-VCS-Revision: 83325e68514d4d55554bff9439b61c03f12d4d8b X-VCS-Branch: master Date: Sun, 4 Oct 2020 11:31:28 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: af5caf6a-237c-4fff-8475-779c0411ba0d X-Archives-Hash: 6de6e3244786a685b9ef0591a6197f1d commit: 83325e68514d4d55554bff9439b61c03f12d4d8b Author: Fabian Groffen gentoo org> AuthorDate: Sun Oct 4 11:29:43 2020 +0000 Commit: Fabian Groffen gentoo org> CommitDate: Sun Oct 4 11:29:43 2020 +0000 URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=83325e68 qlop: deal with optionally compressed buildlogs in probe_proc Bug: https://bugs.gentoo.org/745798 Signed-off-by: Fabian Groffen gentoo.org> qlop.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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: * /portage///temp/build.log * /::YYYYMMDD-HHMMSS.log */