From: "Fabian Groffen" <grobian@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage-utils:master commit in: man/include/, man/, /
Date: Sat, 30 Jan 2021 10:37:56 +0000 (UTC) [thread overview]
Message-ID: <1612002955.3ef45fa46d5a45a3f19806cf62aba8532b4e401f.grobian@gentoo> (raw)
commit: 3ef45fa46d5a45a3f19806cf62aba8532b4e401f
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Sat Jan 30 10:35:55 2021 +0000
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Sat Jan 30 10:35:55 2021 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=3ef45fa4
qlop: support -d 0 (or @0)
Allow setting the zero date, to basically have a quick way to list
everything, useful with -E, e.g. -Evd 0 to show the entire emerge
history.
Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>
man/include/qlop.desc | 2 +-
man/include/qlop.optdesc.yaml | 2 +-
man/qlop.1 | 6 +++---
qlop.c | 25 +++++++++++++++++--------
4 files changed, 22 insertions(+), 13 deletions(-)
diff --git a/man/include/qlop.desc b/man/include/qlop.desc
index e39f689..0f7fa7c 100644
--- a/man/include/qlop.desc
+++ b/man/include/qlop.desc
@@ -19,7 +19,7 @@ in further on specific packages.
.P
After version \fB0.74\fR of portage-utils, \fIqlop\fR was changed
considerably to be more consistent and more advanced. Most notably,
-this has changed default date output and commmand line flags. Instead
+this has changed default date output and command line flags. Instead
of reporting the time the operation finished, \fIqlop\fR now reports the
time the operation started. The behaviour of the old \fB-g\fR flag is
best matched by the new \fB-t\fR flag. Similar, the old \fB-t\fR flag
diff --git a/man/include/qlop.optdesc.yaml b/man/include/qlop.optdesc.yaml
index c6e0833..fc268d6 100644
--- a/man/include/qlop.optdesc.yaml
+++ b/man/include/qlop.optdesc.yaml
@@ -16,7 +16,7 @@ date: |
.IP YYYY-MM-DDThh:mm:ss
As before, but hours, minutes and seconds added. This is the same
format qlop prints for timestamps.
- .IP SSSSSSSSS
+ .IP "SSSSSSSSS or @SSSSSSSSS"
Seconds since 1970-01-01 00:00:00 +0000 (UTC), the UNIX epoch.
.IP FORMAT|DATE
Use \fIFORMAT\fR as input for \fBstrptime\fR(3) to parse \fIDATE\fR.
diff --git a/man/qlop.1 b/man/qlop.1
index 5aafa82..a175332 100644
--- a/man/qlop.1
+++ b/man/qlop.1
@@ -1,5 +1,5 @@
.\" generated by mkman.py, please do NOT edit!
-.TH qlop "1" "Nov 2020" "Gentoo Foundation" "qlop"
+.TH qlop "1" "Jan 2021" "Gentoo Foundation" "qlop"
.SH NAME
qlop \- emerge log analyzer
.SH SYNOPSIS
@@ -27,7 +27,7 @@ in further on specific packages.
.P
After version \fB0.74\fR of portage-utils, \fIqlop\fR was changed
considerably to be more consistent and more advanced. Most notably,
-this has changed default date output and commmand line flags. Instead
+this has changed default date output and command line flags. Instead
of reporting the time the operation finished, \fIqlop\fR now reports the
time the operation started. The behaviour of the old \fB-g\fR flag is
best matched by the new \fB-t\fR flag. Similar, the old \fB-t\fR flag
@@ -110,7 +110,7 @@ year, followed by month and day of month.
.IP YYYY-MM-DDThh:mm:ss
As before, but hours, minutes and seconds added. This is the same
format qlop prints for timestamps.
-.IP SSSSSSSSS
+.IP "SSSSSSSSS or @SSSSSSSSS"
Seconds since 1970-01-01 00:00:00 +0000 (UTC), the UNIX epoch.
.IP FORMAT|DATE
Use \fIFORMAT\fR as input for \fBstrptime\fR(3) to parse \fIDATE\fR.
diff --git a/qlop.c b/qlop.c
index 5045d17..2d01689 100644
--- a/qlop.c
+++ b/qlop.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2005-2020 Gentoo Foundation
+ * Copyright 2005-2021 Gentoo Foundation
* Distributed under the terms of the GNU General Public License v2
*
* Copyright 2005-2010 Ned Ludd - <solar@gentoo.org>
@@ -116,14 +116,17 @@ parse_date(const char *sdate, time_t *t)
} else {
/* Handle automatic formats:
* - "12315128" -> %s
+ * - "@12315128" -> %s
* - "2015-12-24" -> %Y-%m-%d
* - "2019-03-28T13:52:31" -> %Y-%m-%dT%H:%M:%s"
* - human readable format (see below)
*/
- size_t len = strspn(sdate, "0123456789-:T");
+ size_t len = strspn(sdate, "0123456789-:T@");
if (sdate[len] == '\0') {
const char *fmt;
- if (strchr(sdate, '-') == NULL) {
+ if (sdate[0] == '@') {
+ fmt = "@%s";
+ } else if (strchr(sdate, '-') == NULL) {
fmt = "%s";
} else if ((s = strchr(sdate, 'T')) == NULL) {
fmt = "%Y-%m-%d";
@@ -1394,8 +1397,8 @@ int qlop_main(int argc, char **argv)
DECLARE_ARRAY(atoms);
int runningmode = 0;
- start_time = 0;
- end_time = LONG_MAX;
+ start_time = -1;
+ end_time = -1;
m.do_time = 0;
m.do_merge = 0;
m.do_unmerge = 0;
@@ -1435,10 +1438,10 @@ int qlop_main(int argc, char **argv)
case 'l': m.show_lastmerge = 1; break;
case 'F': m.fmt = optarg; break;
case 'd':
- if (start_time == 0) {
+ if (start_time == -1) {
if (!parse_date(optarg, &start_time))
err("invalid date: %s", optarg);
- } else if (end_time == LONG_MAX) {
+ } else if (end_time == -1) {
if (!parse_date(optarg, &end_time))
err("invalid date: %s", optarg);
} else
@@ -1539,7 +1542,7 @@ int qlop_main(int argc, char **argv)
}
/* handle -l / -d conflict */
- if (start_time != 0 && m.show_lastmerge) {
+ if (start_time != -1 && m.show_lastmerge) {
if (!m.show_emerge)
warn("-l and -d cannot be used together, dropping -l");
m.show_lastmerge = 0;
@@ -1563,6 +1566,12 @@ int qlop_main(int argc, char **argv)
m.fmt = "%[CATEGORY]%[PN]";
}
+ /* adjust time ranges when unset */
+ if (start_time == -1)
+ start_time = 0;
+ if (end_time == -1)
+ end_time = LONG_MAX;
+
if (m.do_running) {
array_t *new_atoms = NULL;
next reply other threads:[~2021-01-30 10:38 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-30 10:37 Fabian Groffen [this message]
-- strict thread matches above, loose matches on Subject: below --
2020-08-14 10:09 [gentoo-commits] proj/portage-utils:master commit in: man/include/, man/, / Fabian Groffen
2019-06-12 9:13 Fabian Groffen
2018-05-18 10:15 Fabian Groffen
2018-04-03 13:39 Fabian Groffen
2018-04-03 13:39 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=1612002955.3ef45fa46d5a45a3f19806cf62aba8532b4e401f.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