Gentoo Archives: gentoo-commits

From: Fabian Groffen <grobian@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/portage-utils:master commit in: /
Date: Sat, 25 Dec 2021 09:15:29
Message-Id: 1640423670.f1f616067dff37519ae017696f571bd90a99f55f.grobian@gentoo
1 commit: f1f616067dff37519ae017696f571bd90a99f55f
2 Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
3 AuthorDate: Sat Dec 25 09:14:30 2021 +0000
4 Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
5 CommitDate: Sat Dec 25 09:14:30 2021 +0000
6 URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=f1f61606
7
8 qlop: fix garbage when using -Ev
9
10 Regression since v0.92.
11
12 Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>
13
14 qlop.c | 30 +++++++++++++++++-------------
15 1 file changed, 17 insertions(+), 13 deletions(-)
16
17 diff --git a/qlop.c b/qlop.c
18 index 0e381bd..d9b0512 100644
19 --- a/qlop.c
20 +++ b/qlop.c
21 @@ -437,6 +437,7 @@ static int do_emerge_log(
22 size_t i;
23 size_t parallel_emerge = 0;
24 bool all_atoms = false;
25 + bool emerge_line;
26 char afmt[BUFSIZ];
27 struct pkg_match *pkg;
28 struct pkg_match *pkgw;
29 @@ -544,14 +545,21 @@ static int do_emerge_log(
30
31 tstart = atol(buf);
32
33 + emerge_line = false;
34 + if (((flags->do_running ||
35 + (flags->show_emerge && verbose)) &&
36 + strpfx(p, " *** emerge ") == 0) ||
37 + (flags->do_running &&
38 + (strpfx(p, " *** exiting ") == 0 ||
39 + strpfx(p, " *** terminating.") == 0)))
40 + {
41 + emerge_line = true;
42 + }
43 +
44 /* keeping track of parallel merges needs to be done before
45 * applying dates, for a subset of the log might show emerge
46 * finished without knowledge of another instance */
47 - if (flags->do_running &&
48 - (strpfx(p, " *** emerge ") == 0 ||
49 - strpfx(p, " *** exiting ") == 0 ||
50 - strpfx(p, " *** terminating.") == 0))
51 - {
52 + if (emerge_line && flags->do_running) {
53 if (p[7] == 'm') {
54 parallel_emerge++;
55 } else if (parallel_emerge > 0) {
56 @@ -593,8 +601,7 @@ static int do_emerge_log(
57 continue;
58
59 /* are we interested in this line? */
60 - if (flags->show_emerge && verbose && p[7] == 'm' /* emerge */)
61 - {
62 + if (emerge_line && flags->show_emerge && verbose) {
63 char shortopts[8]; /* must hold as many opts converted below */
64 int numopts = 0;
65
66 @@ -651,14 +658,11 @@ static int do_emerge_log(
67
68 if (strpfx(q, "--") == 0) {
69 printf(" %s%s%s", GREEN, q, NORM);
70 - } else if (strcmp(q, "@world") == 0 ||
71 - strcmp(q, "@system") == 0)
72 + } else if (q[0] == '@' ||
73 + strcmp(q, "world") == 0 ||
74 + strcmp(q, "system") == 0)
75 {
76 printf(" %s%s%s", YELLOW, q, NORM);
77 - } else if (strcmp(q, "world") == 0 ||
78 - strcmp(q, "system") == 0)
79 - {
80 - printf(" %s@%s%s", YELLOW, q, NORM);
81 } else {
82 /* this should be an atom */
83 atom = atom_explode(q);