commit:     de23ef44734dd428fd6de70d2d2d6d40b7768fff
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Sat Sep 21 20:16:46 2019 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Sat Sep 21 20:16:46 2019 +0000
URL:        https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=de23ef44

qlop: fix last merge timeframe detection

Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>

 qlop.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/qlop.c b/qlop.c
index 63a40a8..fcaf973 100644
--- a/qlop.c
+++ b/qlop.c
@@ -373,6 +373,8 @@ static int do_emerge_log(
 
        all_atoms = array_cnt(atoms) == 0;
        if (all_atoms || flags->show_lastmerge) {
+               atomset = create_set();
+
                /* assemble list of atoms */
                while (fgets(buf, sizeof(buf), fp) != NULL) {
                        if ((p = strchr(buf, ':')) == NULL)
@@ -422,9 +424,6 @@ static int do_emerge_log(
                                atom->PR_int = 0;
                                snprintf(afmt, sizeof(afmt), "%s/%s", 
atom->CATEGORY, atom->PN);
 
-                               if (atomset == NULL)
-                                       atomset = create_set();
-
                                /* now we found a package, register this merge 
as a
                                 * "valid" one, such that dummy emerge calls 
(e.g.
                                 * emerge -pv foo) are ignored */
@@ -435,7 +434,9 @@ static int do_emerge_log(
                                        array_for_each(&vals, i, atomw)
                                                atom_implode(atomw);
                                        xarrayfree_int(&vals);
+
                                        clear_set(atomset);
+                                       last_merge = tstart_emerge;
                                }
 
                                atomw = add_set_value(afmt, atom, atomset);

Reply via email to