From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 3A03B138334 for ; Mon, 13 May 2019 13:39:28 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 419A1E0896; Mon, 13 May 2019 13:39:27 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 121AFE0896 for ; Mon, 13 May 2019 13:39:26 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id A73CA3441EE for ; Mon, 13 May 2019 13:39:25 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 562185DE for ; Mon, 13 May 2019 13:39:24 +0000 (UTC) From: "Fabian Groffen" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Fabian Groffen" Message-ID: <1557754651.966de456d8af3b5102950e608a771f776efdd014.grobian@gentoo> Subject: [gentoo-commits] proj/portage-utils:master commit in: man/, /, man/include/ X-VCS-Repository: proj/portage-utils X-VCS-Files: TODO.md man/include/qlop.optdesc.yaml man/qlop.1 qlop.c X-VCS-Directories: man/include/ / man/ X-VCS-Committer: grobian X-VCS-Committer-Name: Fabian Groffen X-VCS-Revision: 966de456d8af3b5102950e608a771f776efdd014 X-VCS-Branch: master Date: Mon, 13 May 2019 13:39:24 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 1f33213d-d469-490f-a366-6b6ca9310db1 X-Archives-Hash: b8af363135c069a454c53a9293dffa25 commit: 966de456d8af3b5102950e608a771f776efdd014 Author: Fabian Groffen gentoo org> AuthorDate: Mon May 13 13:37:31 2019 +0000 Commit: Fabian Groffen gentoo 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 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),