aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabian Groffen <grobian@gentoo.org>2019-02-27 22:15:56 +0100
committerFabian Groffen <grobian@gentoo.org>2019-02-27 22:15:56 +0100
commit56e50dea636a760fb3f3ad3a53bd72daaa8c987d (patch)
treea6a620b5046b9e0e5ea3d15fd92511805485b591
parentqlop: rewrite from scratch (diff)
downloadportage-utils-56e50dea636a760fb3f3ad3a53bd72daaa8c987d.tar.gz
portage-utils-56e50dea636a760fb3f3ad3a53bd72daaa8c987d.tar.bz2
portage-utils-56e50dea636a760fb3f3ad3a53bd72daaa8c987d.zip
qlop: implement current package order number for --running
Print extracted package order number to indicate some more progress. Example: ./qlop -r 2019-02-27T22:14:29 >>> dev-util/cmake... (1 of 1) ETA: 532 seconds Bug: https://bugs.gentoo.org/442406 Signed-off-by: Fabian Groffen <grobian@gentoo.org>
-rw-r--r--qlop.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/qlop.c b/qlop.c
index 26b27b2..12c66a6 100644
--- a/qlop.c
+++ b/qlop.c
@@ -714,17 +714,29 @@ static int do_emerge_log(
pkg = NULL;
}
+ /* extract (X of Y) from id, bug #442406 */
+ if ((p = strchr(pkgw->id, '(')) != NULL) {
+ if ((q = strchr(p, ')')) != NULL) {
+ q[1] = '\0';
+ p--;
+ } else {
+ p = NULL;
+ }
+ }
+
if (flags->do_time) {
- printf("%s >>> %s%s%s: %s... ETA: %s\n",
+ printf("%s >>> %s%s%s: %s...%s ETA: %s\n",
fmt_date(flags, pkgw->tbegin, 0),
YELLOW, fmt_atom(flags, pkgw->atom), NORM,
fmt_elapsedtime(flags, elapsed),
+ p == NULL ? "" : p,
maxtime == 0 ? "unknown" :
fmt_elapsedtime(flags, maxtime - elapsed));
} else {
- printf("%s >>> %s%s%s... ETA: %s\n",
+ printf("%s >>> %s%s%s...%s ETA: %s\n",
fmt_date(flags, pkgw->tbegin, 0),
YELLOW, fmt_atom(flags, pkgw->atom), NORM,
+ p == NULL ? "" : p,
maxtime == 0 ? "unknown" :
fmt_elapsedtime(flags, maxtime - elapsed));
}