1 |
commit: 56e50dea636a760fb3f3ad3a53bd72daaa8c987d |
2 |
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Feb 27 21:15:56 2019 +0000 |
4 |
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Feb 27 21:15:56 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=56e50dea |
7 |
|
8 |
qlop: implement current package order number for --running |
9 |
|
10 |
Print extracted package order number to indicate some more progress. |
11 |
Example: |
12 |
|
13 |
./qlop -r |
14 |
2019-02-27T22:14:29 >>> dev-util/cmake... (1 of 1) ETA: 532 seconds |
15 |
|
16 |
Bug: https://bugs.gentoo.org/442406 |
17 |
Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org> |
18 |
|
19 |
qlop.c | 16 ++++++++++++++-- |
20 |
1 file changed, 14 insertions(+), 2 deletions(-) |
21 |
|
22 |
diff --git a/qlop.c b/qlop.c |
23 |
index 26b27b2..12c66a6 100644 |
24 |
--- a/qlop.c |
25 |
+++ b/qlop.c |
26 |
@@ -714,17 +714,29 @@ static int do_emerge_log( |
27 |
pkg = NULL; |
28 |
} |
29 |
|
30 |
+ /* extract (X of Y) from id, bug #442406 */ |
31 |
+ if ((p = strchr(pkgw->id, '(')) != NULL) { |
32 |
+ if ((q = strchr(p, ')')) != NULL) { |
33 |
+ q[1] = '\0'; |
34 |
+ p--; |
35 |
+ } else { |
36 |
+ p = NULL; |
37 |
+ } |
38 |
+ } |
39 |
+ |
40 |
if (flags->do_time) { |
41 |
- printf("%s >>> %s%s%s: %s... ETA: %s\n", |
42 |
+ printf("%s >>> %s%s%s: %s...%s ETA: %s\n", |
43 |
fmt_date(flags, pkgw->tbegin, 0), |
44 |
YELLOW, fmt_atom(flags, pkgw->atom), NORM, |
45 |
fmt_elapsedtime(flags, elapsed), |
46 |
+ p == NULL ? "" : p, |
47 |
maxtime == 0 ? "unknown" : |
48 |
fmt_elapsedtime(flags, maxtime - elapsed)); |
49 |
} else { |
50 |
- printf("%s >>> %s%s%s... ETA: %s\n", |
51 |
+ printf("%s >>> %s%s%s...%s ETA: %s\n", |
52 |
fmt_date(flags, pkgw->tbegin, 0), |
53 |
YELLOW, fmt_atom(flags, pkgw->atom), NORM, |
54 |
+ p == NULL ? "" : p, |
55 |
maxtime == 0 ? "unknown" : |
56 |
fmt_elapsedtime(flags, maxtime - elapsed)); |
57 |
} |