1 |
commit: c697c786bd4f24b0ec5c5aa1300fa9d8433062d6 |
2 |
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Sep 10 18:17:58 2019 +0000 |
4 |
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Sep 10 18:17:58 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=c697c786 |
7 |
|
8 |
qlop: ignore empty runs for -l (lastrun) |
9 |
|
10 |
doing something like emerge -pv blah will generate a run where nothing |
11 |
is merged or unmerged, so ignore it. |
12 |
|
13 |
Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org> |
14 |
|
15 |
qlop.c | 19 +++++++++++++------ |
16 |
1 file changed, 13 insertions(+), 6 deletions(-) |
17 |
|
18 |
diff --git a/qlop.c b/qlop.c |
19 |
index 7acb855..243c8b6 100644 |
20 |
--- a/qlop.c |
21 |
+++ b/qlop.c |
22 |
@@ -326,6 +326,7 @@ static int do_emerge_log( |
23 |
char *p; |
24 |
char *q; |
25 |
time_t tstart = LONG_MAX; |
26 |
+ time_t tstart_emerge = 0; |
27 |
time_t last_merge = 0; |
28 |
time_t sync_start = 0; |
29 |
time_t sync_time = 0; |
30 |
@@ -376,12 +377,8 @@ static int do_emerge_log( |
31 |
continue; |
32 |
|
33 |
if (flags->show_lastmerge) { |
34 |
- if (strncmp(p, " *** emerge ", 13) == 0) { |
35 |
- last_merge = tstart; |
36 |
- array_for_each(atoms, i, atomw) |
37 |
- atom_implode(atomw); |
38 |
- xarrayfree_int(atoms); |
39 |
- } |
40 |
+ if (strncmp(p, " *** emerge ", 13) == 0) |
41 |
+ tstart_emerge = tstart; |
42 |
if (!all_atoms) |
43 |
continue; |
44 |
} |
45 |
@@ -417,6 +414,16 @@ static int do_emerge_log( |
46 |
atom->PVR = NULL; |
47 |
atom->PR_int = 0; |
48 |
|
49 |
+ /* now we found a package, register this merge as a |
50 |
+ * "valid" one, such that dummy emerge calls (e.g. |
51 |
+ * emerge -pv foo) are ignored */ |
52 |
+ if (last_merge != tstart_emerge) { |
53 |
+ last_merge = tstart_emerge; |
54 |
+ array_for_each(atoms, i, atomw) |
55 |
+ atom_implode(atomw); |
56 |
+ xarrayfree_int(atoms); |
57 |
+ } |
58 |
+ |
59 |
atomw = NULL; |
60 |
array_for_each(atoms, i, atomw) { |
61 |
if (atom_compare(atom, atomw) == EQUAL) |