public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Fabian Groffen" <grobian@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage-utils:master commit in: man/, /, man/include/
Date: Mon, 13 May 2019 13:39:24 +0000 (UTC)	[thread overview]
Message-ID: <1557754651.966de456d8af3b5102950e608a771f776efdd014.grobian@gentoo> (raw)

commit:     966de456d8af3b5102950e608a771f776efdd014
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Mon May 13 13:37:31 2019 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Mon May 13 13:37:31 2019 +0000
URL:        https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=966de456

qlop: support -q to omit timestamps

Allow -q to suppress timestamps and operation markers (<<<, >>> and ***)
such that one can generate a flat list of atoms. A bit awkward, but
combining -q *and* -v will result in atoms with PF (iso PN).

Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>

 TODO.md                       |  5 -----
 man/include/qlop.optdesc.yaml |  4 ++++
 man/qlop.1                    |  2 +-
 qlop.c                        | 24 +++++++++++++++++++++---
 4 files changed, 26 insertions(+), 9 deletions(-)

diff --git a/TODO.md b/TODO.md
index f410f54..ccff6e0 100644
--- a/TODO.md
+++ b/TODO.md
@@ -75,11 +75,6 @@
 
 - make it use standard xarray instead of its own buf\_list
 
-# qlop
-
-- have a mode that doesn't print timestamp (to get just atoms, -v should
-  work)
-
 # qlist
 - have -F for use with -I so one can do things like print SLOT for
   package X

diff --git a/man/include/qlop.optdesc.yaml b/man/include/qlop.optdesc.yaml
index 677c4d2..19f56db 100644
--- a/man/include/qlop.optdesc.yaml
+++ b/man/include/qlop.optdesc.yaml
@@ -42,6 +42,10 @@ current: |
     in order to detect running merges.
 verbose: |
     Print package versions and revisions (PF) instead of package (PN).
+quiet:
+    Omit printing of timestamps and operation symbols, can be used to
+    generate a flat list of atoms, e.g.\ \fB-qml\fR to print the package
+    names merged in the last emerge operation.
 running: |
     Print operations currently in progress.  An ETA is calculated based
     on the average for the operation.  If the elapsed exceeds the

diff --git a/man/qlop.1 b/man/qlop.1
index ae40fa7..6303eee 100644
--- a/man/qlop.1
+++ b/man/qlop.1
@@ -116,7 +116,7 @@ Set the ROOT env var.
 Print package versions and revisions (PF) instead of package (PN).
 .TP
 \fB\-q\fR, \fB\-\-quiet\fR
-Tighter output; suppress warnings.
+Omit printing of timestamps and operation symbols, can be used to generate a flat list of atoms, e.g.\ \fB-qml\fR to print the package names merged in the last emerge operation.
 .TP
 \fB\-C\fR, \fB\-\-nocolor\fR
 Don't output color.

diff --git a/qlop.c b/qlop.c
index 5217638..11bbbc3 100644
--- a/qlop.c
+++ b/qlop.c
@@ -506,7 +506,13 @@ static int do_emerge_log(
 					sync_start = 0;  /* reset */
 					continue;
 				}
-				if (flags->do_time) {
+				if (quiet) {
+					printf("%s%s%s%s%s\n",
+							GREEN, p, NORM,
+							flags->do_time ? ": " : "",
+							flags->do_time ?
+								fmt_elapsedtime(flags, elapsed) : "");
+				} else if (flags->do_time) {
 					printf("%s *** %s%s%s: %s\n",
 							fmt_date(flags, sync_start, tstart),
 							GREEN, p, NORM,
@@ -607,7 +613,13 @@ static int do_emerge_log(
 						}
 						break;
 					}
-					if (flags->do_time) {
+					if (quiet && !flags->do_average) {
+						printf("%s%s%s\n",
+								atom_format(afmt, pkgw->atom, 0),
+								flags->do_time ? ": " : "",
+								flags->do_time ?
+									fmt_elapsedtime(flags, elapsed) : "");
+					} else if (flags->do_time) {
 						printf("%s >>> %s: %s\n",
 								fmt_date(flags, pkgw->tbegin, tstart),
 								atom_format(afmt, pkgw->atom, 0),
@@ -706,7 +718,13 @@ static int do_emerge_log(
 						}
 						break;
 					}
-					if (flags->do_time) {
+					if (quiet && !flags->do_average) {
+						printf("%s%s%s\n",
+								atom_format(afmt, pkgw->atom, 0),
+								flags->do_time ? ": " : "",
+								flags->do_time ?
+									fmt_elapsedtime(flags, elapsed) : "");
+					} else if (flags->do_time) {
 						printf("%s <<< %s: %s\n",
 								fmt_date(flags, pkgw->tbegin, tstart),
 								atom_format(afmt, pkgw->atom, 0),


             reply	other threads:[~2019-05-13 13:39 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-13 13:39 Fabian Groffen [this message]
  -- strict thread matches above, loose matches on Subject: below --
2023-01-30 14:14 [gentoo-commits] proj/portage-utils:master commit in: man/, /, man/include/ Fabian Groffen
2019-12-27 19:16 Fabian Groffen
2019-07-18 18:36 Fabian Groffen
2019-06-09  9:53 Fabian Groffen
2019-05-17 14:35 Fabian Groffen
2019-04-28  7:58 Fabian Groffen
2019-03-29 16:35 Fabian Groffen
2019-03-07 18:20 Fabian Groffen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1557754651.966de456d8af3b5102950e608a771f776efdd014.grobian@gentoo \
    --to=grobian@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox