diff options
-rw-r--r-- | man/include/qlop.optdesc.yaml | 7 | ||||
-rw-r--r-- | man/qlop.1 | 7 | ||||
-rw-r--r-- | qlop.c | 47 |
3 files changed, 37 insertions, 24 deletions
diff --git a/man/include/qlop.optdesc.yaml b/man/include/qlop.optdesc.yaml index 19f56db..463a19d 100644 --- a/man/include/qlop.optdesc.yaml +++ b/man/include/qlop.optdesc.yaml @@ -50,5 +50,8 @@ running: | Print operations currently in progress. An ETA is calculated based on the average for the operation. If the elapsed exceeds the average, the ETA is calculated against the longest time observed for - the operation. If the elapsed time exceeds this too, or no previous - occurrences for the operation exist, \fIunknown\fR is printed. + the operation. The \fB-v\fR flag will display which mode is + currently used. If the elapsed time also exceeds the longest time + observed, or no previous occurrences for the operation exist, + \fIunknown\fR is printed. When combined with \fB-t\fR the + elapsed time is also displayed. @@ -72,8 +72,11 @@ Report time at which the operation finished (iso started). Print operations currently in progress. An ETA is calculated based on the average for the operation. If the elapsed exceeds the average, the ETA is calculated against the longest time observed for -the operation. If the elapsed time exceeds this too, or no previous -occurrences for the operation exist, \fIunknown\fR is printed. +the operation. The \fB-v\fR flag will display which mode is +currently used. If the elapsed time also exceeds the longest time +observed, or no previous occurrences for the operation exist, +\fIunknown\fR is printed. When combined with \fB-t\fR the +elapsed time is also displayed. .TP \fB\-d\fR \fI<arg>\fR, \fB\-\-date\fR \fI<arg>\fR Limit the selection of packages to the date given, or to the range @@ -773,14 +773,17 @@ static int do_emerge_log( array_for_each(merge_matches, i, pkgw) { size_t j; time_t maxtime = 0; + bool isMax = false; elapsed = tstart - pkgw->tbegin; pkg = NULL; array_for_each(merge_averages, j, pkg) { if (atom_compare(pkg->atom, pkgw->atom) == EQUAL) { maxtime = pkg->time / pkg->cnt; - if (elapsed >= maxtime) + if (elapsed >= maxtime) { maxtime = elapsed >= pkg->tbegin ? 0 : pkg->tbegin; + isMax = true; + } break; } pkg = NULL; @@ -797,52 +800,56 @@ static int do_emerge_log( } if (flags->do_time) { - printf("%s >>> %s: %s...%s ETA: %s\n", + printf("%s >>> %s: %s", fmt_date(flags, pkgw->tbegin, 0), atom_format(flags->fmt, pkgw->atom), - fmt_elapsedtime(flags, elapsed), - p == NULL ? "" : p, - maxtime == 0 ? "unknown" : - fmt_elapsedtime(flags, maxtime - elapsed)); + fmt_elapsedtime(flags, elapsed)); } else { - printf("%s >>> %s...%s ETA: %s\n", + printf("%s >>> %s", fmt_date(flags, pkgw->tbegin, 0), - atom_format(flags->fmt, pkgw->atom), - p == NULL ? "" : p, - maxtime == 0 ? "unknown" : - fmt_elapsedtime(flags, maxtime - elapsed)); + atom_format(flags->fmt, pkgw->atom)); } + printf("...%s ETA: %s%s\n", + p == NULL ? "" : p, + maxtime == 0 ? "unknown" : + fmt_elapsedtime(flags, maxtime - elapsed), + maxtime > 0 && verbose ? + isMax ? " (longest run)" : " (average run)" : ""); } array_for_each(unmerge_matches, i, pkgw) { size_t j; time_t maxtime = 0; + bool isMax = false; elapsed = tstart - pkgw->tbegin; pkg = NULL; array_for_each(unmerge_averages, j, pkg) { if (atom_compare(pkg->atom, pkgw->atom) == EQUAL) { maxtime = pkg->time / pkg->cnt; - if (elapsed >= maxtime) + if (elapsed >= maxtime) { maxtime = elapsed >= pkg->tbegin ? 0 : pkg->tbegin; + isMax = true; + } break; } pkg = NULL; } if (flags->do_time) { - printf("%s <<< %s: %s... ETA: %s\n", + printf("%s <<< %s: %s", fmt_date(flags, pkgw->tbegin, 0), atom_format(flags->fmt, pkgw->atom), - fmt_elapsedtime(flags, elapsed), - maxtime == 0 ? "unknown" : - fmt_elapsedtime(flags, maxtime - elapsed)); + fmt_elapsedtime(flags, elapsed)); } else { - printf("%s <<< %s... ETA: %s\n", + printf("%s <<< %s", fmt_date(flags, pkgw->tbegin, 0), - atom_format(flags->fmt, pkgw->atom), - maxtime == 0 ? "unknown" : - fmt_elapsedtime(flags, maxtime - elapsed)); + atom_format(flags->fmt, pkgw->atom)); } + printf("... ETA: %s%s\n", + maxtime == 0 ? "unknown" : + fmt_elapsedtime(flags, maxtime - elapsed), + maxtime > 0 && verbose ? + isMax ? " (longest run)" : " (average run)" : ""); } } else if (flags->do_average) { size_t total_merges = 0; |