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 38CBE138334 for ; Tue, 10 Sep 2019 18:25:17 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 55E3AE08C3; Tue, 10 Sep 2019 18:25:16 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (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 3EF51E08C3 for ; Tue, 10 Sep 2019 18:25:16 +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 3CAA934AFA4 for ; Tue, 10 Sep 2019 18:25:15 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id EC370780 for ; Tue, 10 Sep 2019 18:25:12 +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: <1568139478.c697c786bd4f24b0ec5c5aa1300fa9d8433062d6.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: c697c786bd4f24b0ec5c5aa1300fa9d8433062d6 X-VCS-Branch: master Date: Tue, 10 Sep 2019 18:25:12 +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: 0617e3c4-15b6-4b16-b352-70b56c36563e X-Archives-Hash: 02442aa6472000048ec77811ed037b7c commit: c697c786bd4f24b0ec5c5aa1300fa9d8433062d6 Author: Fabian Groffen gentoo org> AuthorDate: Tue Sep 10 18:17:58 2019 +0000 Commit: Fabian Groffen gentoo org> CommitDate: Tue Sep 10 18:17:58 2019 +0000 URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=c697c786 qlop: ignore empty runs for -l (lastrun) doing something like emerge -pv blah will generate a run where nothing is merged or unmerged, so ignore it. Signed-off-by: Fabian Groffen gentoo.org> qlop.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/qlop.c b/qlop.c index 7acb855..243c8b6 100644 --- a/qlop.c +++ b/qlop.c @@ -326,6 +326,7 @@ static int do_emerge_log( char *p; char *q; time_t tstart = LONG_MAX; + time_t tstart_emerge = 0; time_t last_merge = 0; time_t sync_start = 0; time_t sync_time = 0; @@ -376,12 +377,8 @@ static int do_emerge_log( continue; if (flags->show_lastmerge) { - if (strncmp(p, " *** emerge ", 13) == 0) { - last_merge = tstart; - array_for_each(atoms, i, atomw) - atom_implode(atomw); - xarrayfree_int(atoms); - } + if (strncmp(p, " *** emerge ", 13) == 0) + tstart_emerge = tstart; if (!all_atoms) continue; } @@ -417,6 +414,16 @@ static int do_emerge_log( atom->PVR = NULL; atom->PR_int = 0; + /* now we found a package, register this merge as a + * "valid" one, such that dummy emerge calls (e.g. + * emerge -pv foo) are ignored */ + if (last_merge != tstart_emerge) { + last_merge = tstart_emerge; + array_for_each(atoms, i, atomw) + atom_implode(atomw); + xarrayfree_int(atoms); + } + atomw = NULL; array_for_each(atoms, i, atomw) { if (atom_compare(atom, atomw) == EQUAL)