diff options
author | Fabian Groffen <grobian@gentoo.org> | 2019-09-10 20:17:58 +0200 |
---|---|---|
committer | Fabian Groffen <grobian@gentoo.org> | 2019-09-10 20:17:58 +0200 |
commit | c697c786bd4f24b0ec5c5aa1300fa9d8433062d6 (patch) | |
tree | 4dee6f53b932620c34854ea7701ec49cffc1cf3d | |
parent | qlop: add ROOT support, bug #692224 (diff) | |
download | portage-utils-c697c786.tar.gz portage-utils-c697c786.tar.bz2 portage-utils-c697c786.zip |
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 <grobian@gentoo.org>
-rw-r--r-- | qlop.c | 19 |
1 files changed, 13 insertions, 6 deletions
@@ -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) |