[gentoo-commits] proj/portage-utils:master commit in: /, man/, man/include/

2021-03-13 Thread Fabian Groffen
commit: 7dc2cc4bfaf2bbb943c45bc8171843a523cea7e5
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sat Mar 13 20:30:48 2021 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sat Mar 13 20:30:48 2021 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=7dc2cc4b

q: show masking reason from comments when using -vv with -m

Signed-off-by: Fabian Groffen  gentoo.org>

 main.c |  1 -
 man/include/q.optdesc.yaml |  5 ++--
 man/q.1|  7 +++---
 q.c| 58 +++---
 4 files changed, 62 insertions(+), 9 deletions(-)

diff --git a/main.c b/main.c
index a68af63..ceab587 100644
--- a/main.c
+++ b/main.c
@@ -677,7 +677,6 @@ read_one_repos_conf(const char *repos_conf, char **primary)
 
main_repo = NULL;
repo = NULL;
-   line = 0;
for (p = strtok_r(buf, "\n", &s); p != NULL; p = strtok_r(NULL, "\n", 
&s))
{
/* trim trailing whitespace, remove comments, locate = */

diff --git a/man/include/q.optdesc.yaml b/man/include/q.optdesc.yaml
index cde6eed..468ffa9 100644
--- a/man/include/q.optdesc.yaml
+++ b/man/include/q.optdesc.yaml
@@ -10,5 +10,6 @@ envvar: |
 variable name and the value is printed as a shell-style declaration.
 masks: |
 Print the masks from package.mask files found.  Use \fI-v\fR to see
-the source (file) where the mask was declared.  Additional arguments
-are treated as atom selectors which must match the masks.
+the source (file) where the mask was declared.  Use multiple
+\fI-v\fR to print the comment right before the mask.  Additional
+arguments are treated as atom selectors which must match the masks.

diff --git a/man/q.1 b/man/q.1
index 2979cab..f43be6f 100644
--- a/man/q.1
+++ b/man/q.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH q "1" "Feb 2021" "Gentoo Foundation" "q"
+.TH q "1" "Mar 2021" "Gentoo Foundation" "q"
 .SH NAME
 q \- invoke a portage utility applet
 .SH SYNOPSIS
@@ -35,8 +35,9 @@ variable name and the value is printed as a shell-style 
declaration.
 .TP
 \fB\-m\fR, \fB\-\-masks\fR
 Print the masks from package.mask files found.  Use \fI-v\fR to see
-the source (file) where the mask was declared.  Additional arguments
-are treated as atom selectors which must match the masks.
+the source (file) where the mask was declared.  Use multiple
+\fI-v\fR to print the comment right before the mask.  Additional
+arguments are treated as atom selectors which must match the masks.
 .TP
 \fB\-\-root\fR \fI\fR
 Set the ROOT env var.

diff --git a/q.c b/q.c
index a6a9a0b..e514b0c 100644
--- a/q.c
+++ b/q.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005-2019 Gentoo Foundation
+ * Copyright 2005-2021 Gentoo Foundation
  * Distributed under the terms of the GNU General Public License v2
  *
  * Copyright 2005-2010 Ned Ludd- 
@@ -288,6 +288,11 @@ int q_main(int argc, char **argv)
size_t n;
int j;
bool match;
+   char *lastmfile = NULL;
+   long lastcbeg = 0;
+   long lastcend = 0;
+   char *buf = NULL;
+   size_t buflen = 0;
depend_atom *atom;
depend_atom *qatom;
 
@@ -313,16 +318,63 @@ int q_main(int argc, char **argv)
if (!match)
continue;
 
+   if (verbose > 1) {
+   char *mfile = (char *)array_get_elem(files, n);
+   char *l;
+   char *s = NULL;
+   long line = 0;
+   long cbeg = 0;
+   long cend = 0;
+
+   s = l = strchr(mfile, ':');
+   /* p cannot be NULL, just crash if something's 
wrong */
+   (void)strtol(l + 1, &l, 10);
+   if (*l == ':')
+   cbeg = strtol(l + 1, &l, 10);
+   if (*l == '-')
+   cend = strtol(l + 1, &l, 10);
+   if (cend < cbeg)
+   cend = cbeg = 0;
+
+   if (lastmfile == NULL ||
+   strncmp(lastmfile, mfile, s - 
mfile + 1) != 0 ||
+   lastcbeg != cbeg || lastcend != 
cend)
+   {
+   *s = '\0';
+   if (buf != NULL)
+   *buf = '\0';
+   eat_file(mfile, &buf, &buflen);
+   *s = ':';
+
+   line = 0;
+ 

[gentoo-commits] proj/portage-utils:master commit in: man/, man/include/, /

2020-05-16 Thread Fabian Groffen
commit: a0780928edc76543e63709c915fb7d581bd13291
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sat May 16 14:29:45 2020 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sat May 16 14:29:45 2020 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=a0780928

qfile: print symlink targets in verbose mode

e.g.:
% qfile -v /bin/csh
app-shells/tcsh-6.21.00-r1: /bin/csh -> tcsh

Signed-off-by: Fabian Groffen  gentoo.org>

 man/include/qfile.optdesc.yaml | 6 +++---
 man/qfile.1| 8 
 qfile.c| 6 +-
 3 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/man/include/qfile.optdesc.yaml b/man/include/qfile.optdesc.yaml
index 66ee885..9e1d24b 100644
--- a/man/include/qfile.optdesc.yaml
+++ b/man/include/qfile.optdesc.yaml
@@ -1,7 +1,7 @@
 verbose: |
-Print package versions to matches, warn about problems with
-resolving symlinks or positioning packages under an alternative
-root.
+Print package versions and symlink targets for matches, warn about
+problems with resolving symlinks or positioning packages under an
+alternative root.
 quiet: |
 Don't print matching file for matches, just the package.  Don't
 report about orphan files.

diff --git a/man/qfile.1 b/man/qfile.1
index 7501311..7caa459 100644
--- a/man/qfile.1
+++ b/man/qfile.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qfile "1" "Nov 2019" "Gentoo Foundation" "qfile"
+.TH qfile "1" "May 2020" "Gentoo Foundation" "qfile"
 .SH NAME
 qfile \- list all pkgs owning files
 .SH SYNOPSIS
@@ -62,9 +62,9 @@ Don't look in the prunelib registry.
 Set the ROOT env var.
 .TP
 \fB\-v\fR, \fB\-\-verbose\fR
-Print package versions to matches, warn about problems with
-resolving symlinks or positioning packages under an alternative
-root.
+Print package versions and symlink targets for matches, warn about
+problems with resolving symlinks or positioning packages under an
+alternative root.
 .TP
 \fB\-q\fR, \fB\-\-quiet\fR
 Don't print matching file for matches, just the package.  Don't

diff --git a/qfile.c b/qfile.c
index d104848..efac60e 100644
--- a/qfile.c
+++ b/qfile.c
@@ -305,8 +305,12 @@ static int qfile_cb(tree_pkg_ctx *pkg_ctx, void *priv)
printf("%s", atom_format(state->format, atom));
if (quiet)
puts("");
+   else if (verbose && e->type == CONTENTS_SYM)
+   printf(": %s%s -> %s\n",
+   state->root ? 
state->root : "",
+   e->name, e->sym_target);
else
-   printf(": %s%s\n", state->root ? : "", 
e->name);
+   printf(": %s%s\n", state->root ? 
state->root : "", e->name);
} else {
non_orphans[i] = 1;
}



[gentoo-commits] proj/portage-utils:master commit in: man/, man/include/, /

2019-07-14 Thread Fabian Groffen
commit: 26b9374ee23d16b3957b6ebc0cd80f53b22a4d16
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sun Jul 14 13:30:06 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sun Jul 14 13:30:06 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=26b9374e

quse: add -F argument, move some -v functionality to -D

-v now controls default atom formatting, as with other applets, the
ability to list USE-flags, their state and description per package now
is enabled by the -D (describe) flag, which incidentally also makes more
sense.

Signed-off-by: Fabian Groffen  gentoo.org>

 man/include/quse.optdesc.yaml | 11 +++---
 man/quse.1| 14 ---
 quse.c| 85 ---
 3 files changed, 62 insertions(+), 48 deletions(-)

diff --git a/man/include/quse.optdesc.yaml b/man/include/quse.optdesc.yaml
index 693aade..71fcd2d 100644
--- a/man/include/quse.optdesc.yaml
+++ b/man/include/quse.optdesc.yaml
@@ -1,10 +1,11 @@
 exact: Search for exact string, e.g.\ do not use regular expression matching.
 verbose: |
-Show descriptions for USE-flags for packages that match the search.
+Show versions for packages that match the search.
 Also shows problems encountered during parsing.  These are mostly
 diagnostic and indicate possible incorrectness in the results.
 quiet: Ignored for compatibility with other qapplets.
-installed: |
-Only search installed packages.  Together with \fB-v\fR this shows
-USE-flags and their descriptions, and currently enabled flags
-prefixed with an asterisk (\fI*\fR).
+describe: |
+Describe the USE flag, when no USE-flag given and combined with
+\fB-p\fR, lists all USE-flags with their descriptions (and enabled
+state prefixed with an asterisk when used with \fB-I\fR) per
+package.

diff --git a/man/quse.1 b/man/quse.1
index a30e189..8306ca5 100644
--- a/man/quse.1
+++ b/man/quse.1
@@ -20,12 +20,13 @@ List all ebuilds, don't match anything.
 Use the LICENSE vs IUSE.
 .TP
 \fB\-D\fR, \fB\-\-describe\fR
-Describe the USE flag.
+Describe the USE flag, when no USE-flag given and combined with
+\fB-p\fR, lists all USE-flags with their descriptions (and enabled
+state prefixed with an asterisk when used with \fB-I\fR) per
+package.
 .TP
 \fB\-I\fR, \fB\-\-installed\fR
-Only search installed packages.  Together with \fB-v\fR this shows
-USE-flags and their descriptions, and currently enabled flags
-prefixed with an asterisk (\fI*\fR).
+Only search installed packages.
 .TP
 \fB\-p\fR \fI\fR, \fB\-\-package\fR \fI\fR
 Restrict matching to package or category.
@@ -33,11 +34,14 @@ Restrict matching to package or category.
 \fB\-R\fR, \fB\-\-repo\fR
 Show repository the ebuild originates from.
 .TP
+\fB\-F\fR \fI\fR, \fB\-\-format\fR \fI\fR
+Print matched atom using given format string.
+.TP
 \fB\-\-root\fR \fI\fR
 Set the ROOT env var.
 .TP
 \fB\-v\fR, \fB\-\-verbose\fR
-Show descriptions for USE-flags for packages that match the search.
+Show versions for packages that match the search.
 Also shows problems encountered during parsing.  These are mostly
 diagnostic and indicate possible incorrectness in the results.
 .TP

diff --git a/quse.c b/quse.c
index bc99c3b..df8626e 100644
--- a/quse.c
+++ b/quse.c
@@ -27,7 +27,7 @@
 #include "xarray.h"
 #include "xregex.h"
 
-#define QUSE_FLAGS "eaLDIp:R" COMMON_FLAGS
+#define QUSE_FLAGS "eaLDIp:RF:" COMMON_FLAGS
 static struct option const quse_long_opts[] = {
{"exact", no_argument, NULL, 'e'},
{"all",   no_argument, NULL, 'a'},
@@ -36,6 +36,7 @@ static struct option const quse_long_opts[] = {
{"installed", no_argument, NULL, 'I'},
{"package",a_argument, NULL, 'p'},
{"repo",  no_argument, NULL, 'R'},
+   {"format", a_argument, NULL, 'F'},
COMMON_LONG_OPTS
 };
 static const char * const quse_opts_help[] = {
@@ -46,6 +47,7 @@ static const char * const quse_opts_help[] = {
"Only search installed packages",
"Restrict matching to package or category",
"Show repository the ebuild originates from",
+   "Print matched atom using given format string",
COMMON_OPTS_HELP
 };
 #define quse_usage(ret) usage(ret, QUSE_FLAGS, quse_long_opts, quse_opts_help, 
NULL, lookup_applet_idx("quse"))
@@ -61,9 +63,10 @@ struct quse_state {
bool do_licence:1;
bool do_installed:1;
bool do_list:1;
-   bool do_repo:1;
+   bool need_full_atom:1;
depend_atom *match;
regex_t *pregv;
+   const char *fmt;
 };
 
 static char *_quse_getline_buf = NULL;
@@ -142,9 +145,8 @@ quse_search_use_local_desc(int portdirfd, struct quse_state 
*state)
if (state->do_list) {
state->retv[i] = xstrdup(q);
} else {
-   printf("%s%s/%s%s%s[%s%s%s] %s\n",
- 

[gentoo-commits] proj/portage-utils:master commit in: man/, /, man/include/

2019-07-18 Thread Fabian Groffen
commit: 94ca500baf225994b88f750262c0895553c70a8a
Author: Fabian Groffen  gentoo  org>
AuthorDate: Thu Jul 18 18:34:19 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Thu Jul 18 18:34:19 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=94ca500b

qlop: enhance running time indicator

Fix elapsed time mode (-t) when using -r displaying the elapsed time
also as the ETA.  When using -v, display what ETA is being used (average
or longest run).

Also, better document which flags can be combined with -r.

Signed-off-by: Fabian Groffen  gentoo.org>

 man/include/qlop.optdesc.yaml |  7 +--
 man/qlop.1|  7 +--
 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.

diff --git a/man/qlop.1 b/man/qlop.1
index 10eaa27..909ebdc 100644
--- a/man/qlop.1
+++ b/man/qlop.1
@@ -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\fR, \fB\-\-date\fR \fI\fR
 Limit the selection of packages to the date given, or to the range

diff --git a/qlop.c b/qlop.c
index e20c97b..fce0f69 100644
--- a/qlop.c
+++ b/qlop.c
@@ -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" :
-

[gentoo-commits] proj/portage-utils:master commit in: man/, man/include/

2019-08-17 Thread Fabian Groffen
commit: 4b27faa3832c62110573d4fa587a117047bf139c
Author: Fabian Groffen  gentoo  org>
AuthorDate: Thu Jul 18 18:38:46 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Thu Jul 18 18:38:46 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=4b27faa3

man/qlop: q -> g

g is now best matched by t, q was never doing anything in particular

Signed-off-by: Fabian Groffen  gentoo.org>

 man/include/qlop.desc | 2 +-
 man/qlop.1| 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/man/include/qlop.desc b/man/include/qlop.desc
index 3505173..e39f689 100644
--- a/man/include/qlop.desc
+++ b/man/include/qlop.desc
@@ -21,6 +21,6 @@ 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
 of reporting the time the operation finished, \fIqlop\fR now reports the
-time the operation started.  The behaviour of the old \fB-q\fR flag is
+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
 is matched by the new \fB-a\fR flag.

diff --git a/man/qlop.1 b/man/qlop.1
index 909ebdc..baa5bf5 100644
--- a/man/qlop.1
+++ b/man/qlop.1
@@ -29,7 +29,7 @@ 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
 of reporting the time the operation finished, \fIqlop\fR now reports the
-time the operation started.  The behaviour of the old \fB-q\fR flag is
+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
 is matched by the new \fB-a\fR flag.
 .SH OPTIONS



[gentoo-commits] proj/portage-utils:master commit in: man/, /, man/include/

2019-12-27 Thread Fabian Groffen
commit: 1038786d92a885dece9cc82588e88d8367a0fda2
Author: Fabian Groffen  gentoo  org>
AuthorDate: Fri Dec 27 19:14:44 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Fri Dec 27 19:14:44 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=1038786d

qkeyword: apply profile masks to -S/-T results

Technically, this should be enough to implement the Puppet provider for
Gentoo.

Signed-off-by: Fabian Groffen  gentoo.org>

 man/include/qkeyword-01-latest-testing.include | 23 
 man/include/qkeyword.desc  | 10 +++-
 man/qkeyword.1 | 34 ++--
 qkeyword.c | 73 +-
 4 files changed, 121 insertions(+), 19 deletions(-)

diff --git a/man/include/qkeyword-01-latest-testing.include 
b/man/include/qkeyword-01-latest-testing.include
new file mode 100644
index 000..1c2fde5
--- /dev/null
+++ b/man/include/qkeyword-01-latest-testing.include
@@ -0,0 +1,23 @@
+.SH "RETRIEVING LATEST TESTING VERSION AVAILABLE"
+.PP
+To retrieve the latest available version in the ebuild tree marked as
+testing for the given ARCH, can be done with a combination of flags,
+mostly to restrict the search.  For instance, to find the latest version
+of \fIsys-devel/gcc\fR available, one could use:
+.nf
+$ qkeyword -p sys-devel/gcc -T
+sys-devel/gcc-8.3.0
+.fi
+It may be that there is a newer version available, but masked for the
+configured profile (via package.mask).  Using \fB-v\fR will inform about
+this scenario happening:
+.nf
+$ qkeyword -p dev-vcs/cvs -Tv
+masked by =dev-vcs/cvs-1.12.12*: dev-vcs/cvs-1.12.12-r12
+.fi
+Unrelated, but to locate the mask given, use verbose mode on \fIq\fR's
+mask listing:
+.nf
+$ q -mv dev-vcs/cvs
+=dev-vcs/cvs-1.12.12* [/repo/gentoo/profiles/prefix/sunos/solaris/package.mask]
+.fi

diff --git a/man/include/qkeyword.desc b/man/include/qkeyword.desc
index b7a863c..adc55ea 100644
--- a/man/include/qkeyword.desc
+++ b/man/include/qkeyword.desc
@@ -1,5 +1,5 @@
-\fIqkeyword\fR allows various searches based on KEYWORDS aimed at Gentoo
-developers.  Various modes allow to query which packages would be
+\fIqkeyword\fR allows various searches based on KEYWORDS.  Some uses are
+aimed at Gentoo developers, to allow querying which packages would be
 available, or are candidate for keywording.
 .P
 By default, the entire tree is traversed.  Since this process can be
@@ -12,3 +12,9 @@ as package in one go.  The \fB-m\fR maintainer match, while 
reducing the
 resulting set, is likely to slow down the query processing since the
 metadata.xml file has to be read for each package examined.  It is best
 used in combination with \fB-p\fR or \fB-c\fR.
+.P
+\fIqkeyword\fR uses the keyword found in the configured profile (ARCH)
+for its queries.  This keyword can be overridden by giving the desired
+keyword as argument.  Note that this does not change the profile in use,
+which most notably can result in incorrect masks being applied for the
+\fB-T\fR and \fB-S\fR options.

diff --git a/man/qkeyword.1 b/man/qkeyword.1
index 34beb18..5a26218 100644
--- a/man/qkeyword.1
+++ b/man/qkeyword.1
@@ -6,8 +6,8 @@ qkeyword \- list packages based on keywords
 .B qkeyword
 \fI[opts]  \fR
 .SH DESCRIPTION
-\fIqkeyword\fR allows various searches based on KEYWORDS aimed at Gentoo
-developers.  Various modes allow to query which packages would be
+\fIqkeyword\fR allows various searches based on KEYWORDS.  Some uses are
+aimed at Gentoo developers, to allow querying which packages would be
 available, or are candidate for keywording.
 .P
 By default, the entire tree is traversed.  Since this process can be
@@ -20,6 +20,12 @@ as package in one go.  The \fB-m\fR maintainer match, while 
reducing the
 resulting set, is likely to slow down the query processing since the
 metadata.xml file has to be read for each package examined.  It is best
 used in combination with \fB-p\fR or \fB-c\fR.
+.P
+\fIqkeyword\fR uses the keyword found in the configured profile (ARCH)
+for its queries.  This keyword can be overridden by giving the desired
+keyword as argument.  Note that this does not change the profile in use,
+which most notably can result in incorrect masks being applied for the
+\fB-T\fR and \fB-S\fR options.
 .SH OPTIONS
 .TP
 \fB\-p\fR \fI\fR, \fB\-\-matchpkg\fR \fI\fR
@@ -75,7 +81,29 @@ Print this help and exit.
 .TP
 \fB\-V\fR, \fB\-\-version\fR
 Print version and exit.
-
+.SH "RETRIEVING LATEST TESTING VERSION AVAILABLE"
+.PP
+To retrieve the latest available version in the ebuild tree marked as
+testing for the given ARCH, can be done with a combination of flags,
+mostly to restrict the search.  For instance, to find the latest version
+of \fIsys-devel/gcc\fR available, one could use:
+.nf
+$ qkeyword -p sys-devel/gcc -T
+sys-devel/gcc-8.3.0
+.fi
+It may be that there is a newer version available, but masked for the
+configured profile (via package.mask).  Using \fB-v\fR 

[gentoo-commits] proj/portage-utils:master commit in: man/, man/include/

2018-04-01 Thread Fabian Groffen
commit: b10334e70c272bb554228acea075011925f260fb
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sun Apr  1 12:44:30 2018 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sun Apr  1 12:44:30 2018 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=b10334e7

man/qlop: regen manpage

commit fe42f2a99297fed36720e71ba2ed77cf7a9da804 changed the generated
file, this commit ensures that future regenerate operations don't lose
the changes

 man/include/qlop.desc |  4 
 man/include/qlop.optdesc.yaml | 15 +++
 man/qlop.1| 26 +++---
 3 files changed, 34 insertions(+), 11 deletions(-)

diff --git a/man/include/qlop.desc b/man/include/qlop.desc
new file mode 100644
index 000..d99cc94
--- /dev/null
+++ b/man/include/qlop.desc
@@ -0,0 +1,4 @@
+.I qlop
+reads from $EMERGE_LOG_DIR/emerge.log and tries to extract
+information about merges, unmerges and syncs.  For packages, it can
+calculate average merge times or just list them.

diff --git a/man/include/qlop.optdesc.yaml b/man/include/qlop.optdesc.yaml
new file mode 100644
index 000..7864d6e
--- /dev/null
+++ b/man/include/qlop.optdesc.yaml
@@ -0,0 +1,15 @@
+gauge: |
+Gauge number of times a package has been merged.  This shows the
+merge time for each individual merge of package.
+time: |
+Calculate merge time for a specific package.  This is the average
+time for all merges of package.
+human: |
+Print seconds in human readable format (needs \fB\-t\fR), using
+minutes, hours and days instead of just seconds.
+current: |
+Show current emerging packages.  This relies on
+.I FEATURES=sandbox
+in order to detect running merges.
+verbose: |
+Print package versions and revisions.

diff --git a/man/qlop.1 b/man/qlop.1
index 70fb411..c138054 100644
--- a/man/qlop.1
+++ b/man/qlop.1
@@ -1,26 +1,28 @@
-.TH qlop "1" "Mar 2018" "Gentoo Foundation" "qlop"
+.\" generated by mkman.py, please do NOT edit!
+.TH qlop "1" "Apr 2018" "Gentoo Foundation" "qlop"
 .SH NAME
 qlop \- emerge log analyzer
 .SH SYNOPSIS
 .B qlop
 \fI[opts] \fR
 .SH DESCRIPTION
-qlop reads from $EMERGE_LOG_DIR/emerge.log and tries to extract
+.I qlop
+reads from $EMERGE_LOG_DIR/emerge.log and tries to extract
 information about merges, unmerges and syncs.  For packages, it can
 calculate average merge times or just list them.
 .SH OPTIONS
 .TP
 \fB\-g\fR, \fB\-\-gauge\fR
-Gauge number of times a package has been merged.  This shows the merge
-time for each individual merge of package.
+Gauge number of times a package has been merged.  This shows the
+merge time for each individual merge of package.
 .TP
 \fB\-t\fR, \fB\-\-time\fR
-Calculate merge time for a specific package.  This is the average time
-for all merges of package.
+Calculate merge time for a specific package.  This is the average
+time for all merges of package.
 .TP
 \fB\-H\fR, \fB\-\-human\fR
-Print seconds in human readable format (needs -t), using minutes, hours
-and days instead of just seconds.
+Print seconds in human readable format (needs \fB\-t\fR), using
+minutes, hours and days instead of just seconds.
 .TP
 \fB\-l\fR, \fB\-\-list\fR
 Show merge history.
@@ -32,8 +34,9 @@ Show unmerge history.
 Show sync history.
 .TP
 \fB\-c\fR, \fB\-\-current\fR
-Show current emerging packages.  This relies on FEATURES=sandbox in
-order to detect running merges.
+Show current emerging packages.  This relies on
+.I FEATURES=sandbox
+in order to detect running merges.
 .TP
 \fB\-d\fR \fI\fR, \fB\-\-date\fR \fI\fR
 Limit selection to this time (1st -d is start, 2nd -d is end).
@@ -62,7 +65,8 @@ Print version and exit.
 .SH "REPORTING BUGS"
 Please report bugs via http://bugs.gentoo.org/
 .br
-Product: Portage Development; Component: Tools
+Product: Portage Development; Component: Tools, Assignee:
+portage-ut...@gentoo.org
 .SH AUTHORS
 .nf
 Ned Ludd 



[gentoo-commits] proj/portage-utils:master commit in: man/, man/include/

2018-04-01 Thread Fabian Groffen
commit: 3b1cb130c9d20ef0d1190d7b7baf25a910765167
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sun Apr  1 13:47:10 2018 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sun Apr  1 13:47:10 2018 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=3b1cb130

man/qdepends: improve manpage

Bug https://bugs.gentoo.org/645554

 man/include/qdepends-05-examples.include | 17 +++
 man/include/qdepends.desc| 10 +++--
 man/include/qdepends.optdesc.yaml| 29 
 man/qdepends.1   | 77 
 4 files changed, 111 insertions(+), 22 deletions(-)

diff --git a/man/include/qdepends-05-examples.include 
b/man/include/qdepends-05-examples.include
index d4779ea..04fb92f 100644
--- a/man/include/qdepends-05-examples.include
+++ b/man/include/qdepends-05-examples.include
@@ -6,3 +6,20 @@ For finding out what a particular package depends on for 
building, you could do:
 .fi
 This tells us that we have \fIapp-editors/nano-2.3.2\fR installed and it 
depends
 on ncurses (among other things).
+
+Searching for packages that actually have nano in their RDEPEND:
+.nf
+   $ \fIqdepends -rQ nano\fR
+   virtual/editor-0
+.fi
+Tells us that \fIvirtual/editor\fR depends on nano.  However, if we
+wanted to know in what way a package specifically depends on another
+package, one can use \fB\-v\fR.
+.nf
+   $ \fIqdepends -vrQ logrotate\fR
+   sys-apps/portage-2.3.18: >=app-admin/logrotate-3.8.0
+.fi
+This way we can see there is a specific dependency expressed here.  If
+the above had used \fI\fR can be
+any key from Portage's VDB, e.g.\ any file from
+var/db/pkg///.
+query: |
+Query reverse deps.  This basically reverses the search to any
+package that references \fI\fR in DEPEND, RDEPEND or PDEPEND.
+This can be useful to find consumers of a given package, e.g.\ to
+search for packages that have \fIlogwatch\fR in their DEPEND.
+name-only: |
+Only show category/package, instead of category/package-version.
+format: |
+Pretty-print DEPEND declaration to be used in an ebuild.  This
+option initiates a very different mode of operation.  Instead of
+printing searching through packages, it constructs a multi-line
+statement in with shell syntax, to be used in an ebuild.  Each
+argument is turned into a separate DEPEND variable declaration.  You
+need to quote dependency strings in order for them to be printed as
+a single dependency declaration.  When used with the \fB\-q\fR
+option, only the pretty-printed dependency declaration is printed,
+e.g.\ the DEPEND= part is skipped.
+verbose: |
+When in reverse dep mode, print the package or packages that matched
+the query from the dependency line being searched.  This includes
+specifiers and versions.
+quiet: Suppress DEPEND= output for \fB\-f\fR.

diff --git a/man/qdepends.1 b/man/qdepends.1
index a0cac5b..c51a02d 100644
--- a/man/qdepends.1
+++ b/man/qdepends.1
@@ -1,64 +1,85 @@
-.TH qdepends "1" "Mar 2016" "Gentoo Foundation" "qdepends"
+.\" generated by mkman.py, please do NOT edit!
+.TH qdepends "1" "Apr 2018" "Gentoo Foundation" "qdepends"
 .SH NAME
 qdepends \- show dependency info
 .SH SYNOPSIS
 .B qdepends
 \fI[opts] \fR
 .SH DESCRIPTION
-The qdepends applet has a couple different modes.  Normally it is geared 
towards
+The
+.I qdepends
+applet has a couple different modes.  Normally it is geared towards
 answering the queries "what does package X depend on" and "what packages depend
 on X".  Both can further be classified into build, run, and post dependencies.
 
 By default, it will tell you the build time dependencies only (DEPEND).
 
-Currently, qdepends will only query installed packages.  There is no support 
for
-querying packages not yet installed (the \fBequery\fR(1) tool can do that).
+Currently,
+.I qdepends
+will only query installed packages.  There is no support for
+querying packages not yet installed (see \fBequery\fR(1) for that).
 
 If there is no answer to your query (i.e. you've asked for a package that is 
not
 installed, or a version that does not match), then you will get back no output.
 .SH OPTIONS
 .TP
 \fB\-d\fR, \fB\-\-depend\fR
-Show DEPEND info (default)
+Show DEPEND info (default).
 .TP
 \fB\-r\fR, \fB\-\-rdepend\fR
-Show RDEPEND info
+Show RDEPEND info.
 .TP
 \fB\-p\fR, \fB\-\-pdepend\fR
-Show PDEPEND info
+Show PDEPEND info.
 .TP
 \fB\-k\fR \fI\fR, \fB\-\-key\fR \fI\fR
-User defined vdb key
+Advanced option to allow querying the VDB.  This option overrides
+\fB\-d\fR, \fB\-r\fR, \fB\-p\fR or \fB\-a\fR.  \fI\fR can be
+any key from Portage's VDB, e.g.\ any file from
+var/db/pkg///.
 .TP
 \fB\-Q\fR \fI\fR, \fB\-\-query\fR \fI\fR
-Query reverse deps
+Query reverse deps.  This basically reverses the search to any
+package that references \fI\fR in DEPEND, RDEPEND or PDEPEND.
+This can be useful to find consumers of a given package, e.g.\ to

[gentoo-commits] proj/portage-utils:master commit in: man/, man/include/

2018-04-02 Thread Fabian Groffen
commit: 9164549006068637d060a23a9a24f657982bfbaf
Author: Fabian Groffen  gentoo  org>
AuthorDate: Mon Apr  2 17:26:35 2018 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Mon Apr  2 17:26:35 2018 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=91645490

qatom: improve manpage

Bug: https://bugs.gentoo.org/645554

 man/include/qatom.desc | 15 +
 man/include/qatom.optdesc.yaml | 43 
 man/qatom.1| 74 --
 3 files changed, 122 insertions(+), 10 deletions(-)

diff --git a/man/include/qatom.desc b/man/include/qatom.desc
new file mode 100644
index 000..10f0c1c
--- /dev/null
+++ b/man/include/qatom.desc
@@ -0,0 +1,15 @@
+\fIqatom\fR parses strings into atoms and optionally compares them.  The
+parsing into atoms results in CATEGORY, PN (package name), PV (package
+version), PR (package revision), SLOT and REPO.  Next to these version
+qualifiers (e.g.\ >, <, or =) and optional * suffix are extracted.  All
+but PN are optional.
+
+Comparison of atoms returns the relationship between two parsed atoms.
+\fIqatom\fR does not allow to test conditions.  It is possible to
+perform multiple comparisons by simply adding more arguments.
+Comparisons are, however, always performed two by two, so there must be
+an even count of arguments to the compare function.
+
+The \fIqatom\fR applet is a direct wrapper around the atom parsing
+functionalities used by various other applets.  As such this applet
+allows easy testing or atom parsing and comparison behaviour.

diff --git a/man/include/qatom.optdesc.yaml b/man/include/qatom.optdesc.yaml
new file mode 100644
index 000..e71dfb7
--- /dev/null
+++ b/man/include/qatom.optdesc.yaml
@@ -0,0 +1,43 @@
+format: |
+Specify a custom  output  format.  The default format is
+.nf
+%{CATEGORY} %{PN} %{PV} %[PR] %[SLOT] %[pfx] %[sfx]
+.fi
+Conversion specifiers start with a \fI%\fR symbol and are followed
+by either \fI{\fR or \fI[\fR.  Next is the name of the field to
+expand, followed by a matching \fI}\fR or \fI]\fR.  The difference
+between \fI{\fR and \fI[\fR is that the latter is only printed if
+the field referred is set, while the former prints \fI\fR in
+that case.
+
+The following fields are supported, which are inline with the
+variables from \fBebuild\fR(5).
+.RS
+.IP CATEGORY
+The category of the package.
+.IP P
+The package name and version without the ebuild revision.
+.IP PN
+The package name.
+.IP PV
+The package version without the ebuild revision.
+.IP PVR
+The package version including ebuild revision, which is also printed
+when zero, unlike for \fIPF\fR.
+.IP PF
+The package name, version and revision when not zero.  Thus, a zero
+revision \fI\-r0\fR is not printed.
+.IP PR
+The ebuild revision, when force printed, outputs \fI\-r0\fR when unset.
+.IP SLOT
+The package slot, when force printed, outputs \fI\-\fR when unset.
+.IP REPO
+The package repository.
+.IP pfx
+The package prefixes, that is version specifiers.
+.IP sfx
+The package suffices, currently that is just the asterisk.
+.RE
+verbose: Force all expansions, basically treat all \fI[\fR like \fI{\fR.
+quiet: Ignored for compatibility with other qapplets.
+nocolor: Ignored for compatibility with other qapplets.

diff --git a/man/qatom.1 b/man/qatom.1
index 4a30343..aeb9629 100644
--- a/man/qatom.1
+++ b/man/qatom.1
@@ -1,41 +1,95 @@
-.TH qatom "1" "Mar 2016" "Gentoo Foundation" "qatom"
+.\" generated by mkman.py, please do NOT edit!
+.TH qatom "1" "Apr 2018" "Gentoo Foundation" "qatom"
 .SH NAME
 qatom \- split atom strings
 .SH SYNOPSIS
 .B qatom
 \fI[opts] \fR
 .SH DESCRIPTION
+\fIqatom\fR parses strings into atoms and optionally compares them.  The
+parsing into atoms results in CATEGORY, PN (package name), PV (package
+version), PR (package revision), SLOT and REPO.  Next to these version
+qualifiers (e.g.\ >, <, or =) and optional * suffix are extracted.  All
+but PN are optional.
 
+Comparison of atoms returns the relationship between two parsed atoms.
+\fIqatom\fR does not allow to test conditions.  It is possible to
+perform multiple comparisons by simply adding more arguments.
+Comparisons are, however, always performed two by two, so there must be
+an even count of arguments to the compare function.
+
+The \fIqatom\fR applet is a direct wrapper around the atom parsing
+functionalities used by various other applets.  As such this applet
+allows easy testing or atom parsing and comparison behaviour.
 .SH OPTIONS
 .TP
 \fB\-F\fR \fI\fR, \fB\-\-format\fR \fI\fR
-Custom output format (default: %{CATEGORY} %{PN} %{PV} %[PR] %[SLOT] %[pfx] 
%[sfx])
+Specify a custom  output  format.  The default format is
+.nf
+%{CATEGORY} %{PN} %{PV} %[PR] %[SLOT] %[pfx] %[sfx]
+.fi
+Conversion specifiers start with a \fI%

[gentoo-commits] proj/portage-utils:master commit in: man/, man/include/, /

2018-04-03 Thread Fabian Groffen
commit: 1def9d468742c0d6d6b24aa1f1d76243be6e24cd
Author: Fabian Groffen  gentoo  org>
AuthorDate: Tue Apr  3 11:49:41 2018 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Tue Apr  3 11:49:41 2018 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=1def9d46

qlist: improve documentation

Bug: https://bugs.gentoo.org/645554

 man/include/qlist.desc |  6 +
 man/include/qlist.optdesc.yaml | 24 ++
 man/qlist.1| 56 +++---
 qlist.c|  2 +-
 4 files changed, 67 insertions(+), 21 deletions(-)

diff --git a/man/include/qlist.desc b/man/include/qlist.desc
new file mode 100644
index 000..e02d971
--- /dev/null
+++ b/man/include/qlist.desc
@@ -0,0 +1,6 @@
+\fIqlist\fR shows the contents, or a subset thereof, of an installed
+package.  Alternatively, lists whether a package is installed,
+optionally with version, USE-flag, SLOT or REPO information.  The
+\fIpkgname\fR to query for does not have to be an exact match, it may be
+part of it, e.g.\ an entire category, or any package with some string in
+its name.

diff --git a/man/include/qlist.optdesc.yaml b/man/include/qlist.optdesc.yaml
new file mode 100644
index 000..a60ef0d
--- /dev/null
+++ b/man/include/qlist.optdesc.yaml
@@ -0,0 +1,24 @@
+installed: |
+Instead of listing the contents of a package, just print the package
+name if the package is currently installed.
+umap: |
+List USE-flags enabled when the package was installed.  This flag
+implies \fB\-I\fR.
+slot: |
+Display installed packages with slots (use twice for subslots).
+This flag implies \fB\-I\fR.
+repo: |
+Display installed packages with repository the ebuild originated from.
+This flag implies \fB\-I\fR.
+columns: |
+Like \fB\-Iv\fR, but package name and version are separated by a
+space for easy consumption by e.g.\ shell scripts which can read
+space-separated columns.
+verbose: |
+When used with \fB\-I\fR, print the package version next to name.
+When listing the package contents, a single \fB\-v\fR displays
+symlinks with an arrow (\->) to their target.  Two or more \fB\-v\fR
+adds colour to the entries and prints like \fB\-I\fR before the
+listing.
+quiet: |
+Suppresses the parenthesis around the USE-flags when used with \fB\-U\fR.

diff --git a/man/qlist.1 b/man/qlist.1
index 05e9326..f7dd847 100644
--- a/man/qlist.1
+++ b/man/qlist.1
@@ -1,68 +1,84 @@
-.TH qlist "1" "Mar 2016" "Gentoo Foundation" "qlist"
+.\" generated by mkman.py, please do NOT edit!
+.TH qlist "1" "Apr 2018" "Gentoo Foundation" "qlist"
 .SH NAME
 qlist \- list files owned by pkgname
 .SH SYNOPSIS
 .B qlist
 \fI[opts] \fR
 .SH DESCRIPTION
-
+\fIqlist\fR shows the contents, or a subset thereof, of an installed
+package.  Alternatively, lists whether a package is installed,
+optionally with version, USE-flag, SLOT or REPO information.  The
+\fIpkgname\fR to query for does not have to be an exact match, it may be
+part of it, e.g.\ an entire category, or any package with some string in
+its name.
 .SH OPTIONS
 .TP
 \fB\-I\fR, \fB\-\-installed\fR
-Just show installed packages
+Instead of listing the contents of a package, just print the package
+name if the package is currently installed.
 .TP
 \fB\-S\fR, \fB\-\-slots\fR
-Display installed packages with slots (use twice for subslots)
+Display installed packages with slots (use twice for subslots).
 .TP
 \fB\-R\fR, \fB\-\-repo\fR
-Display installed packages with repository
+Display installed packages with repository the ebuild originated from.
+This flag implies \fB\-I\fR.
 .TP
 \fB\-U\fR, \fB\-\-umap\fR
-Display installed packages with flags used
+List USE-flags enabled when the package was installed.  This flag
+implies \fB\-I\fR.
 .TP
 \fB\-c\fR, \fB\-\-columns\fR
-Display column view
+Like \fB\-Iv\fR, but package name and version are separated by a
+space for easy consumption by e.g.\ shell scripts which can read
+space-separated columns.
 .TP
 \fB\-\-showdebug\fR
-Show /usr/lib/debug files
+Show /usr/lib/debug and /usr/src/debug files.
 .TP
 \fB\-e\fR, \fB\-\-exact\fR
-Exact match (only CAT/PN or PN without PV)
+Exact match (only CAT/PN or PN without PV).
 .TP
 \fB\-a\fR, \fB\-\-all\fR
-Show every installed package
+Show every installed package.
 .TP
 \fB\-d\fR, \fB\-\-dir\fR
-Only show directories
+Only show directories.
 .TP
 \fB\-o\fR, \fB\-\-obj\fR
-Only show objects
+Only show objects.
 .TP
 \fB\-s\fR, \fB\-\-sym\fR
-Only show symlinks
+Only show symlinks.
 .TP
 \fB\-\-root\fR \fI\fR
-Set the ROOT env var
+Set the ROOT env var.
 .TP
 \fB\-v\fR, \fB\-\-verbose\fR
-Make a lot of noise
+When used with \fB\-I\fR, print the package version next to name.
+When listing the package contents, a single \fB\-v\fR displays
+symlinks with an arrow (\->) to their target.  Two or more \fB\-v\fR
+adds colour to the entries and prints like \fB\-I\fR before the
+list

[gentoo-commits] proj/portage-utils:master commit in: man/, man/include/

2018-04-03 Thread Fabian Groffen
commit: 86085691d6a42e497c1a8902cf7c24212a2dd67d
Author: Fabian Groffen  gentoo  org>
AuthorDate: Tue Apr  3 12:56:17 2018 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Tue Apr  3 12:56:17 2018 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=86085691

qpkg: improve documentation

Bug: https://bugs.gentoo.org/645554

 man/include/qpkg.desc |  4 
 man/include/qpkg.optdesc.yaml |  2 ++
 man/qpkg.1| 31 ++-
 3 files changed, 24 insertions(+), 13 deletions(-)

diff --git a/man/include/qpkg.desc b/man/include/qpkg.desc
new file mode 100644
index 000..2bba24b
--- /dev/null
+++ b/man/include/qpkg.desc
@@ -0,0 +1,4 @@
+\fIqpkg\fR creates or cleans up Gentoo binary packages.  The default
+action is to create a new binpkg for the given package names and store
+them in pkgdir, which can be set explicitly using the \fB\-\-pkgdir\fR
+option.

diff --git a/man/include/qpkg.optdesc.yaml b/man/include/qpkg.optdesc.yaml
new file mode 100644
index 000..2da2810
--- /dev/null
+++ b/man/include/qpkg.optdesc.yaml
@@ -0,0 +1,2 @@
+verbose: Check and report MD5 hash mismatches during install.
+quiet: Ignored for compatability with other qapplets.

diff --git a/man/qpkg.1 b/man/qpkg.1
index 8bb098a..930d15c 100644
--- a/man/qpkg.1
+++ b/man/qpkg.1
@@ -1,47 +1,52 @@
-.TH qpkg "1" "Mar 2016" "Gentoo Foundation" "qpkg"
+.\" generated by mkman.py, please do NOT edit!
+.TH qpkg "1" "Apr 2018" "Gentoo Foundation" "qpkg"
 .SH NAME
 qpkg \- manipulate Gentoo binpkgs
 .SH SYNOPSIS
 .B qpkg
 \fI[opts] \fR
 .SH DESCRIPTION
-
+\fIqpkg\fR creates or cleans up Gentoo binary packages.  The default
+action is to create a new binpkg for the given package names and store
+them in pkgdir, which can be set explicitly using the \fB\-\-pkgdir\fR
+option.
 .SH OPTIONS
 .TP
 \fB\-c\fR, \fB\-\-clean\fR
-clean pkgdir of unused binary files
+clean pkgdir of unused binary files.
 .TP
 \fB\-E\fR, \fB\-\-eclean\fR
-clean pkgdir of files not in the tree anymore (slow)
+clean pkgdir of files not in the tree anymore (slow).
 .TP
 \fB\-p\fR, \fB\-\-pretend\fR
-pretend only
+pretend only.
 .TP
 \fB\-P\fR \fI\fR, \fB\-\-pkgdir\fR \fI\fR
-alternate package directory
+alternate package directory.
 .TP
 \fB\-\-root\fR \fI\fR
-Set the ROOT env var
+Set the ROOT env var.
 .TP
 \fB\-v\fR, \fB\-\-verbose\fR
-Make a lot of noise
+Check and report MD5 hash mismatches during install.
 .TP
 \fB\-q\fR, \fB\-\-quiet\fR
-Tighter output; suppress warnings
+Ignored for compatability with other qapplets.
 .TP
 \fB\-C\fR, \fB\-\-nocolor\fR
-Don't output color
+Don't output color.
 .TP
 \fB\-h\fR, \fB\-\-help\fR
-Print this help and exit
+Print this help and exit.
 .TP
 \fB\-V\fR, \fB\-\-version\fR
-Print version and exit
+Print version and exit.
 
 .SH "REPORTING BUGS"
 Please report bugs via http://bugs.gentoo.org/
 .br
-Product: Portage Development; Component: Tools
+Product: Portage Development; Component: Tools, Assignee:
+portage-ut...@gentoo.org
 .SH AUTHORS
 .nf
 Ned Ludd 



[gentoo-commits] proj/portage-utils:master commit in: man/, man/include/

2018-04-03 Thread Fabian Groffen
commit: f24b626027dceb5890b134837c6683f4593f6ce0
Author: Fabian Groffen  gentoo  org>
AuthorDate: Tue Apr  3 12:15:35 2018 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Tue Apr  3 12:15:35 2018 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=f24b6260

qmerge: improve documentation

Bug: https://bugs.gentoo.org/645554

 man/include/qmerge.desc |  6 ++
 man/qmerge.1| 43 +--
 2 files changed, 31 insertions(+), 18 deletions(-)

diff --git a/man/include/qmerge.desc b/man/include/qmerge.desc
new file mode 100644
index 000..08589ec
--- /dev/null
+++ b/man/include/qmerge.desc
@@ -0,0 +1,6 @@
+\fIqmerge\fR retrieves and installs Gentoo binary packages.  Simple
+dependency checking is performed, after which \fIqmerge\fR just unpacks
+the binpkg onto the filesystem and registers the package in the VDB.
+
+Retrieval of packages from a remote binhost is currently performed using
+\fBwget\fR(1).  More specifically, \fIFETCHCOMMAND\fR is ignored.

diff --git a/man/qmerge.1 b/man/qmerge.1
index f3d80db..f66908e 100644
--- a/man/qmerge.1
+++ b/man/qmerge.1
@@ -1,65 +1,72 @@
-.TH qmerge "1" "Mar 2016" "Gentoo Foundation" "qmerge"
+.\" generated by mkman.py, please do NOT edit!
+.TH qmerge "1" "Apr 2018" "Gentoo Foundation" "qmerge"
 .SH NAME
 qmerge \- fetch and merge binary package
 .SH SYNOPSIS
 .B qmerge
 \fI[opts] \fR
 .SH DESCRIPTION
+\fIqmerge\fR retrieves and installs Gentoo binary packages.  Simple
+dependency checking is performed, after which \fIqmerge\fR just unpacks
+the binpkg onto the filesystem and registers the package in the VDB.
 
+Retrieval of packages from a remote binhost is currently performed using
+\fBwget\fR(1).  More specifically, \fIFETCHCOMMAND\fR is ignored.
 .SH OPTIONS
 .TP
 \fB\-f\fR, \fB\-\-fetch\fR
-Fetch package and newest Packages metadata
+Fetch package and newest Packages metadata.
 .TP
 \fB\-F\fR, \fB\-\-force\fR
-Fetch package (skipping Packages)
+Fetch package (skipping Packages).
 .TP
 \fB\-s\fR, \fB\-\-search\fR
-Search available packages
+Search available packages.
 .TP
 \fB\-K\fR, \fB\-\-install\fR
-Install package
+Install package.
 .TP
 \fB\-U\fR, \fB\-\-unmerge\fR
-Uninstall package
+Uninstall package.
 .TP
 \fB\-p\fR, \fB\-\-pretend\fR
-Pretend only
+Pretend only.
 .TP
 \fB\-u\fR, \fB\-\-update\fR
-Update only
+Update only.
 .TP
 \fB\-y\fR, \fB\-\-yes\fR
-Don't prompt before overwriting
+Don't prompt before overwriting.
 .TP
 \fB\-O\fR, \fB\-\-nodeps\fR
-Don't merge dependencies
+Don't merge dependencies.
 .TP
 \fB\-\-debug\fR
-Run shell funcs with `set -x`
+Run shell funcs with `set -x`.
 .TP
 \fB\-\-root\fR \fI\fR
-Set the ROOT env var
+Set the ROOT env var.
 .TP
 \fB\-v\fR, \fB\-\-verbose\fR
-Make a lot of noise
+Make a lot of noise.
 .TP
 \fB\-q\fR, \fB\-\-quiet\fR
-Tighter output; suppress warnings
+Tighter output; suppress warnings.
 .TP
 \fB\-C\fR, \fB\-\-nocolor\fR
-Don't output color
+Don't output color.
 .TP
 \fB\-h\fR, \fB\-\-help\fR
-Print this help and exit
+Print this help and exit.
 .TP
 \fB\-V\fR, \fB\-\-version\fR
-Print version and exit
+Print version and exit.
 
 .SH "REPORTING BUGS"
 Please report bugs via http://bugs.gentoo.org/
 .br
-Product: Portage Development; Component: Tools
+Product: Portage Development; Component: Tools, Assignee:
+portage-ut...@gentoo.org
 .SH AUTHORS
 .nf
 Ned Ludd 



[gentoo-commits] proj/portage-utils:master commit in: man/, man/include/

2018-04-03 Thread Fabian Groffen
commit: 23b810c84c02a29f3b2766cf0fd005c53e668816
Author: Fabian Groffen  gentoo  org>
AuthorDate: Tue Apr  3 13:51:42 2018 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Tue Apr  3 13:51:42 2018 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=23b810c8

qtbz2: improve documentation

Bug: https://bugs.gentoo.org/645554

 man/include/qsize.desc |  3 +++
 man/include/qsize.optdesc.yaml |  5 +
 man/include/qtbz2.desc |  2 ++
 man/include/qtbz2.optdesc.yaml |  2 ++
 man/qtbz2.1| 33 ++---
 5 files changed, 30 insertions(+), 15 deletions(-)

diff --git a/man/include/qsize.desc b/man/include/qsize.desc
new file mode 100644
index 000..e4edce0
--- /dev/null
+++ b/man/include/qsize.desc
@@ -0,0 +1,3 @@
+\fIqsize\fR calculates the storage size taken by an installed package.
+The reported sizes can be the recorded exact sizes of all files, or the
+storage space they consume given the underlying filesystem.

diff --git a/man/include/qsize.optdesc.yaml b/man/include/qsize.optdesc.yaml
new file mode 100644
index 000..8dd58e4
--- /dev/null
+++ b/man/include/qsize.optdesc.yaml
@@ -0,0 +1,5 @@
+ignore: |
+Filter out entries matching \fI\fR, which is a regular
+expression, before calculating size.
+verbose: Ignored for compatibility with other qapplets.
+quiet: Ignored for compatibility with other qapplets.

diff --git a/man/include/qtbz2.desc b/man/include/qtbz2.desc
new file mode 100644
index 000..2ba37db
--- /dev/null
+++ b/man/include/qtbz2.desc
@@ -0,0 +1,2 @@
+\fIqtbz2\fR joins and splits combined xpak+tarbz2 files.  Gentoo binary
+packages are such combined files.

diff --git a/man/include/qtbz2.optdesc.yaml b/man/include/qtbz2.optdesc.yaml
new file mode 100644
index 000..c1ebcd1
--- /dev/null
+++ b/man/include/qtbz2.optdesc.yaml
@@ -0,0 +1,2 @@
+verbose: Print some files and sizes while joining and splitting.
+quiet: Ignored for compatibility with other qapplets.

diff --git a/man/qtbz2.1 b/man/qtbz2.1
index b22c70c..94db0d8 100644
--- a/man/qtbz2.1
+++ b/man/qtbz2.1
@@ -1,53 +1,56 @@
-.TH qtbz2 "1" "Mar 2016" "Gentoo Foundation" "qtbz2"
+.\" generated by mkman.py, please do NOT edit!
+.TH qtbz2 "1" "Apr 2018" "Gentoo Foundation" "qtbz2"
 .SH NAME
 qtbz2 \- manipulate tbz2 packages
 .SH SYNOPSIS
 .B qtbz2
 \fI[opts] \fR
 .SH DESCRIPTION
-
+\fIqtbz2\fR joins and splits combined xpak+tarbz2 files.  Gentoo binary
+packages are such combined files.
 .SH OPTIONS
 .TP
 \fB\-d\fR \fI\fR, \fB\-\-dir\fR \fI\fR
-Change to specified directory
+Change to specified directory.
 .TP
 \fB\-j\fR, \fB\-\-join\fR
-Join:   
+Join:   .
 .TP
 \fB\-s\fR, \fB\-\-split\fR
-Split a tbz2 into a tar.bz2 + xpak
+Split a tbz2 into a tar.bz2 + xpak.
 .TP
 \fB\-t\fR, \fB\-\-tarbz2\fR
-Just split the tar.bz2
+Just split the tar.bz2.
 .TP
 \fB\-x\fR, \fB\-\-xpak\fR
-Just split the xpak
+Just split the xpak.
 .TP
 \fB\-O\fR, \fB\-\-stdout\fR
-Write files to stdout
+Write files to stdout.
 .TP
 \fB\-\-root\fR \fI\fR
-Set the ROOT env var
+Set the ROOT env var.
 .TP
 \fB\-v\fR, \fB\-\-verbose\fR
-Make a lot of noise
+Print some files and sizes while joining and splitting.
 .TP
 \fB\-q\fR, \fB\-\-quiet\fR
-Tighter output; suppress warnings
+Ignored for compatibility with other qapplets.
 .TP
 \fB\-C\fR, \fB\-\-nocolor\fR
-Don't output color
+Don't output color.
 .TP
 \fB\-h\fR, \fB\-\-help\fR
-Print this help and exit
+Print this help and exit.
 .TP
 \fB\-V\fR, \fB\-\-version\fR
-Print version and exit
+Print version and exit.
 
 .SH "REPORTING BUGS"
 Please report bugs via http://bugs.gentoo.org/
 .br
-Product: Portage Development; Component: Tools
+Product: Portage Development; Component: Tools, Assignee:
+portage-ut...@gentoo.org
 .SH AUTHORS
 .nf
 Ned Ludd 



[gentoo-commits] proj/portage-utils:master commit in: man/, man/include/, /

2018-04-12 Thread Fabian Groffen
commit: 33d4e18b26cd37691a81584da0efd929097a22b3
Author: Fabian Groffen  gentoo  org>
AuthorDate: Thu Apr 12 19:14:19 2018 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Thu Apr 12 19:14:19 2018 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=33d4e18b

qlop: don't rely on %F for data parsing for portability

While at it document the date formats in the man-page.

 man/include/qlop.optdesc.yaml | 16 
 man/qlop.1| 16 +++-
 qlop.c|  6 +++---
 3 files changed, 34 insertions(+), 4 deletions(-)

diff --git a/man/include/qlop.optdesc.yaml b/man/include/qlop.optdesc.yaml
index 7864d6e..fad1670 100644
--- a/man/include/qlop.optdesc.yaml
+++ b/man/include/qlop.optdesc.yaml
@@ -1,3 +1,19 @@
+date: |
+Limit the selection of packages to the date given, or to the range
+of dates if this argument is given twice.  The \fB--date\fR option
+can take a few forms.
+.RS
+.IP "NUMBER [s] [ago]"
+Relative time, specifying \fINUMBER\fR \fIdays\fR, \fIweeks\fR,
+\fImonths\fR or \fIyears\fR, for example \fI3 days ago\fR.
+.IP -MM-DD
+Big-endian date, with components separated by hyphens, starting with
+year, followed by month and day of month.
+.IP S
+Seconds since 1970-01-01 00:00:00 + (UTC), the UNIX epoch.
+.IP FORMAT|DATE
+Use \fIFORMAT\fR as input for \fBstrptime\fR(3) to parse \fIDATE\fR.
+.RE
 gauge: |
 Gauge number of times a package has been merged.  This shows the
 merge time for each individual merge of package.

diff --git a/man/qlop.1 b/man/qlop.1
index c138054..9c449a9 100644
--- a/man/qlop.1
+++ b/man/qlop.1
@@ -39,7 +39,21 @@ Show current emerging packages.  This relies on
 in order to detect running merges.
 .TP
 \fB\-d\fR \fI\fR, \fB\-\-date\fR \fI\fR
-Limit selection to this time (1st -d is start, 2nd -d is end).
+Limit the selection of packages to the date given, or to the range
+of dates if this argument is given twice.  The \fB--date\fR option
+can take a few forms.
+.RS
+.IP "NUMBER [s] [ago]"
+Relative time, specifying \fINUMBER\fR \fIdays\fR, \fIweeks\fR,
+\fImonths\fR or \fIyears\fR, for example \fI3 days ago\fR.
+.IP -MM-DD
+Big-endian date, with components separated by hyphens, starting with
+year, followed by month and day of month.
+.IP S
+Seconds since 1970-01-01 00:00:00 + (UTC), the UNIX epoch.
+.IP FORMAT|DATE
+Use \fIFORMAT\fR as input for \fBstrptime\fR(3) to parse \fIDATE\fR.
+.RE
 .TP
 \fB\-f\fR \fI\fR, \fB\-\-logfile\fR \fI\fR
 Read emerge logfile instead of $EMERGE_LOG_DIR/emerge.log.

diff --git a/qlop.c b/qlop.c
index 67669ef..1d4e0d9 100644
--- a/qlop.c
+++ b/qlop.c
@@ -39,7 +39,7 @@ static const char qlop_desc[] =
"The --date option can take a few forms:\n"
"  -d '# [s] [ago]'  (e.g. '3 days ago')\n"
"Or using strptime(3) formats:\n"
-   "  -d '2015-12-25'   (detected as %F)\n"
+   "  -d '2015-12-25'   (detected as %Y-%m-%d)\n"
"  -d '1459101740'   (detected as %s)\n"
"  -d '%d.%m.%Y|25.12.2015'  (format is specified)";
 #define qlop_usage(ret) usage(ret, QLOP_FLAGS, qlop_long_opts, qlop_opts_help, 
qlop_desc, lookup_applet_idx("qlop"))
@@ -733,7 +733,7 @@ parse_date(const char *sdate, time_t *t)
} else {
/* Handle automatic formats:
 * - "12315128"   -> %s
-* - "2015-12-24" -> %F (same as %Y-%m-%d
+* - "2015-12-24" -> %Y-%m-%d
 * - human readable format (see below)
 */
size_t len = strspn(sdate, "0123456789-");
@@ -742,7 +742,7 @@ parse_date(const char *sdate, time_t *t)
if (strchr(sdate, '-') == NULL)
fmt = "%s";
else
-   fmt = "%F";
+   fmt = "%Y-%m-%d";
 
s = strptime(sdate, fmt, &tm);
if (s == NULL || s[0] != '\0')



[gentoo-commits] proj/portage-utils:master commit in: man/, /, man/include/

2019-03-29 Thread Fabian Groffen
commit: c701892114d5b3eea773ff13f013f4d3a71fa571
Author: Fabian Groffen  gentoo  org>
AuthorDate: Fri Mar 29 16:31:50 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Fri Mar 29 16:31:50 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=c7018921

qlop: support standard date output format in parse_date

This allows to cut 'n' paste dates to limit output.

Signed-off-by: Fabian Groffen  gentoo.org>

 man/include/qlop.optdesc.yaml |  3 +++
 man/qlop.1|  5 -
 qlop.c| 14 +-
 3 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/man/include/qlop.optdesc.yaml b/man/include/qlop.optdesc.yaml
index a8fae61..25143b2 100644
--- a/man/include/qlop.optdesc.yaml
+++ b/man/include/qlop.optdesc.yaml
@@ -13,6 +13,9 @@ date: |
 .IP -MM-DD
 Big-endian date, with components separated by hyphens, starting with
 year, followed by month and day of month.
+.IP -MM-DDThh:mm:ss
+As before, but hours, minutes and seconds added.  This is the same
+format qlop prints for timestamps.
 .IP S
 Seconds since 1970-01-01 00:00:00 + (UTC), the UNIX epoch.
 .IP FORMAT|DATE

diff --git a/man/qlop.1 b/man/qlop.1
index 407c9ea..f0ef69a 100644
--- a/man/qlop.1
+++ b/man/qlop.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qlop "1" "Feb 2019" "Gentoo Foundation" "qlop"
+.TH qlop "1" "Mar 2019" "Gentoo Foundation" "qlop"
 .SH NAME
 qlop \- emerge log analyzer
 .SH SYNOPSIS
@@ -89,6 +89,9 @@ Alias for \fI1 day ago\fR.
 .IP -MM-DD
 Big-endian date, with components separated by hyphens, starting with
 year, followed by month and day of month.
+.IP -MM-DDThh:mm:ss
+As before, but hours, minutes and seconds added.  This is the same
+format qlop prints for timestamps.
 .IP S
 Seconds since 1970-01-01 00:00:00 + (UTC), the UNIX epoch.
 .IP FORMAT|DATE

diff --git a/qlop.c b/qlop.c
index b6970d0..a87cc5c 100644
--- a/qlop.c
+++ b/qlop.c
@@ -103,17 +103,21 @@ parse_date(const char *sdate, time_t *t)
return false;
} else {
/* Handle automatic formats:
-* - "12315128"   -> %s
-* - "2015-12-24" -> %Y-%m-%d
+* - "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-");
+   size_t len = strspn(sdate, "0123456789-:T");
if (sdate[len] == '\0') {
const char *fmt;
-   if (strchr(sdate, '-') == NULL)
+   if (strchr(sdate, '-') == NULL) {
fmt = "%s";
-   else
+   } else if ((s = strchr(sdate, 'T')) == NULL) {
fmt = "%Y-%m-%d";
+   } else {
+   fmt = "%Y-%m-%dT%H:%M:%S";
+   }
 
s = strptime(sdate, fmt, &tm);
if (s == NULL || s[0] != '\0')



[gentoo-commits] proj/portage-utils:master commit in: man/, /, man/include/

2019-06-09 Thread Fabian Groffen
commit: c0b88fe2b32679f1548a280d906b82b1651cd804
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sun Jun  9 09:51:26 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sun Jun  9 09:51:26 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=c0b88fe2

qgrep: print filename for matches by default, fix atom_compare call

remove very similar vdb callback in favour of generic tree one
format atoms using atom_format for consistency and ease of use
retrieve full atoms when SLOT or REPO matches are attempted

Signed-off-by: Fabian Groffen  gentoo.org>

 man/include/qgrep.optdesc.yaml |   2 +-
 man/qgrep.1|  41 -
 qgrep.c| 100 +++--
 3 files changed, 47 insertions(+), 96 deletions(-)

diff --git a/man/include/qgrep.optdesc.yaml b/man/include/qgrep.optdesc.yaml
index ad3874d..9716bf0 100644
--- a/man/include/qgrep.optdesc.yaml
+++ b/man/include/qgrep.optdesc.yaml
@@ -1,4 +1,4 @@
 verbose: |
 Prefix each matching line with filename (like \fB-H\fR).  When this
 option is given multiple times, also linenumbers are printed.
-quiet: Ignored for compatibility with other qapplets.
+quiet: Do not prefix each match with filename.

diff --git a/man/qgrep.1 b/man/qgrep.1
index 180b5dd..6701061 100644
--- a/man/qgrep.1
+++ b/man/qgrep.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qgrep "1" "May 2019" "Gentoo Foundation" "qgrep"
+.TH qgrep "1" "Jun 2019" "Gentoo Foundation" "qgrep"
 .SH NAME
 qgrep \- grep in ebuilds
 .SH SYNOPSIS
@@ -20,66 +20,63 @@ Select non-matching lines.
 \fB\-i\fR, \fB\-\-ignore\-case\fR
 Ignore case distinctions.
 .TP
-\fB\-H\fR, \fB\-\-with\-filename\fR
-Print the filename for each match.
-.TP
 \fB\-N\fR, \fB\-\-with\-name\fR
-Print the package or eclass name for each match.
+Print the filename for each match.
 .TP
 \fB\-c\fR, \fB\-\-count\fR
-Only print a count of matching lines per FILE.
+Print the package or eclass name for each match.
 .TP
 \fB\-l\fR, \fB\-\-list\fR
-Only print FILE names containing matches.
+Only print a count of matching lines per FILE.
 .TP
 \fB\-L\fR, \fB\-\-invert\-list\fR
-Only print FILE names containing no match.
+Only print FILE names containing matches.
 .TP
 \fB\-e\fR, \fB\-\-regexp\fR
-Use PATTERN as a regular expression.
+Only print FILE names containing no match.
 .TP
 \fB\-x\fR, \fB\-\-extended\fR
-Use PATTERN as an extended regular expression.
+Use PATTERN as a regular expression.
 .TP
 \fB\-J\fR, \fB\-\-installed\fR
-Search in installed ebuilds instead of the tree.
+Use PATTERN as an extended regular expression.
 .TP
 \fB\-E\fR, \fB\-\-eclass\fR
-Search in eclasses instead of ebuilds.
+Search in installed ebuilds instead of the tree.
 .TP
 \fB\-s\fR, \fB\-\-skip\-comments\fR
-Skip comments lines.
+Search in eclasses instead of ebuilds.
 .TP
 \fB\-R\fR, \fB\-\-repo\fR
-Print source repository name for each match (implies -N).
+Skip comments lines.
 .TP
 \fB\-S\fR \fI\fR, \fB\-\-skip\fR \fI\fR
-Skip lines matching .
+Print source repository name for each match (implies -N).
 .TP
 \fB\-B\fR \fI\fR, \fB\-\-before\fR \fI\fR
-Print  lines of leading context.
+Skip lines matching .
 .TP
 \fB\-A\fR \fI\fR, \fB\-\-after\fR \fI\fR
-Print  lines of trailing context.
+Print  lines of leading context.
 .TP
 \fB\-\-root\fR \fI\fR
-Set the ROOT env var.
+Print  lines of trailing context.
 .TP
 \fB\-v\fR, \fB\-\-verbose\fR
 Prefix each matching line with filename (like \fB-H\fR).  When this
 option is given multiple times, also linenumbers are printed.
 .TP
 \fB\-q\fR, \fB\-\-quiet\fR
-Ignored for compatibility with other qapplets.
+Do not prefix each match with filename.
 .TP
 \fB\-C\fR, \fB\-\-nocolor\fR
-Don't output color.
+Tighter output; suppress warnings.
 .TP
 \fB\-h\fR, \fB\-\-help\fR
-Print this help and exit.
+Don't output color.
 .TP
 \fB\-V\fR, \fB\-\-version\fR
-Print version and exit.
+Print this help and exit.
 
 .SH "REPORTING BUGS"
 Please report bugs via http://bugs.gentoo.org/

diff --git a/qgrep.c b/qgrep.c
index dff959b..058026e 100644
--- a/qgrep.c
+++ b/qgrep.c
@@ -24,11 +24,10 @@
 #include "xchdir.h"
 #include "xregex.h"
 
-#define QGREP_FLAGS "IiHNclLexJEsRS:B:A:" COMMON_FLAGS
+#define QGREP_FLAGS "IiNclLexJEsRS:B:A:" COMMON_FLAGS
 static struct option const qgrep_long_opts[] = {
{"invert-match",  no_argument, NULL, 'I'},
{"ignore-case",   no_argument, NULL, 'i'},
-   {"with-filename", no_argument, NULL, 'H'},
{"with-name", no_argument, NULL, 'N'},
{"count", no_argument, NULL, 'c'},
{"list",  no_argument, NULL, 'l'},
@@ -398,6 +397,8 @@ qgrep_cache_cb(tree_pkg_ctx *pkg_ctx, void *priv)
if (data->include_atoms != NULL) {
depend_atom **d;
for (d = data->include_atoms; *d != NULL; d++) {
+   if ((*d)->SLOT != NULL || (*d)->REPO != NULL)
+  

[gentoo-commits] proj/portage-utils:master commit in: man/, man/include/, /

2019-05-13 Thread Fabian Groffen
commit: 7854ca6d12f793f3b516373784831131db36bca9
Author: Fabian Groffen  gentoo  org>
AuthorDate: Mon May 13 12:56:30 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Mon May 13 12:56:30 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=7854ca6d

qlop: add mode for listing last emerge contents

add -l flag to list packages/sync from last emerge operation and make it
default (when no flags are given)

Signed-off-by: Fabian Groffen  gentoo.org>

 TODO.md   |  2 --
 man/include/qlop.desc |  5 ++--
 man/include/qlop.optdesc.yaml |  3 +++
 man/qlop.1|  9 +--
 qlop.c| 62 ---
 5 files changed, 60 insertions(+), 21 deletions(-)

diff --git a/TODO.md b/TODO.md
index 7df8983..58ea4c5 100644
--- a/TODO.md
+++ b/TODO.md
@@ -83,8 +83,6 @@
 
 - have a mode that doesn't print timestamp (to get just atoms, -v should
   work)
-- make a -d mode that allows to do equivalent of "last portage emerge"
-  to make it easy to see what was newly merged/unmerged
 
 # qlist
 - have -F for use with -I so one can do things like print SLOT for

diff --git a/man/include/qlop.desc b/man/include/qlop.desc
index 0c14e00..3505173 100644
--- a/man/include/qlop.desc
+++ b/man/include/qlop.desc
@@ -2,9 +2,10 @@
 reads from $EMERGE_LOG_DIR/emerge.log and tries to extract
 information about merges, unmerges and syncs.  It can
 calculate average merge times or just list them.  When given no
-arguments or just \fB-v\fR, \fIqlop\fR acts as if \fB-must\fR was given
+arguments or just \fB-v\fR, \fIqlop\fR acts as if \fB-slumt\fR was given
 and thus lists the time taken for all occurrances of merges, unmerges
-and sync operations found in the log.
+and sync operations found in the log for the last \fBemerge\fR(1) action
+performed by Portage.
 .P
 By default, packages are printed as CATEGORY/PN.  Use \fB-v\fR to print
 the package version and revision numbers, e.g\. CATEGORY/PF.  Note that

diff --git a/man/include/qlop.optdesc.yaml b/man/include/qlop.optdesc.yaml
index 25143b2..677c4d2 100644
--- a/man/include/qlop.optdesc.yaml
+++ b/man/include/qlop.optdesc.yaml
@@ -21,6 +21,9 @@ date: |
 .IP FORMAT|DATE
 Use \fIFORMAT\fR as input for \fBstrptime\fR(3) to parse \fIDATE\fR.
 .RE
+lastmerge: |
+Limit selection to last Portage emerge action.  This option is a
+dynamic version of \fB-d\fR, and hence both cannot be used together.
 time: |
 Show the time it took to merge, unmerge or sync.
 average: |

diff --git a/man/qlop.1 b/man/qlop.1
index 83b62f8..ae40fa7 100644
--- a/man/qlop.1
+++ b/man/qlop.1
@@ -10,9 +10,10 @@ qlop \- emerge log analyzer
 reads from $EMERGE_LOG_DIR/emerge.log and tries to extract
 information about merges, unmerges and syncs.  It can
 calculate average merge times or just list them.  When given no
-arguments or just \fB-v\fR, \fIqlop\fR acts as if \fB-must\fR was given
+arguments or just \fB-v\fR, \fIqlop\fR acts as if \fB-slumt\fR was given
 and thus lists the time taken for all occurrances of merges, unmerges
-and sync operations found in the log.
+and sync operations found in the log for the last \fBemerge\fR(1) action
+performed by Portage.
 .P
 By default, packages are printed as CATEGORY/PN.  Use \fB-v\fR to print
 the package version and revision numbers, e.g\. CATEGORY/PF.  Note that
@@ -98,6 +99,10 @@ Seconds since 1970-01-01 00:00:00 + (UTC), the UNIX 
epoch.
 Use \fIFORMAT\fR as input for \fBstrptime\fR(3) to parse \fIDATE\fR.
 .RE
 .TP
+\fB\-l\fR, \fB\-\-lastmerge\fR
+Limit selection to last Portage emerge action.  This option is a
+dynamic version of \fB-d\fR, and hence both cannot be used together.
+.TP
 \fB\-f\fR \fI\fR, \fB\-\-logfile\fR \fI\fR
 Read emerge logfile instead of $EMERGE_LOG_DIR/emerge.log.
 .TP

diff --git a/qlop.c b/qlop.c
index a60e5ac..5217638 100644
--- a/qlop.c
+++ b/qlop.c
@@ -24,7 +24,7 @@
 
 #define QLOP_DEFAULT_LOGFILE "emerge.log"
 
-#define QLOP_FLAGS "ctaHMmuUserd:f:w:" COMMON_FLAGS
+#define QLOP_FLAGS "ctaHMmuUslerd:f:w:" COMMON_FLAGS
 static struct option const qlop_long_opts[] = {
{"summary",   no_argument, NULL, 'c'},
{"time",  no_argument, NULL, 't'},
@@ -38,6 +38,7 @@ static struct option const qlop_long_opts[] = {
{"endtime",   no_argument, NULL, 'e'},
{"running",   no_argument, NULL, 'r'},
{"date",   a_argument, NULL, 'd'},
+   {"lastmerge", no_argument, NULL, 'l'},
{"logfile",a_argument, NULL, 'f'},
{"atoms",  a_argument, NULL, 'w'},
COMMON_LONG_OPTS
@@ -55,6 +56,7 @@ static const char * const qlop_opts_help[] = {
"Report time at which the operation finished (iso started)",
"Show current emerging packages",
"Limit selection to this time (1st -d is start, 2nd -d is end)",
+   "Limit selection to last Portage emerge action",
"Read emerge logfile instead of $EMERGE_LOG_

[gentoo-commits] proj/portage-utils:master commit in: man/, /, man/include/

2019-05-13 Thread Fabian Groffen
commit: 966de456d8af3b5102950e608a771f776efdd014
Author: Fabian Groffen  gentoo  org>
AuthorDate: Mon May 13 13:37:31 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Mon May 13 13:37:31 2019 +
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",
+  

[gentoo-commits] proj/portage-utils:master commit in: man/, /, man/include/

2019-05-17 Thread Fabian Groffen
commit: 5531d5c97a27c002abfcc1bd229d0716bba4b2e3
Author: Fabian Groffen  gentoo  org>
AuthorDate: Fri May 17 14:34:09 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Fri May 17 14:34:09 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=5531d5c9

qfile: allow matching basenames to objects by default

one can now do qfile qfile to find app-portage/portage-utils
updated the manpage somewhat

Signed-off-by: Fabian Groffen  gentoo.org>

 man/include/qfile-01-owners.include | 30 ++-
 man/include/qfile-02-orphans.include| 15 +++---
 man/include/qfile-03-ROOT.include   | 20 
 man/include/qfile-05-collisions.include |  8 +--
 man/include/qfile.desc  | 23 +
 man/include/qfile.optdesc.yaml  |  4 ++
 man/qfile.1 | 88 -
 qfile.c | 35 -
 8 files changed, 140 insertions(+), 83 deletions(-)

diff --git a/man/include/qfile-01-owners.include 
b/man/include/qfile-01-owners.include
index a4bdc76..39b1e03 100644
--- a/man/include/qfile-01-owners.include
+++ b/man/include/qfile-01-owners.include
@@ -1,16 +1,14 @@
 .SH "FINDING FILE OWNERS"
 .PP
-This is the default behavior of \fBqfile\fP.  It will list the packages which
-own the files (or directories, or symlinks, or anything else Portage can 
-install) you are querying.  Query items may be file paths or simple file
-names when the \fB\-b\fP option is used.
-By default, output includes packages names and the complete paths to
-the matching files.  If using \fB\-\-exact\fP, versions of the packages will 
-also be shown.  At the contrary, when using \fB\-\-quiet\fP, only package 
-names are listed, without files paths.  Finally, \fB\-\-verbose\fP is similar
-to \fB\-\-exact\fP, but may add a few warnings.  The return status of 
-\fBqfile\fP will be \fI0\fP as soon as an owning package has been found for 
-one of the query items.
+This is the default behavior of \fBqfile\fP.  It will list the packages
+which own the files (or directories, or symlinks, or anything else
+Portage can install) you are querying.  Query items may be file paths or
+simple file names.  By default, output includes packages names and the
+complete paths to the matching files.  If using \fB\-\-verbose\fP,
+versions of the packages will also be shown.  In contrast, when using
+\fB\-\-quiet\fP, only package names are listed, without files paths.
+The return status of \fBqfile\fP will be \fI0\fP as soon as an owning
+package has been found for one of the query items.
 .PP
 Find names of package(s) owning "/bin/bash":
 .nf\fI
@@ -20,17 +18,17 @@ Find names of package(s) owning "/bin/bash":
 .PP
 Find package(s) owning any file named "bash", and show paths of this files:
 .nf\fI
-   $ qfile -b bash
-   app-shells/bash (/bin/bash)
-   app-shells/bash (/etc/bash)
+   $ qfile -d bash
+   app-shells/bash: /bin/bash
+   app-shells/bash: /etc/bash
 .fi
 .PP
 Find packages(s) owning the file named "bash" in the current directory. Also 
 display their exact version:
 .nf\fI
$ cd /bin
-   $ qfile -e ./bash
-   app-shells/bash-3.1_p17 (/bin/bash)
+   $ qfile -v ./bash
+   app-shells/bash-3.1_p17: /bin/bash
 .fi
 .PP
 Find the package(s) owning the libraries needed by the Bash binary:

diff --git a/man/include/qfile-02-orphans.include 
b/man/include/qfile-02-orphans.include
index ca23796..f6754aa 100644
--- a/man/include/qfile-02-orphans.include
+++ b/man/include/qfile-02-orphans.include
@@ -1,13 +1,12 @@
 .SH "FINDING ORPHAN FILES"
 .PP
-\fBqfile\fP can also, with the \fB\-\-orphans\fP option, find files which are 
-not owned by any package.  This behavior is the opposite of the usual file 
-owner search: the output is the list of query items for which no reference has
-been found in your installed packages database.  The \fB\-\-exact\fP option has
-no effect in this mode, whereas \fB\-\-verbose\fP may add a few warning 
-messages.  As for \fB\-\-quiet\fP, it will completly turn off the output, 
-leaving just a silent test command, which returns \fI0\fP if and only if
-there was no orphan in your query items.
+\fBqfile\fP can also, with the \fB\-\-orphans\fP option, find files
+which are not owned by any package.  This behaviour is the opposite of
+the usual file owner search: the output is the list of query items for
+which no reference has been found in your installed packages database.
+As for \fB\-\-quiet\fP, it will completly turn off the output, leaving
+just a silent test command, which returns \fI0\fP if and only if there
+was no orphan in your query items.
 .PP
 Find the orphan libtool files of your system:
 .nf\fI

diff --git a/man/include/qfile-03-ROOT.include 
b/man/include/qfile-03-ROOT.include
index 61d965d..3bfbe51 100644
--- a/man/include/qfile-03-ROOT.include
+++ b/man/include/qfile-03-ROOT.include
@@ -1,7 +1,7 @@
 .SH "$ROOT HANDLING"
 .PP

[gentoo-commits] proj/portage-utils:master commit in: man/, /, man/include/

2019-04-28 Thread Fabian Groffen
commit: c5aba3a0bd055688120dbabb9c3826ed46ffc795
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sun Apr 28 07:57:05 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sun Apr 28 07:57:05 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=c5aba3a0

qgrep: rewrite using libq/vdb and libq/cache

(re)use the traversion logic from libq instead of re-implementing this.
Additional benefits are less code and usage of metadata when available.

Signed-off-by: Fabian Groffen  gentoo.org>

 applets.h  |   2 +-
 man/include/qgrep.desc |   9 +-
 man/include/qgrep.optdesc.yaml |   5 +-
 man/q.1|   2 +-
 man/qgrep.1|  16 +-
 qgrep.c| 756 ++---
 6 files changed, 429 insertions(+), 361 deletions(-)

diff --git a/applets.h b/applets.h
index 5889de6..4dd5bc2 100644
--- a/applets.h
+++ b/applets.h
@@ -73,7 +73,7 @@ static const struct applet_t {
/*
{"qglsa", qglsa_main, " ", "check GLSAs against 
system"},
*/
-   {"qgrep", qgrep_main, "", "grep in ebuilds"},
+   {"qgrep", qgrep_main, " [pkg ...]", "grep in ebuilds"},
{"qlist", qlist_main, "",   "list files owned by 
pkgname"},
{"qlop",  qlop_main,  "",   "emerge log analyzer"},
{"qmerge",qmerge_main,"",  "fetch and merge 
binary package"},

diff --git a/man/include/qgrep.desc b/man/include/qgrep.desc
index c95d35a..98bcc09 100644
--- a/man/include/qgrep.desc
+++ b/man/include/qgrep.desc
@@ -1,3 +1,6 @@
-\fIqgrep\fR searches for a given pattern in all ebuilds of the current
-portage tree.  Optionally the search is in all eclasses, or just in the
-ebuilds that are currently installed.
+\fIqgrep\fR searches for a given expression in all ebuilds of the
+current portage tree and defined additional overlays.  Optionally the
+search is in all eclasses, or just in the ebuilds that are currently
+installed.  To narrow the search, multiple targets can be given using
+atom syntax.  In particular, the trailing slash (/) syntax can be used
+to match an entire category.  See also \fIqatom\fR(1).

diff --git a/man/include/qgrep.optdesc.yaml b/man/include/qgrep.optdesc.yaml
index 87b174e..ad3874d 100644
--- a/man/include/qgrep.optdesc.yaml
+++ b/man/include/qgrep.optdesc.yaml
@@ -1,5 +1,4 @@
 verbose: |
-Print multiple matches per files.  When this option is given
-multiple times, also linenumber are printed for matches next to file
-names.
+Prefix each matching line with filename (like \fB-H\fR).  When this
+option is given multiple times, also linenumbers are printed.
 quiet: Ignored for compatibility with other qapplets.

diff --git a/man/q.1 b/man/q.1
index b3e985b..afba24a 100644
--- a/man/q.1
+++ b/man/q.1
@@ -41,7 +41,7 @@ Print version and exit.
qcheck: verify integrity of installed packages
  qdepends: show dependency info
 qfile   : list all pkgs owning files
-qgrep  : grep in ebuilds
+qgrep  [pkg ...]: grep in ebuilds
 qlist: list files owned by pkgname
  qlop: emerge log analyzer
qmerge   : fetch and merge binary package

diff --git a/man/qgrep.1 b/man/qgrep.1
index 662122d..048e28e 100644
--- a/man/qgrep.1
+++ b/man/qgrep.1
@@ -4,11 +4,14 @@
 qgrep \- grep in ebuilds
 .SH SYNOPSIS
 .B qgrep
-\fI[opts] \fR
+\fI[opts]  [pkg ...]\fR
 .SH DESCRIPTION
-\fIqgrep\fR searches for a given pattern in all ebuilds of the current
-portage tree.  Optionally the search is in all eclasses, or just in the
-ebuilds that are currently installed.
+\fIqgrep\fR searches for a given expression in all ebuilds of the
+current portage tree and defined additional overlays.  Optionally the
+search is in all eclasses, or just in the ebuilds that are currently
+installed.  To narrow the search, multiple targets can be given using
+atom syntax.  In particular, the trailing slash (/) syntax can be used
+to match an entire category.  See also \fIqatom\fR(1).
 .SH OPTIONS
 .TP
 \fB\-I\fR, \fB\-\-invert\-match\fR
@@ -60,9 +63,8 @@ Print  lines of trailing context.
 Set the ROOT env var.
 .TP
 \fB\-v\fR, \fB\-\-verbose\fR
-Print multiple matches per files.  When this option is given
-multiple times, also linenumber are printed for matches next to file
-names.
+Prefix each matching line with filename (like \fB-H\fR).  When this
+option is given multiple times, also linenumbers are printed.
 .TP
 \fB\-q\fR, \fB\-\-quiet\fR
 Ignored for compatibility with other qapplets.

diff --git a/qgrep.c b/qgrep.c
index 16bb4c1..3950c22 100644
--- a/qgrep.c
+++ b/qgrep.c
@@ -64,35 +64,6 @@ static const char * const qgrep_opts_help[] = {
 };
 #define qgrep_usage(ret) usage(ret, QGREP_FLAGS, qgrep_long_opts, 
qgrep_opts_help, NULL, lookup_applet_idx("qgrep"))
 
-static char
-qgrep_name_match(const char* name, const int argc, depend_atom** a

[gentoo-commits] proj/portage-utils:master commit in: man/, /, man/include/

2019-03-07 Thread Fabian Groffen
commit: 9ae56f85211d2c7c00b77b836e797339fc76f9b8
Author: Fabian Groffen  gentoo  org>
AuthorDate: Thu Mar  7 18:18:47 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Thu Mar  7 18:18:47 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=9ae56f85

qlist: change -U to display disabled flags with -v

reimplement umapstr() to allow printing flags not enabled, this is
slightly related to bug #656550.

Signed-off-by: Fabian Groffen  gentoo.org>

 man/include/qlist.optdesc.yaml |   2 +-
 man/qlist.1|   4 +-
 qlist.c| 183 ++---
 3 files changed, 119 insertions(+), 70 deletions(-)

diff --git a/man/include/qlist.optdesc.yaml b/man/include/qlist.optdesc.yaml
index a60ef0d..2b9299c 100644
--- a/man/include/qlist.optdesc.yaml
+++ b/man/include/qlist.optdesc.yaml
@@ -19,6 +19,6 @@ verbose: |
 When listing the package contents, a single \fB\-v\fR displays
 symlinks with an arrow (\->) to their target.  Two or more \fB\-v\fR
 adds colour to the entries and prints like \fB\-I\fR before the
-listing.
+listing.  Shows disabled USE-flags when used with \fB\-U\fR.
 quiet: |
 Suppresses the parenthesis around the USE-flags when used with \fB\-U\fR.

diff --git a/man/qlist.1 b/man/qlist.1
index c2c585c..4df7dab 100644
--- a/man/qlist.1
+++ b/man/qlist.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qlist "1" "Feb 2019" "Gentoo Foundation" "qlist"
+.TH qlist "1" "Mar 2019" "Gentoo Foundation" "qlist"
 .SH NAME
 qlist \- list files owned by pkgname
 .SH SYNOPSIS
@@ -60,7 +60,7 @@ When used with \fB\-I\fR, print the package version next to 
name.
 When listing the package contents, a single \fB\-v\fR displays
 symlinks with an arrow (\->) to their target.  Two or more \fB\-v\fR
 adds colour to the entries and prints like \fB\-I\fR before the
-listing.
+listing.  Shows disabled USE-flags when used with \fB\-U\fR.
 .TP
 \fB\-q\fR, \fB\-\-quiet\fR
 Suppresses the parenthesis around the USE-flags when used with \fB\-U\fR.

diff --git a/qlist.c b/qlist.c
index 4a3b95a..3ca3f5e 100644
--- a/qlist.c
+++ b/qlist.c
@@ -43,84 +43,124 @@ static const char * const qlist_opts_help[] = {
 };
 #define qlist_usage(ret) usage(ret, QLIST_FLAGS, qlist_long_opts, 
qlist_opts_help, NULL, lookup_applet_idx("qlist"))
 
-static char *
-grab_pkg_umap(q_vdb_pkg_ctx *pkg_ctx)
+static int
+cmpstringp(const void *p1, const void *p2)
+{
+   /* case insensitive comparator */
+   return strcasecmp(*((char * const *)p1), *((char * const *)p2));
+}
+
+/*
+ * ==> /var/db/pkg/mail-mta/exim-4.92/IUSE <==
+ * arc dane dcc +dkim dlfunc dmarc +dnsdb doc dovecot-sasl dsn
+ * elibc_glibc exiscan-acl gnutls idn ipv6 ldap libressl lmtp maildir
+ * mbx mysql nis pam perl pkcs11 postgres +prdr proxy radius redis sasl
+ * selinux spf sqlite srs ssl syslog tcpd +tpda X
+ *
+ * ==> /var/db/pkg/mail-mta/exim-4.92/PKGUSE <==
+ * -X dkim dmarc exiscan-acl ipv6 -ldap lmtp maildir -mbox pam -perl spf
+ * ssl tcpd
+ *
+ * ==> /var/db/pkg/mail-mta/exim-4.92/USE <==
+ * abi_x86_64 amd64 dkim dmarc dnsdb elibc_glibc exiscan-acl ipv6
+ * kernel_linux lmtp maildir pam prdr spf ssl tcpd tpda userland_GNU
+ *
+ * % emerge -pv exim
+ *
+ * These are the packages that would be merged, in order:
+ *
+ * Calculating dependencies... done!
+ * [ebuild   R   ~] mail-mta/exim-4.92::gentoo  USE="dkim dmarc dnsdb
+ * exiscan-acl ipv6 lmtp maildir pam prdr spf ssl tcpd tpda -X -arc
+ * -dane -dcc -dlfunc -doc -dovecot-sasl -dsn -gnutls -idn -ldap
+ * -libressl -mbx -mysql -nis -perl -pkcs11 -postgres -proxy -radius
+ * -redis -sasl (-selinux) -sqlite -srs -syslog" 0 KiB
+ *
+ * % qlist -IUv exim
+ * mail-mta/exim-4.92 (-arc -dane -dcc dkim -dlfunc dmarc dnsdb -doc
+ * -dovecot-sasl -dsn exiscan-acl -gnutls -idn ipv6 -ldap -libressl lmtp
+ * maildir -mbx -mysql -nis pam -perl -pkcs11 -postgres prdr -proxy
+ * -radius -redis -sasl -selinux spf -sqlite -srs ssl -syslog tcpd tpda
+ * -X)
+ */
+static char _umapstr_buf[BUFSIZ];
+static const char *
+umapstr(char display, q_vdb_pkg_ctx *pkg_ctx)
 {
-   static char umap[BUFSIZ];
-   static char *use, *iuse;
-   static size_t use_len, iuse_len;
-   int use_argc = 0, iuse_argc = 0;
-   char **use_argv = NULL, **iuse_argv = NULL;
-   queue *ll = NULL;
-   queue *sets = NULL;
-   int i, u;
+   char *bufp = _umapstr_buf;
+   char *use = NULL;
+   char *iuse = NULL;
+   size_t use_len;
+   size_t iuse_len;
+   int use_argc = 0;
+   int iuse_argc = 0;
+   char **use_argv = NULL;
+   char **iuse_argv = NULL;
+   int i;
+   int u;
+   int d;
+
+   *bufp = '\0';
+   if (!display)
+   return bufp;
 
q_vdb_pkg_eat(pkg_ctx, "USE", &use, &use_len);
if (!use[0])
-   return NULL;
+   return bufp;
q_vdb_pkg_eat(pkg_ctx, "IUSE", &iuse, &iuse_le

[gentoo-commits] proj/portage-utils:master commit in: man/, man/include/, /

2019-02-05 Thread Fabian Groffen
commit: 5674671e9d7e0e1251561d81a1154dd5d92e60ec
Author: Fabian Groffen  gentoo  org>
AuthorDate: Tue Feb  5 13:47:59 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Tue Feb  5 13:50:23 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=5674671e

qdepends: add support for BDEPEND

Bug: https://bugs.gentoo.org/674936
Signed-off-by: Fabian Groffen  gentoo.org>

 man/include/qdepends.optdesc.yaml |  8 
 man/qdepends.1| 13 -
 qdepends.c| 15 ---
 3 files changed, 24 insertions(+), 12 deletions(-)

diff --git a/man/include/qdepends.optdesc.yaml 
b/man/include/qdepends.optdesc.yaml
index 51b1cc7..5d786f3 100644
--- a/man/include/qdepends.optdesc.yaml
+++ b/man/include/qdepends.optdesc.yaml
@@ -1,13 +1,13 @@
 all: |
-Show *DEPEND, alias for \fB\-drp\fR.
+Show *DEPEND, alias for \fB\-drpb\fR.
 key: |
 Advanced option to allow querying the VDB.  This option overrides
-\fB\-d\fR, \fB\-r\fR, \fB\-p\fR or \fB\-a\fR.  \fI\fR can be
-any key from Portage's VDB, e.g.\ any file from
+\fB\-d\fR, \fB\-r\fR, \fB\-p\fR, \fB\-b\fR or \fB\-a\fR.
+\fI\fR can be any key from Portage's VDB, e.g.\ any file from
 var/db/pkg///.
 query: |
 Query reverse deps.  This basically reverses the search to any
-package that references \fI\fR in DEPEND, RDEPEND or PDEPEND.
+package that references \fI\fR in DEPEND, RDEPEND, PDEPEND or BDEPEND.
 This can be useful to find consumers of a given package, e.g.\ to
 search for packages that have \fIlogwatch\fR in their DEPEND.
 name-only: |

diff --git a/man/qdepends.1 b/man/qdepends.1
index 2e1aab2..0273999 100644
--- a/man/qdepends.1
+++ b/man/qdepends.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qdepends "1" "May 2018" "Gentoo Foundation" "qdepends"
+.TH qdepends "1" "Feb 2019" "Gentoo Foundation" "qdepends"
 .SH NAME
 qdepends \- show dependency info
 .SH SYNOPSIS
@@ -32,15 +32,18 @@ Show RDEPEND info.
 \fB\-p\fR, \fB\-\-pdepend\fR
 Show PDEPEND info.
 .TP
+\fB\-b\fR, \fB\-\-bdepend\fR
+Show BDEPEND info.
+.TP
 \fB\-k\fR \fI\fR, \fB\-\-key\fR \fI\fR
 Advanced option to allow querying the VDB.  This option overrides
-\fB\-d\fR, \fB\-r\fR, \fB\-p\fR or \fB\-a\fR.  \fI\fR can be
-any key from Portage's VDB, e.g.\ any file from
+\fB\-d\fR, \fB\-r\fR, \fB\-p\fR, \fB\-b\fR or \fB\-a\fR.
+\fI\fR can be any key from Portage's VDB, e.g.\ any file from
 var/db/pkg///.
 .TP
 \fB\-Q\fR \fI\fR, \fB\-\-query\fR \fI\fR
 Query reverse deps.  This basically reverses the search to any
-package that references \fI\fR in DEPEND, RDEPEND or PDEPEND.
+package that references \fI\fR in DEPEND, RDEPEND, PDEPEND or BDEPEND.
 This can be useful to find consumers of a given package, e.g.\ to
 search for packages that have \fIlogwatch\fR in their DEPEND.
 .TP
@@ -48,7 +51,7 @@ search for packages that have \fIlogwatch\fR in their DEPEND.
 Only show category/package, instead of category/package-version.
 .TP
 \fB\-a\fR, \fB\-\-all\fR
-Show *DEPEND, alias for \fB\-drp\fR.
+Show *DEPEND, alias for \fB\-drpb\fR.
 .TP
 \fB\-f\fR, \fB\-\-format\fR
 Pretty-print DEPEND declaration to be used in an ebuild.  This

diff --git a/qdepends.c b/qdepends.c
index e6b9bcf..92ae57b 100644
--- a/qdepends.c
+++ b/qdepends.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005-2018 Gentoo Authors
+ * Copyright 2005-2019 Gentoo Authors
  * Distributed under the terms of the GNU General Public License v2
  *
  * Copyright 2005-2010 Ned Ludd- 
@@ -9,11 +9,12 @@
 
 #ifdef APPLET_qdepends
 
-#define QDEPENDS_FLAGS "drpafNk:Q:" COMMON_FLAGS
+#define QDEPENDS_FLAGS "drpbafNk:Q:" COMMON_FLAGS
 static struct option const qdepends_long_opts[] = {
{"depend",no_argument, NULL, 'd'},
{"rdepend",   no_argument, NULL, 'r'},
{"pdepend",   no_argument, NULL, 'p'},
+   {"bdepend",   no_argument, NULL, 'b'},
{"key",a_argument, NULL, 'k'},
{"query",  a_argument, NULL, 'Q'},
{"name-only", no_argument, NULL, 'N'},
@@ -25,6 +26,7 @@ static const char * const qdepends_opts_help[] = {
"Show DEPEND info (default)",
"Show RDEPEND info",
"Show PDEPEND info",
+   "Show BDEPEND info",
"User defined vdb key",
"Query reverse deps",
"Only show package name",
@@ -639,7 +641,13 @@ int qdepends_main(int argc, char **argv)
bool do_format = false;
const char *query = NULL;
const char *depend_file;
-   const char *depend_files[] = { "DEPEND", "RDEPEND", "PDEPEND", NULL, 
NULL };
+   const char *depend_files[] = {
+   /* 0 */ "DEPEND",
+   /* 1 */ "RDEPEND",
+   /* 2 */ "PDEPEND",
+   /* 3 */ "BDEPEND",
+   /* 4 */ NULL
+   };
 
depend_file = depend_files[0];
 
@@ -650,6 +658,7 @@ int qdepends_main(int argc, char **argv)
case 'd': depend_file = dep

[gentoo-commits] proj/portage-utils:master commit in: man/, /, man/include/

2019-03-29 Thread Fabian Groffen
commit: c701892114d5b3eea773ff13f013f4d3a71fa571
Author: Fabian Groffen  gentoo  org>
AuthorDate: Fri Mar 29 16:31:50 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Fri Mar 29 16:31:50 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=c7018921

qlop: support standard date output format in parse_date

This allows to cut 'n' paste dates to limit output.

Signed-off-by: Fabian Groffen  gentoo.org>

 man/include/qlop.optdesc.yaml |  3 +++
 man/qlop.1|  5 -
 qlop.c| 14 +-
 3 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/man/include/qlop.optdesc.yaml b/man/include/qlop.optdesc.yaml
index a8fae61..25143b2 100644
--- a/man/include/qlop.optdesc.yaml
+++ b/man/include/qlop.optdesc.yaml
@@ -13,6 +13,9 @@ date: |
 .IP -MM-DD
 Big-endian date, with components separated by hyphens, starting with
 year, followed by month and day of month.
+.IP -MM-DDThh:mm:ss
+As before, but hours, minutes and seconds added.  This is the same
+format qlop prints for timestamps.
 .IP S
 Seconds since 1970-01-01 00:00:00 + (UTC), the UNIX epoch.
 .IP FORMAT|DATE

diff --git a/man/qlop.1 b/man/qlop.1
index 407c9ea..f0ef69a 100644
--- a/man/qlop.1
+++ b/man/qlop.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qlop "1" "Feb 2019" "Gentoo Foundation" "qlop"
+.TH qlop "1" "Mar 2019" "Gentoo Foundation" "qlop"
 .SH NAME
 qlop \- emerge log analyzer
 .SH SYNOPSIS
@@ -89,6 +89,9 @@ Alias for \fI1 day ago\fR.
 .IP -MM-DD
 Big-endian date, with components separated by hyphens, starting with
 year, followed by month and day of month.
+.IP -MM-DDThh:mm:ss
+As before, but hours, minutes and seconds added.  This is the same
+format qlop prints for timestamps.
 .IP S
 Seconds since 1970-01-01 00:00:00 + (UTC), the UNIX epoch.
 .IP FORMAT|DATE

diff --git a/qlop.c b/qlop.c
index b6970d0..a87cc5c 100644
--- a/qlop.c
+++ b/qlop.c
@@ -103,17 +103,21 @@ parse_date(const char *sdate, time_t *t)
return false;
} else {
/* Handle automatic formats:
-* - "12315128"   -> %s
-* - "2015-12-24" -> %Y-%m-%d
+* - "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-");
+   size_t len = strspn(sdate, "0123456789-:T");
if (sdate[len] == '\0') {
const char *fmt;
-   if (strchr(sdate, '-') == NULL)
+   if (strchr(sdate, '-') == NULL) {
fmt = "%s";
-   else
+   } else if ((s = strchr(sdate, 'T')) == NULL) {
fmt = "%Y-%m-%d";
+   } else {
+   fmt = "%Y-%m-%dT%H:%M:%S";
+   }
 
s = strptime(sdate, fmt, &tm);
if (s == NULL || s[0] != '\0')



[gentoo-commits] proj/portage-utils:master commit in: man/, man/include/, /

2019-05-13 Thread Fabian Groffen
commit: 7854ca6d12f793f3b516373784831131db36bca9
Author: Fabian Groffen  gentoo  org>
AuthorDate: Mon May 13 12:56:30 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Mon May 13 12:56:30 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=7854ca6d

qlop: add mode for listing last emerge contents

add -l flag to list packages/sync from last emerge operation and make it
default (when no flags are given)

Signed-off-by: Fabian Groffen  gentoo.org>

 TODO.md   |  2 --
 man/include/qlop.desc |  5 ++--
 man/include/qlop.optdesc.yaml |  3 +++
 man/qlop.1|  9 +--
 qlop.c| 62 ---
 5 files changed, 60 insertions(+), 21 deletions(-)

diff --git a/TODO.md b/TODO.md
index 7df8983..58ea4c5 100644
--- a/TODO.md
+++ b/TODO.md
@@ -83,8 +83,6 @@
 
 - have a mode that doesn't print timestamp (to get just atoms, -v should
   work)
-- make a -d mode that allows to do equivalent of "last portage emerge"
-  to make it easy to see what was newly merged/unmerged
 
 # qlist
 - have -F for use with -I so one can do things like print SLOT for

diff --git a/man/include/qlop.desc b/man/include/qlop.desc
index 0c14e00..3505173 100644
--- a/man/include/qlop.desc
+++ b/man/include/qlop.desc
@@ -2,9 +2,10 @@
 reads from $EMERGE_LOG_DIR/emerge.log and tries to extract
 information about merges, unmerges and syncs.  It can
 calculate average merge times or just list them.  When given no
-arguments or just \fB-v\fR, \fIqlop\fR acts as if \fB-must\fR was given
+arguments or just \fB-v\fR, \fIqlop\fR acts as if \fB-slumt\fR was given
 and thus lists the time taken for all occurrances of merges, unmerges
-and sync operations found in the log.
+and sync operations found in the log for the last \fBemerge\fR(1) action
+performed by Portage.
 .P
 By default, packages are printed as CATEGORY/PN.  Use \fB-v\fR to print
 the package version and revision numbers, e.g\. CATEGORY/PF.  Note that

diff --git a/man/include/qlop.optdesc.yaml b/man/include/qlop.optdesc.yaml
index 25143b2..677c4d2 100644
--- a/man/include/qlop.optdesc.yaml
+++ b/man/include/qlop.optdesc.yaml
@@ -21,6 +21,9 @@ date: |
 .IP FORMAT|DATE
 Use \fIFORMAT\fR as input for \fBstrptime\fR(3) to parse \fIDATE\fR.
 .RE
+lastmerge: |
+Limit selection to last Portage emerge action.  This option is a
+dynamic version of \fB-d\fR, and hence both cannot be used together.
 time: |
 Show the time it took to merge, unmerge or sync.
 average: |

diff --git a/man/qlop.1 b/man/qlop.1
index 83b62f8..ae40fa7 100644
--- a/man/qlop.1
+++ b/man/qlop.1
@@ -10,9 +10,10 @@ qlop \- emerge log analyzer
 reads from $EMERGE_LOG_DIR/emerge.log and tries to extract
 information about merges, unmerges and syncs.  It can
 calculate average merge times or just list them.  When given no
-arguments or just \fB-v\fR, \fIqlop\fR acts as if \fB-must\fR was given
+arguments or just \fB-v\fR, \fIqlop\fR acts as if \fB-slumt\fR was given
 and thus lists the time taken for all occurrances of merges, unmerges
-and sync operations found in the log.
+and sync operations found in the log for the last \fBemerge\fR(1) action
+performed by Portage.
 .P
 By default, packages are printed as CATEGORY/PN.  Use \fB-v\fR to print
 the package version and revision numbers, e.g\. CATEGORY/PF.  Note that
@@ -98,6 +99,10 @@ Seconds since 1970-01-01 00:00:00 + (UTC), the UNIX 
epoch.
 Use \fIFORMAT\fR as input for \fBstrptime\fR(3) to parse \fIDATE\fR.
 .RE
 .TP
+\fB\-l\fR, \fB\-\-lastmerge\fR
+Limit selection to last Portage emerge action.  This option is a
+dynamic version of \fB-d\fR, and hence both cannot be used together.
+.TP
 \fB\-f\fR \fI\fR, \fB\-\-logfile\fR \fI\fR
 Read emerge logfile instead of $EMERGE_LOG_DIR/emerge.log.
 .TP

diff --git a/qlop.c b/qlop.c
index a60e5ac..5217638 100644
--- a/qlop.c
+++ b/qlop.c
@@ -24,7 +24,7 @@
 
 #define QLOP_DEFAULT_LOGFILE "emerge.log"
 
-#define QLOP_FLAGS "ctaHMmuUserd:f:w:" COMMON_FLAGS
+#define QLOP_FLAGS "ctaHMmuUslerd:f:w:" COMMON_FLAGS
 static struct option const qlop_long_opts[] = {
{"summary",   no_argument, NULL, 'c'},
{"time",  no_argument, NULL, 't'},
@@ -38,6 +38,7 @@ static struct option const qlop_long_opts[] = {
{"endtime",   no_argument, NULL, 'e'},
{"running",   no_argument, NULL, 'r'},
{"date",   a_argument, NULL, 'd'},
+   {"lastmerge", no_argument, NULL, 'l'},
{"logfile",a_argument, NULL, 'f'},
{"atoms",  a_argument, NULL, 'w'},
COMMON_LONG_OPTS
@@ -55,6 +56,7 @@ static const char * const qlop_opts_help[] = {
"Report time at which the operation finished (iso started)",
"Show current emerging packages",
"Limit selection to this time (1st -d is start, 2nd -d is end)",
+   "Limit selection to last Portage emerge action",
"Read emerge logfile instead of $EMERGE_LOG_

[gentoo-commits] proj/portage-utils:master commit in: man/, /, man/include/

2019-05-13 Thread Fabian Groffen
commit: 966de456d8af3b5102950e608a771f776efdd014
Author: Fabian Groffen  gentoo  org>
AuthorDate: Mon May 13 13:37:31 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Mon May 13 13:37:31 2019 +
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",
+  

[gentoo-commits] proj/portage-utils:master commit in: man/, /, man/include/

2019-05-17 Thread Fabian Groffen
commit: 5531d5c97a27c002abfcc1bd229d0716bba4b2e3
Author: Fabian Groffen  gentoo  org>
AuthorDate: Fri May 17 14:34:09 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Fri May 17 14:34:09 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=5531d5c9

qfile: allow matching basenames to objects by default

one can now do qfile qfile to find app-portage/portage-utils
updated the manpage somewhat

Signed-off-by: Fabian Groffen  gentoo.org>

 man/include/qfile-01-owners.include | 30 ++-
 man/include/qfile-02-orphans.include| 15 +++---
 man/include/qfile-03-ROOT.include   | 20 
 man/include/qfile-05-collisions.include |  8 +--
 man/include/qfile.desc  | 23 +
 man/include/qfile.optdesc.yaml  |  4 ++
 man/qfile.1 | 88 -
 qfile.c | 35 -
 8 files changed, 140 insertions(+), 83 deletions(-)

diff --git a/man/include/qfile-01-owners.include 
b/man/include/qfile-01-owners.include
index a4bdc76..39b1e03 100644
--- a/man/include/qfile-01-owners.include
+++ b/man/include/qfile-01-owners.include
@@ -1,16 +1,14 @@
 .SH "FINDING FILE OWNERS"
 .PP
-This is the default behavior of \fBqfile\fP.  It will list the packages which
-own the files (or directories, or symlinks, or anything else Portage can 
-install) you are querying.  Query items may be file paths or simple file
-names when the \fB\-b\fP option is used.
-By default, output includes packages names and the complete paths to
-the matching files.  If using \fB\-\-exact\fP, versions of the packages will 
-also be shown.  At the contrary, when using \fB\-\-quiet\fP, only package 
-names are listed, without files paths.  Finally, \fB\-\-verbose\fP is similar
-to \fB\-\-exact\fP, but may add a few warnings.  The return status of 
-\fBqfile\fP will be \fI0\fP as soon as an owning package has been found for 
-one of the query items.
+This is the default behavior of \fBqfile\fP.  It will list the packages
+which own the files (or directories, or symlinks, or anything else
+Portage can install) you are querying.  Query items may be file paths or
+simple file names.  By default, output includes packages names and the
+complete paths to the matching files.  If using \fB\-\-verbose\fP,
+versions of the packages will also be shown.  In contrast, when using
+\fB\-\-quiet\fP, only package names are listed, without files paths.
+The return status of \fBqfile\fP will be \fI0\fP as soon as an owning
+package has been found for one of the query items.
 .PP
 Find names of package(s) owning "/bin/bash":
 .nf\fI
@@ -20,17 +18,17 @@ Find names of package(s) owning "/bin/bash":
 .PP
 Find package(s) owning any file named "bash", and show paths of this files:
 .nf\fI
-   $ qfile -b bash
-   app-shells/bash (/bin/bash)
-   app-shells/bash (/etc/bash)
+   $ qfile -d bash
+   app-shells/bash: /bin/bash
+   app-shells/bash: /etc/bash
 .fi
 .PP
 Find packages(s) owning the file named "bash" in the current directory. Also 
 display their exact version:
 .nf\fI
$ cd /bin
-   $ qfile -e ./bash
-   app-shells/bash-3.1_p17 (/bin/bash)
+   $ qfile -v ./bash
+   app-shells/bash-3.1_p17: /bin/bash
 .fi
 .PP
 Find the package(s) owning the libraries needed by the Bash binary:

diff --git a/man/include/qfile-02-orphans.include 
b/man/include/qfile-02-orphans.include
index ca23796..f6754aa 100644
--- a/man/include/qfile-02-orphans.include
+++ b/man/include/qfile-02-orphans.include
@@ -1,13 +1,12 @@
 .SH "FINDING ORPHAN FILES"
 .PP
-\fBqfile\fP can also, with the \fB\-\-orphans\fP option, find files which are 
-not owned by any package.  This behavior is the opposite of the usual file 
-owner search: the output is the list of query items for which no reference has
-been found in your installed packages database.  The \fB\-\-exact\fP option has
-no effect in this mode, whereas \fB\-\-verbose\fP may add a few warning 
-messages.  As for \fB\-\-quiet\fP, it will completly turn off the output, 
-leaving just a silent test command, which returns \fI0\fP if and only if
-there was no orphan in your query items.
+\fBqfile\fP can also, with the \fB\-\-orphans\fP option, find files
+which are not owned by any package.  This behaviour is the opposite of
+the usual file owner search: the output is the list of query items for
+which no reference has been found in your installed packages database.
+As for \fB\-\-quiet\fP, it will completly turn off the output, leaving
+just a silent test command, which returns \fI0\fP if and only if there
+was no orphan in your query items.
 .PP
 Find the orphan libtool files of your system:
 .nf\fI

diff --git a/man/include/qfile-03-ROOT.include 
b/man/include/qfile-03-ROOT.include
index 61d965d..3bfbe51 100644
--- a/man/include/qfile-03-ROOT.include
+++ b/man/include/qfile-03-ROOT.include
@@ -1,7 +1,7 @@
 .SH "$ROOT HANDLING"
 .PP

[gentoo-commits] proj/portage-utils:master commit in: man/, /, man/include/

2019-06-09 Thread Fabian Groffen
commit: c0b88fe2b32679f1548a280d906b82b1651cd804
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sun Jun  9 09:51:26 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sun Jun  9 09:51:26 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=c0b88fe2

qgrep: print filename for matches by default, fix atom_compare call

remove very similar vdb callback in favour of generic tree one
format atoms using atom_format for consistency and ease of use
retrieve full atoms when SLOT or REPO matches are attempted

Signed-off-by: Fabian Groffen  gentoo.org>

 man/include/qgrep.optdesc.yaml |   2 +-
 man/qgrep.1|  41 -
 qgrep.c| 100 +++--
 3 files changed, 47 insertions(+), 96 deletions(-)

diff --git a/man/include/qgrep.optdesc.yaml b/man/include/qgrep.optdesc.yaml
index ad3874d..9716bf0 100644
--- a/man/include/qgrep.optdesc.yaml
+++ b/man/include/qgrep.optdesc.yaml
@@ -1,4 +1,4 @@
 verbose: |
 Prefix each matching line with filename (like \fB-H\fR).  When this
 option is given multiple times, also linenumbers are printed.
-quiet: Ignored for compatibility with other qapplets.
+quiet: Do not prefix each match with filename.

diff --git a/man/qgrep.1 b/man/qgrep.1
index 180b5dd..6701061 100644
--- a/man/qgrep.1
+++ b/man/qgrep.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qgrep "1" "May 2019" "Gentoo Foundation" "qgrep"
+.TH qgrep "1" "Jun 2019" "Gentoo Foundation" "qgrep"
 .SH NAME
 qgrep \- grep in ebuilds
 .SH SYNOPSIS
@@ -20,66 +20,63 @@ Select non-matching lines.
 \fB\-i\fR, \fB\-\-ignore\-case\fR
 Ignore case distinctions.
 .TP
-\fB\-H\fR, \fB\-\-with\-filename\fR
-Print the filename for each match.
-.TP
 \fB\-N\fR, \fB\-\-with\-name\fR
-Print the package or eclass name for each match.
+Print the filename for each match.
 .TP
 \fB\-c\fR, \fB\-\-count\fR
-Only print a count of matching lines per FILE.
+Print the package or eclass name for each match.
 .TP
 \fB\-l\fR, \fB\-\-list\fR
-Only print FILE names containing matches.
+Only print a count of matching lines per FILE.
 .TP
 \fB\-L\fR, \fB\-\-invert\-list\fR
-Only print FILE names containing no match.
+Only print FILE names containing matches.
 .TP
 \fB\-e\fR, \fB\-\-regexp\fR
-Use PATTERN as a regular expression.
+Only print FILE names containing no match.
 .TP
 \fB\-x\fR, \fB\-\-extended\fR
-Use PATTERN as an extended regular expression.
+Use PATTERN as a regular expression.
 .TP
 \fB\-J\fR, \fB\-\-installed\fR
-Search in installed ebuilds instead of the tree.
+Use PATTERN as an extended regular expression.
 .TP
 \fB\-E\fR, \fB\-\-eclass\fR
-Search in eclasses instead of ebuilds.
+Search in installed ebuilds instead of the tree.
 .TP
 \fB\-s\fR, \fB\-\-skip\-comments\fR
-Skip comments lines.
+Search in eclasses instead of ebuilds.
 .TP
 \fB\-R\fR, \fB\-\-repo\fR
-Print source repository name for each match (implies -N).
+Skip comments lines.
 .TP
 \fB\-S\fR \fI\fR, \fB\-\-skip\fR \fI\fR
-Skip lines matching .
+Print source repository name for each match (implies -N).
 .TP
 \fB\-B\fR \fI\fR, \fB\-\-before\fR \fI\fR
-Print  lines of leading context.
+Skip lines matching .
 .TP
 \fB\-A\fR \fI\fR, \fB\-\-after\fR \fI\fR
-Print  lines of trailing context.
+Print  lines of leading context.
 .TP
 \fB\-\-root\fR \fI\fR
-Set the ROOT env var.
+Print  lines of trailing context.
 .TP
 \fB\-v\fR, \fB\-\-verbose\fR
 Prefix each matching line with filename (like \fB-H\fR).  When this
 option is given multiple times, also linenumbers are printed.
 .TP
 \fB\-q\fR, \fB\-\-quiet\fR
-Ignored for compatibility with other qapplets.
+Do not prefix each match with filename.
 .TP
 \fB\-C\fR, \fB\-\-nocolor\fR
-Don't output color.
+Tighter output; suppress warnings.
 .TP
 \fB\-h\fR, \fB\-\-help\fR
-Print this help and exit.
+Don't output color.
 .TP
 \fB\-V\fR, \fB\-\-version\fR
-Print version and exit.
+Print this help and exit.
 
 .SH "REPORTING BUGS"
 Please report bugs via http://bugs.gentoo.org/

diff --git a/qgrep.c b/qgrep.c
index dff959b..058026e 100644
--- a/qgrep.c
+++ b/qgrep.c
@@ -24,11 +24,10 @@
 #include "xchdir.h"
 #include "xregex.h"
 
-#define QGREP_FLAGS "IiHNclLexJEsRS:B:A:" COMMON_FLAGS
+#define QGREP_FLAGS "IiNclLexJEsRS:B:A:" COMMON_FLAGS
 static struct option const qgrep_long_opts[] = {
{"invert-match",  no_argument, NULL, 'I'},
{"ignore-case",   no_argument, NULL, 'i'},
-   {"with-filename", no_argument, NULL, 'H'},
{"with-name", no_argument, NULL, 'N'},
{"count", no_argument, NULL, 'c'},
{"list",  no_argument, NULL, 'l'},
@@ -398,6 +397,8 @@ qgrep_cache_cb(tree_pkg_ctx *pkg_ctx, void *priv)
if (data->include_atoms != NULL) {
depend_atom **d;
for (d = data->include_atoms; *d != NULL; d++) {
+   if ((*d)->SLOT != NULL || (*d)->REPO != NULL)
+  

[gentoo-commits] proj/portage-utils:master commit in: man/, /, man/include/

2019-04-28 Thread Fabian Groffen
commit: c5aba3a0bd055688120dbabb9c3826ed46ffc795
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sun Apr 28 07:57:05 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sun Apr 28 07:57:05 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=c5aba3a0

qgrep: rewrite using libq/vdb and libq/cache

(re)use the traversion logic from libq instead of re-implementing this.
Additional benefits are less code and usage of metadata when available.

Signed-off-by: Fabian Groffen  gentoo.org>

 applets.h  |   2 +-
 man/include/qgrep.desc |   9 +-
 man/include/qgrep.optdesc.yaml |   5 +-
 man/q.1|   2 +-
 man/qgrep.1|  16 +-
 qgrep.c| 756 ++---
 6 files changed, 429 insertions(+), 361 deletions(-)

diff --git a/applets.h b/applets.h
index 5889de6..4dd5bc2 100644
--- a/applets.h
+++ b/applets.h
@@ -73,7 +73,7 @@ static const struct applet_t {
/*
{"qglsa", qglsa_main, " ", "check GLSAs against 
system"},
*/
-   {"qgrep", qgrep_main, "", "grep in ebuilds"},
+   {"qgrep", qgrep_main, " [pkg ...]", "grep in ebuilds"},
{"qlist", qlist_main, "",   "list files owned by 
pkgname"},
{"qlop",  qlop_main,  "",   "emerge log analyzer"},
{"qmerge",qmerge_main,"",  "fetch and merge 
binary package"},

diff --git a/man/include/qgrep.desc b/man/include/qgrep.desc
index c95d35a..98bcc09 100644
--- a/man/include/qgrep.desc
+++ b/man/include/qgrep.desc
@@ -1,3 +1,6 @@
-\fIqgrep\fR searches for a given pattern in all ebuilds of the current
-portage tree.  Optionally the search is in all eclasses, or just in the
-ebuilds that are currently installed.
+\fIqgrep\fR searches for a given expression in all ebuilds of the
+current portage tree and defined additional overlays.  Optionally the
+search is in all eclasses, or just in the ebuilds that are currently
+installed.  To narrow the search, multiple targets can be given using
+atom syntax.  In particular, the trailing slash (/) syntax can be used
+to match an entire category.  See also \fIqatom\fR(1).

diff --git a/man/include/qgrep.optdesc.yaml b/man/include/qgrep.optdesc.yaml
index 87b174e..ad3874d 100644
--- a/man/include/qgrep.optdesc.yaml
+++ b/man/include/qgrep.optdesc.yaml
@@ -1,5 +1,4 @@
 verbose: |
-Print multiple matches per files.  When this option is given
-multiple times, also linenumber are printed for matches next to file
-names.
+Prefix each matching line with filename (like \fB-H\fR).  When this
+option is given multiple times, also linenumbers are printed.
 quiet: Ignored for compatibility with other qapplets.

diff --git a/man/q.1 b/man/q.1
index b3e985b..afba24a 100644
--- a/man/q.1
+++ b/man/q.1
@@ -41,7 +41,7 @@ Print version and exit.
qcheck: verify integrity of installed packages
  qdepends: show dependency info
 qfile   : list all pkgs owning files
-qgrep  : grep in ebuilds
+qgrep  [pkg ...]: grep in ebuilds
 qlist: list files owned by pkgname
  qlop: emerge log analyzer
qmerge   : fetch and merge binary package

diff --git a/man/qgrep.1 b/man/qgrep.1
index 662122d..048e28e 100644
--- a/man/qgrep.1
+++ b/man/qgrep.1
@@ -4,11 +4,14 @@
 qgrep \- grep in ebuilds
 .SH SYNOPSIS
 .B qgrep
-\fI[opts] \fR
+\fI[opts]  [pkg ...]\fR
 .SH DESCRIPTION
-\fIqgrep\fR searches for a given pattern in all ebuilds of the current
-portage tree.  Optionally the search is in all eclasses, or just in the
-ebuilds that are currently installed.
+\fIqgrep\fR searches for a given expression in all ebuilds of the
+current portage tree and defined additional overlays.  Optionally the
+search is in all eclasses, or just in the ebuilds that are currently
+installed.  To narrow the search, multiple targets can be given using
+atom syntax.  In particular, the trailing slash (/) syntax can be used
+to match an entire category.  See also \fIqatom\fR(1).
 .SH OPTIONS
 .TP
 \fB\-I\fR, \fB\-\-invert\-match\fR
@@ -60,9 +63,8 @@ Print  lines of trailing context.
 Set the ROOT env var.
 .TP
 \fB\-v\fR, \fB\-\-verbose\fR
-Print multiple matches per files.  When this option is given
-multiple times, also linenumber are printed for matches next to file
-names.
+Prefix each matching line with filename (like \fB-H\fR).  When this
+option is given multiple times, also linenumbers are printed.
 .TP
 \fB\-q\fR, \fB\-\-quiet\fR
 Ignored for compatibility with other qapplets.

diff --git a/qgrep.c b/qgrep.c
index 16bb4c1..3950c22 100644
--- a/qgrep.c
+++ b/qgrep.c
@@ -64,35 +64,6 @@ static const char * const qgrep_opts_help[] = {
 };
 #define qgrep_usage(ret) usage(ret, QGREP_FLAGS, qgrep_long_opts, 
qgrep_opts_help, NULL, lookup_applet_idx("qgrep"))
 
-static char
-qgrep_name_match(const char* name, const int argc, depend_atom** a

[gentoo-commits] proj/portage-utils:master commit in: man/, man/include/, /

2019-02-05 Thread Fabian Groffen
commit: 5674671e9d7e0e1251561d81a1154dd5d92e60ec
Author: Fabian Groffen  gentoo  org>
AuthorDate: Tue Feb  5 13:47:59 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Tue Feb  5 13:50:23 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=5674671e

qdepends: add support for BDEPEND

Bug: https://bugs.gentoo.org/674936
Signed-off-by: Fabian Groffen  gentoo.org>

 man/include/qdepends.optdesc.yaml |  8 
 man/qdepends.1| 13 -
 qdepends.c| 15 ---
 3 files changed, 24 insertions(+), 12 deletions(-)

diff --git a/man/include/qdepends.optdesc.yaml 
b/man/include/qdepends.optdesc.yaml
index 51b1cc7..5d786f3 100644
--- a/man/include/qdepends.optdesc.yaml
+++ b/man/include/qdepends.optdesc.yaml
@@ -1,13 +1,13 @@
 all: |
-Show *DEPEND, alias for \fB\-drp\fR.
+Show *DEPEND, alias for \fB\-drpb\fR.
 key: |
 Advanced option to allow querying the VDB.  This option overrides
-\fB\-d\fR, \fB\-r\fR, \fB\-p\fR or \fB\-a\fR.  \fI\fR can be
-any key from Portage's VDB, e.g.\ any file from
+\fB\-d\fR, \fB\-r\fR, \fB\-p\fR, \fB\-b\fR or \fB\-a\fR.
+\fI\fR can be any key from Portage's VDB, e.g.\ any file from
 var/db/pkg///.
 query: |
 Query reverse deps.  This basically reverses the search to any
-package that references \fI\fR in DEPEND, RDEPEND or PDEPEND.
+package that references \fI\fR in DEPEND, RDEPEND, PDEPEND or BDEPEND.
 This can be useful to find consumers of a given package, e.g.\ to
 search for packages that have \fIlogwatch\fR in their DEPEND.
 name-only: |

diff --git a/man/qdepends.1 b/man/qdepends.1
index 2e1aab2..0273999 100644
--- a/man/qdepends.1
+++ b/man/qdepends.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qdepends "1" "May 2018" "Gentoo Foundation" "qdepends"
+.TH qdepends "1" "Feb 2019" "Gentoo Foundation" "qdepends"
 .SH NAME
 qdepends \- show dependency info
 .SH SYNOPSIS
@@ -32,15 +32,18 @@ Show RDEPEND info.
 \fB\-p\fR, \fB\-\-pdepend\fR
 Show PDEPEND info.
 .TP
+\fB\-b\fR, \fB\-\-bdepend\fR
+Show BDEPEND info.
+.TP
 \fB\-k\fR \fI\fR, \fB\-\-key\fR \fI\fR
 Advanced option to allow querying the VDB.  This option overrides
-\fB\-d\fR, \fB\-r\fR, \fB\-p\fR or \fB\-a\fR.  \fI\fR can be
-any key from Portage's VDB, e.g.\ any file from
+\fB\-d\fR, \fB\-r\fR, \fB\-p\fR, \fB\-b\fR or \fB\-a\fR.
+\fI\fR can be any key from Portage's VDB, e.g.\ any file from
 var/db/pkg///.
 .TP
 \fB\-Q\fR \fI\fR, \fB\-\-query\fR \fI\fR
 Query reverse deps.  This basically reverses the search to any
-package that references \fI\fR in DEPEND, RDEPEND or PDEPEND.
+package that references \fI\fR in DEPEND, RDEPEND, PDEPEND or BDEPEND.
 This can be useful to find consumers of a given package, e.g.\ to
 search for packages that have \fIlogwatch\fR in their DEPEND.
 .TP
@@ -48,7 +51,7 @@ search for packages that have \fIlogwatch\fR in their DEPEND.
 Only show category/package, instead of category/package-version.
 .TP
 \fB\-a\fR, \fB\-\-all\fR
-Show *DEPEND, alias for \fB\-drp\fR.
+Show *DEPEND, alias for \fB\-drpb\fR.
 .TP
 \fB\-f\fR, \fB\-\-format\fR
 Pretty-print DEPEND declaration to be used in an ebuild.  This

diff --git a/qdepends.c b/qdepends.c
index e6b9bcf..92ae57b 100644
--- a/qdepends.c
+++ b/qdepends.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005-2018 Gentoo Authors
+ * Copyright 2005-2019 Gentoo Authors
  * Distributed under the terms of the GNU General Public License v2
  *
  * Copyright 2005-2010 Ned Ludd- 
@@ -9,11 +9,12 @@
 
 #ifdef APPLET_qdepends
 
-#define QDEPENDS_FLAGS "drpafNk:Q:" COMMON_FLAGS
+#define QDEPENDS_FLAGS "drpbafNk:Q:" COMMON_FLAGS
 static struct option const qdepends_long_opts[] = {
{"depend",no_argument, NULL, 'd'},
{"rdepend",   no_argument, NULL, 'r'},
{"pdepend",   no_argument, NULL, 'p'},
+   {"bdepend",   no_argument, NULL, 'b'},
{"key",a_argument, NULL, 'k'},
{"query",  a_argument, NULL, 'Q'},
{"name-only", no_argument, NULL, 'N'},
@@ -25,6 +26,7 @@ static const char * const qdepends_opts_help[] = {
"Show DEPEND info (default)",
"Show RDEPEND info",
"Show PDEPEND info",
+   "Show BDEPEND info",
"User defined vdb key",
"Query reverse deps",
"Only show package name",
@@ -639,7 +641,13 @@ int qdepends_main(int argc, char **argv)
bool do_format = false;
const char *query = NULL;
const char *depend_file;
-   const char *depend_files[] = { "DEPEND", "RDEPEND", "PDEPEND", NULL, 
NULL };
+   const char *depend_files[] = {
+   /* 0 */ "DEPEND",
+   /* 1 */ "RDEPEND",
+   /* 2 */ "PDEPEND",
+   /* 3 */ "BDEPEND",
+   /* 4 */ NULL
+   };
 
depend_file = depend_files[0];
 
@@ -650,6 +658,7 @@ int qdepends_main(int argc, char **argv)
case 'd': depend_file = dep

[gentoo-commits] proj/portage-utils:master commit in: man/, /, man/include/

2019-03-07 Thread Fabian Groffen
commit: 9ae56f85211d2c7c00b77b836e797339fc76f9b8
Author: Fabian Groffen  gentoo  org>
AuthorDate: Thu Mar  7 18:18:47 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Thu Mar  7 18:18:47 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=9ae56f85

qlist: change -U to display disabled flags with -v

reimplement umapstr() to allow printing flags not enabled, this is
slightly related to bug #656550.

Signed-off-by: Fabian Groffen  gentoo.org>

 man/include/qlist.optdesc.yaml |   2 +-
 man/qlist.1|   4 +-
 qlist.c| 183 ++---
 3 files changed, 119 insertions(+), 70 deletions(-)

diff --git a/man/include/qlist.optdesc.yaml b/man/include/qlist.optdesc.yaml
index a60ef0d..2b9299c 100644
--- a/man/include/qlist.optdesc.yaml
+++ b/man/include/qlist.optdesc.yaml
@@ -19,6 +19,6 @@ verbose: |
 When listing the package contents, a single \fB\-v\fR displays
 symlinks with an arrow (\->) to their target.  Two or more \fB\-v\fR
 adds colour to the entries and prints like \fB\-I\fR before the
-listing.
+listing.  Shows disabled USE-flags when used with \fB\-U\fR.
 quiet: |
 Suppresses the parenthesis around the USE-flags when used with \fB\-U\fR.

diff --git a/man/qlist.1 b/man/qlist.1
index c2c585c..4df7dab 100644
--- a/man/qlist.1
+++ b/man/qlist.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qlist "1" "Feb 2019" "Gentoo Foundation" "qlist"
+.TH qlist "1" "Mar 2019" "Gentoo Foundation" "qlist"
 .SH NAME
 qlist \- list files owned by pkgname
 .SH SYNOPSIS
@@ -60,7 +60,7 @@ When used with \fB\-I\fR, print the package version next to 
name.
 When listing the package contents, a single \fB\-v\fR displays
 symlinks with an arrow (\->) to their target.  Two or more \fB\-v\fR
 adds colour to the entries and prints like \fB\-I\fR before the
-listing.
+listing.  Shows disabled USE-flags when used with \fB\-U\fR.
 .TP
 \fB\-q\fR, \fB\-\-quiet\fR
 Suppresses the parenthesis around the USE-flags when used with \fB\-U\fR.

diff --git a/qlist.c b/qlist.c
index 4a3b95a..3ca3f5e 100644
--- a/qlist.c
+++ b/qlist.c
@@ -43,84 +43,124 @@ static const char * const qlist_opts_help[] = {
 };
 #define qlist_usage(ret) usage(ret, QLIST_FLAGS, qlist_long_opts, 
qlist_opts_help, NULL, lookup_applet_idx("qlist"))
 
-static char *
-grab_pkg_umap(q_vdb_pkg_ctx *pkg_ctx)
+static int
+cmpstringp(const void *p1, const void *p2)
+{
+   /* case insensitive comparator */
+   return strcasecmp(*((char * const *)p1), *((char * const *)p2));
+}
+
+/*
+ * ==> /var/db/pkg/mail-mta/exim-4.92/IUSE <==
+ * arc dane dcc +dkim dlfunc dmarc +dnsdb doc dovecot-sasl dsn
+ * elibc_glibc exiscan-acl gnutls idn ipv6 ldap libressl lmtp maildir
+ * mbx mysql nis pam perl pkcs11 postgres +prdr proxy radius redis sasl
+ * selinux spf sqlite srs ssl syslog tcpd +tpda X
+ *
+ * ==> /var/db/pkg/mail-mta/exim-4.92/PKGUSE <==
+ * -X dkim dmarc exiscan-acl ipv6 -ldap lmtp maildir -mbox pam -perl spf
+ * ssl tcpd
+ *
+ * ==> /var/db/pkg/mail-mta/exim-4.92/USE <==
+ * abi_x86_64 amd64 dkim dmarc dnsdb elibc_glibc exiscan-acl ipv6
+ * kernel_linux lmtp maildir pam prdr spf ssl tcpd tpda userland_GNU
+ *
+ * % emerge -pv exim
+ *
+ * These are the packages that would be merged, in order:
+ *
+ * Calculating dependencies... done!
+ * [ebuild   R   ~] mail-mta/exim-4.92::gentoo  USE="dkim dmarc dnsdb
+ * exiscan-acl ipv6 lmtp maildir pam prdr spf ssl tcpd tpda -X -arc
+ * -dane -dcc -dlfunc -doc -dovecot-sasl -dsn -gnutls -idn -ldap
+ * -libressl -mbx -mysql -nis -perl -pkcs11 -postgres -proxy -radius
+ * -redis -sasl (-selinux) -sqlite -srs -syslog" 0 KiB
+ *
+ * % qlist -IUv exim
+ * mail-mta/exim-4.92 (-arc -dane -dcc dkim -dlfunc dmarc dnsdb -doc
+ * -dovecot-sasl -dsn exiscan-acl -gnutls -idn ipv6 -ldap -libressl lmtp
+ * maildir -mbx -mysql -nis pam -perl -pkcs11 -postgres prdr -proxy
+ * -radius -redis -sasl -selinux spf -sqlite -srs ssl -syslog tcpd tpda
+ * -X)
+ */
+static char _umapstr_buf[BUFSIZ];
+static const char *
+umapstr(char display, q_vdb_pkg_ctx *pkg_ctx)
 {
-   static char umap[BUFSIZ];
-   static char *use, *iuse;
-   static size_t use_len, iuse_len;
-   int use_argc = 0, iuse_argc = 0;
-   char **use_argv = NULL, **iuse_argv = NULL;
-   queue *ll = NULL;
-   queue *sets = NULL;
-   int i, u;
+   char *bufp = _umapstr_buf;
+   char *use = NULL;
+   char *iuse = NULL;
+   size_t use_len;
+   size_t iuse_len;
+   int use_argc = 0;
+   int iuse_argc = 0;
+   char **use_argv = NULL;
+   char **iuse_argv = NULL;
+   int i;
+   int u;
+   int d;
+
+   *bufp = '\0';
+   if (!display)
+   return bufp;
 
q_vdb_pkg_eat(pkg_ctx, "USE", &use, &use_len);
if (!use[0])
-   return NULL;
+   return bufp;
q_vdb_pkg_eat(pkg_ctx, "IUSE", &iuse, &iuse_le

[gentoo-commits] proj/portage-utils:master commit in: man/, man/include/

2018-04-01 Thread Fabian Groffen
commit: b10334e70c272bb554228acea075011925f260fb
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sun Apr  1 12:44:30 2018 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sun Apr  1 12:44:30 2018 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=b10334e7

man/qlop: regen manpage

commit fe42f2a99297fed36720e71ba2ed77cf7a9da804 changed the generated
file, this commit ensures that future regenerate operations don't lose
the changes

 man/include/qlop.desc |  4 
 man/include/qlop.optdesc.yaml | 15 +++
 man/qlop.1| 26 +++---
 3 files changed, 34 insertions(+), 11 deletions(-)

diff --git a/man/include/qlop.desc b/man/include/qlop.desc
new file mode 100644
index 000..d99cc94
--- /dev/null
+++ b/man/include/qlop.desc
@@ -0,0 +1,4 @@
+.I qlop
+reads from $EMERGE_LOG_DIR/emerge.log and tries to extract
+information about merges, unmerges and syncs.  For packages, it can
+calculate average merge times or just list them.

diff --git a/man/include/qlop.optdesc.yaml b/man/include/qlop.optdesc.yaml
new file mode 100644
index 000..7864d6e
--- /dev/null
+++ b/man/include/qlop.optdesc.yaml
@@ -0,0 +1,15 @@
+gauge: |
+Gauge number of times a package has been merged.  This shows the
+merge time for each individual merge of package.
+time: |
+Calculate merge time for a specific package.  This is the average
+time for all merges of package.
+human: |
+Print seconds in human readable format (needs \fB\-t\fR), using
+minutes, hours and days instead of just seconds.
+current: |
+Show current emerging packages.  This relies on
+.I FEATURES=sandbox
+in order to detect running merges.
+verbose: |
+Print package versions and revisions.

diff --git a/man/qlop.1 b/man/qlop.1
index 70fb411..c138054 100644
--- a/man/qlop.1
+++ b/man/qlop.1
@@ -1,26 +1,28 @@
-.TH qlop "1" "Mar 2018" "Gentoo Foundation" "qlop"
+.\" generated by mkman.py, please do NOT edit!
+.TH qlop "1" "Apr 2018" "Gentoo Foundation" "qlop"
 .SH NAME
 qlop \- emerge log analyzer
 .SH SYNOPSIS
 .B qlop
 \fI[opts] \fR
 .SH DESCRIPTION
-qlop reads from $EMERGE_LOG_DIR/emerge.log and tries to extract
+.I qlop
+reads from $EMERGE_LOG_DIR/emerge.log and tries to extract
 information about merges, unmerges and syncs.  For packages, it can
 calculate average merge times or just list them.
 .SH OPTIONS
 .TP
 \fB\-g\fR, \fB\-\-gauge\fR
-Gauge number of times a package has been merged.  This shows the merge
-time for each individual merge of package.
+Gauge number of times a package has been merged.  This shows the
+merge time for each individual merge of package.
 .TP
 \fB\-t\fR, \fB\-\-time\fR
-Calculate merge time for a specific package.  This is the average time
-for all merges of package.
+Calculate merge time for a specific package.  This is the average
+time for all merges of package.
 .TP
 \fB\-H\fR, \fB\-\-human\fR
-Print seconds in human readable format (needs -t), using minutes, hours
-and days instead of just seconds.
+Print seconds in human readable format (needs \fB\-t\fR), using
+minutes, hours and days instead of just seconds.
 .TP
 \fB\-l\fR, \fB\-\-list\fR
 Show merge history.
@@ -32,8 +34,9 @@ Show unmerge history.
 Show sync history.
 .TP
 \fB\-c\fR, \fB\-\-current\fR
-Show current emerging packages.  This relies on FEATURES=sandbox in
-order to detect running merges.
+Show current emerging packages.  This relies on
+.I FEATURES=sandbox
+in order to detect running merges.
 .TP
 \fB\-d\fR \fI\fR, \fB\-\-date\fR \fI\fR
 Limit selection to this time (1st -d is start, 2nd -d is end).
@@ -62,7 +65,8 @@ Print version and exit.
 .SH "REPORTING BUGS"
 Please report bugs via http://bugs.gentoo.org/
 .br
-Product: Portage Development; Component: Tools
+Product: Portage Development; Component: Tools, Assignee:
+portage-ut...@gentoo.org
 .SH AUTHORS
 .nf
 Ned Ludd 



[gentoo-commits] proj/portage-utils:master commit in: man/, man/include/

2018-04-01 Thread Fabian Groffen
commit: 3b1cb130c9d20ef0d1190d7b7baf25a910765167
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sun Apr  1 13:47:10 2018 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sun Apr  1 13:47:10 2018 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=3b1cb130

man/qdepends: improve manpage

Bug https://bugs.gentoo.org/645554

 man/include/qdepends-05-examples.include | 17 +++
 man/include/qdepends.desc| 10 +++--
 man/include/qdepends.optdesc.yaml| 29 
 man/qdepends.1   | 77 
 4 files changed, 111 insertions(+), 22 deletions(-)

diff --git a/man/include/qdepends-05-examples.include 
b/man/include/qdepends-05-examples.include
index d4779ea..04fb92f 100644
--- a/man/include/qdepends-05-examples.include
+++ b/man/include/qdepends-05-examples.include
@@ -6,3 +6,20 @@ For finding out what a particular package depends on for 
building, you could do:
 .fi
 This tells us that we have \fIapp-editors/nano-2.3.2\fR installed and it 
depends
 on ncurses (among other things).
+
+Searching for packages that actually have nano in their RDEPEND:
+.nf
+   $ \fIqdepends -rQ nano\fR
+   virtual/editor-0
+.fi
+Tells us that \fIvirtual/editor\fR depends on nano.  However, if we
+wanted to know in what way a package specifically depends on another
+package, one can use \fB\-v\fR.
+.nf
+   $ \fIqdepends -vrQ logrotate\fR
+   sys-apps/portage-2.3.18: >=app-admin/logrotate-3.8.0
+.fi
+This way we can see there is a specific dependency expressed here.  If
+the above had used \fI\fR can be
+any key from Portage's VDB, e.g.\ any file from
+var/db/pkg///.
+query: |
+Query reverse deps.  This basically reverses the search to any
+package that references \fI\fR in DEPEND, RDEPEND or PDEPEND.
+This can be useful to find consumers of a given package, e.g.\ to
+search for packages that have \fIlogwatch\fR in their DEPEND.
+name-only: |
+Only show category/package, instead of category/package-version.
+format: |
+Pretty-print DEPEND declaration to be used in an ebuild.  This
+option initiates a very different mode of operation.  Instead of
+printing searching through packages, it constructs a multi-line
+statement in with shell syntax, to be used in an ebuild.  Each
+argument is turned into a separate DEPEND variable declaration.  You
+need to quote dependency strings in order for them to be printed as
+a single dependency declaration.  When used with the \fB\-q\fR
+option, only the pretty-printed dependency declaration is printed,
+e.g.\ the DEPEND= part is skipped.
+verbose: |
+When in reverse dep mode, print the package or packages that matched
+the query from the dependency line being searched.  This includes
+specifiers and versions.
+quiet: Suppress DEPEND= output for \fB\-f\fR.

diff --git a/man/qdepends.1 b/man/qdepends.1
index a0cac5b..c51a02d 100644
--- a/man/qdepends.1
+++ b/man/qdepends.1
@@ -1,64 +1,85 @@
-.TH qdepends "1" "Mar 2016" "Gentoo Foundation" "qdepends"
+.\" generated by mkman.py, please do NOT edit!
+.TH qdepends "1" "Apr 2018" "Gentoo Foundation" "qdepends"
 .SH NAME
 qdepends \- show dependency info
 .SH SYNOPSIS
 .B qdepends
 \fI[opts] \fR
 .SH DESCRIPTION
-The qdepends applet has a couple different modes.  Normally it is geared 
towards
+The
+.I qdepends
+applet has a couple different modes.  Normally it is geared towards
 answering the queries "what does package X depend on" and "what packages depend
 on X".  Both can further be classified into build, run, and post dependencies.
 
 By default, it will tell you the build time dependencies only (DEPEND).
 
-Currently, qdepends will only query installed packages.  There is no support 
for
-querying packages not yet installed (the \fBequery\fR(1) tool can do that).
+Currently,
+.I qdepends
+will only query installed packages.  There is no support for
+querying packages not yet installed (see \fBequery\fR(1) for that).
 
 If there is no answer to your query (i.e. you've asked for a package that is 
not
 installed, or a version that does not match), then you will get back no output.
 .SH OPTIONS
 .TP
 \fB\-d\fR, \fB\-\-depend\fR
-Show DEPEND info (default)
+Show DEPEND info (default).
 .TP
 \fB\-r\fR, \fB\-\-rdepend\fR
-Show RDEPEND info
+Show RDEPEND info.
 .TP
 \fB\-p\fR, \fB\-\-pdepend\fR
-Show PDEPEND info
+Show PDEPEND info.
 .TP
 \fB\-k\fR \fI\fR, \fB\-\-key\fR \fI\fR
-User defined vdb key
+Advanced option to allow querying the VDB.  This option overrides
+\fB\-d\fR, \fB\-r\fR, \fB\-p\fR or \fB\-a\fR.  \fI\fR can be
+any key from Portage's VDB, e.g.\ any file from
+var/db/pkg///.
 .TP
 \fB\-Q\fR \fI\fR, \fB\-\-query\fR \fI\fR
-Query reverse deps
+Query reverse deps.  This basically reverses the search to any
+package that references \fI\fR in DEPEND, RDEPEND or PDEPEND.
+This can be useful to find consumers of a given package, e.g.\ to

[gentoo-commits] proj/portage-utils:master commit in: man/, man/include/

2018-04-02 Thread Fabian Groffen
commit: 9164549006068637d060a23a9a24f657982bfbaf
Author: Fabian Groffen  gentoo  org>
AuthorDate: Mon Apr  2 17:26:35 2018 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Mon Apr  2 17:26:35 2018 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=91645490

qatom: improve manpage

Bug: https://bugs.gentoo.org/645554

 man/include/qatom.desc | 15 +
 man/include/qatom.optdesc.yaml | 43 
 man/qatom.1| 74 --
 3 files changed, 122 insertions(+), 10 deletions(-)

diff --git a/man/include/qatom.desc b/man/include/qatom.desc
new file mode 100644
index 000..10f0c1c
--- /dev/null
+++ b/man/include/qatom.desc
@@ -0,0 +1,15 @@
+\fIqatom\fR parses strings into atoms and optionally compares them.  The
+parsing into atoms results in CATEGORY, PN (package name), PV (package
+version), PR (package revision), SLOT and REPO.  Next to these version
+qualifiers (e.g.\ >, <, or =) and optional * suffix are extracted.  All
+but PN are optional.
+
+Comparison of atoms returns the relationship between two parsed atoms.
+\fIqatom\fR does not allow to test conditions.  It is possible to
+perform multiple comparisons by simply adding more arguments.
+Comparisons are, however, always performed two by two, so there must be
+an even count of arguments to the compare function.
+
+The \fIqatom\fR applet is a direct wrapper around the atom parsing
+functionalities used by various other applets.  As such this applet
+allows easy testing or atom parsing and comparison behaviour.

diff --git a/man/include/qatom.optdesc.yaml b/man/include/qatom.optdesc.yaml
new file mode 100644
index 000..e71dfb7
--- /dev/null
+++ b/man/include/qatom.optdesc.yaml
@@ -0,0 +1,43 @@
+format: |
+Specify a custom  output  format.  The default format is
+.nf
+%{CATEGORY} %{PN} %{PV} %[PR] %[SLOT] %[pfx] %[sfx]
+.fi
+Conversion specifiers start with a \fI%\fR symbol and are followed
+by either \fI{\fR or \fI[\fR.  Next is the name of the field to
+expand, followed by a matching \fI}\fR or \fI]\fR.  The difference
+between \fI{\fR and \fI[\fR is that the latter is only printed if
+the field referred is set, while the former prints \fI\fR in
+that case.
+
+The following fields are supported, which are inline with the
+variables from \fBebuild\fR(5).
+.RS
+.IP CATEGORY
+The category of the package.
+.IP P
+The package name and version without the ebuild revision.
+.IP PN
+The package name.
+.IP PV
+The package version without the ebuild revision.
+.IP PVR
+The package version including ebuild revision, which is also printed
+when zero, unlike for \fIPF\fR.
+.IP PF
+The package name, version and revision when not zero.  Thus, a zero
+revision \fI\-r0\fR is not printed.
+.IP PR
+The ebuild revision, when force printed, outputs \fI\-r0\fR when unset.
+.IP SLOT
+The package slot, when force printed, outputs \fI\-\fR when unset.
+.IP REPO
+The package repository.
+.IP pfx
+The package prefixes, that is version specifiers.
+.IP sfx
+The package suffices, currently that is just the asterisk.
+.RE
+verbose: Force all expansions, basically treat all \fI[\fR like \fI{\fR.
+quiet: Ignored for compatibility with other qapplets.
+nocolor: Ignored for compatibility with other qapplets.

diff --git a/man/qatom.1 b/man/qatom.1
index 4a30343..aeb9629 100644
--- a/man/qatom.1
+++ b/man/qatom.1
@@ -1,41 +1,95 @@
-.TH qatom "1" "Mar 2016" "Gentoo Foundation" "qatom"
+.\" generated by mkman.py, please do NOT edit!
+.TH qatom "1" "Apr 2018" "Gentoo Foundation" "qatom"
 .SH NAME
 qatom \- split atom strings
 .SH SYNOPSIS
 .B qatom
 \fI[opts] \fR
 .SH DESCRIPTION
+\fIqatom\fR parses strings into atoms and optionally compares them.  The
+parsing into atoms results in CATEGORY, PN (package name), PV (package
+version), PR (package revision), SLOT and REPO.  Next to these version
+qualifiers (e.g.\ >, <, or =) and optional * suffix are extracted.  All
+but PN are optional.
 
+Comparison of atoms returns the relationship between two parsed atoms.
+\fIqatom\fR does not allow to test conditions.  It is possible to
+perform multiple comparisons by simply adding more arguments.
+Comparisons are, however, always performed two by two, so there must be
+an even count of arguments to the compare function.
+
+The \fIqatom\fR applet is a direct wrapper around the atom parsing
+functionalities used by various other applets.  As such this applet
+allows easy testing or atom parsing and comparison behaviour.
 .SH OPTIONS
 .TP
 \fB\-F\fR \fI\fR, \fB\-\-format\fR \fI\fR
-Custom output format (default: %{CATEGORY} %{PN} %{PV} %[PR] %[SLOT] %[pfx] 
%[sfx])
+Specify a custom  output  format.  The default format is
+.nf
+%{CATEGORY} %{PN} %{PV} %[PR] %[SLOT] %[pfx] %[sfx]
+.fi
+Conversion specifiers start with a \fI%

[gentoo-commits] proj/portage-utils:master commit in: man/, man/include/, /

2018-04-03 Thread Fabian Groffen
commit: 1def9d468742c0d6d6b24aa1f1d76243be6e24cd
Author: Fabian Groffen  gentoo  org>
AuthorDate: Tue Apr  3 11:49:41 2018 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Tue Apr  3 11:49:41 2018 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=1def9d46

qlist: improve documentation

Bug: https://bugs.gentoo.org/645554

 man/include/qlist.desc |  6 +
 man/include/qlist.optdesc.yaml | 24 ++
 man/qlist.1| 56 +++---
 qlist.c|  2 +-
 4 files changed, 67 insertions(+), 21 deletions(-)

diff --git a/man/include/qlist.desc b/man/include/qlist.desc
new file mode 100644
index 000..e02d971
--- /dev/null
+++ b/man/include/qlist.desc
@@ -0,0 +1,6 @@
+\fIqlist\fR shows the contents, or a subset thereof, of an installed
+package.  Alternatively, lists whether a package is installed,
+optionally with version, USE-flag, SLOT or REPO information.  The
+\fIpkgname\fR to query for does not have to be an exact match, it may be
+part of it, e.g.\ an entire category, or any package with some string in
+its name.

diff --git a/man/include/qlist.optdesc.yaml b/man/include/qlist.optdesc.yaml
new file mode 100644
index 000..a60ef0d
--- /dev/null
+++ b/man/include/qlist.optdesc.yaml
@@ -0,0 +1,24 @@
+installed: |
+Instead of listing the contents of a package, just print the package
+name if the package is currently installed.
+umap: |
+List USE-flags enabled when the package was installed.  This flag
+implies \fB\-I\fR.
+slot: |
+Display installed packages with slots (use twice for subslots).
+This flag implies \fB\-I\fR.
+repo: |
+Display installed packages with repository the ebuild originated from.
+This flag implies \fB\-I\fR.
+columns: |
+Like \fB\-Iv\fR, but package name and version are separated by a
+space for easy consumption by e.g.\ shell scripts which can read
+space-separated columns.
+verbose: |
+When used with \fB\-I\fR, print the package version next to name.
+When listing the package contents, a single \fB\-v\fR displays
+symlinks with an arrow (\->) to their target.  Two or more \fB\-v\fR
+adds colour to the entries and prints like \fB\-I\fR before the
+listing.
+quiet: |
+Suppresses the parenthesis around the USE-flags when used with \fB\-U\fR.

diff --git a/man/qlist.1 b/man/qlist.1
index 05e9326..f7dd847 100644
--- a/man/qlist.1
+++ b/man/qlist.1
@@ -1,68 +1,84 @@
-.TH qlist "1" "Mar 2016" "Gentoo Foundation" "qlist"
+.\" generated by mkman.py, please do NOT edit!
+.TH qlist "1" "Apr 2018" "Gentoo Foundation" "qlist"
 .SH NAME
 qlist \- list files owned by pkgname
 .SH SYNOPSIS
 .B qlist
 \fI[opts] \fR
 .SH DESCRIPTION
-
+\fIqlist\fR shows the contents, or a subset thereof, of an installed
+package.  Alternatively, lists whether a package is installed,
+optionally with version, USE-flag, SLOT or REPO information.  The
+\fIpkgname\fR to query for does not have to be an exact match, it may be
+part of it, e.g.\ an entire category, or any package with some string in
+its name.
 .SH OPTIONS
 .TP
 \fB\-I\fR, \fB\-\-installed\fR
-Just show installed packages
+Instead of listing the contents of a package, just print the package
+name if the package is currently installed.
 .TP
 \fB\-S\fR, \fB\-\-slots\fR
-Display installed packages with slots (use twice for subslots)
+Display installed packages with slots (use twice for subslots).
 .TP
 \fB\-R\fR, \fB\-\-repo\fR
-Display installed packages with repository
+Display installed packages with repository the ebuild originated from.
+This flag implies \fB\-I\fR.
 .TP
 \fB\-U\fR, \fB\-\-umap\fR
-Display installed packages with flags used
+List USE-flags enabled when the package was installed.  This flag
+implies \fB\-I\fR.
 .TP
 \fB\-c\fR, \fB\-\-columns\fR
-Display column view
+Like \fB\-Iv\fR, but package name and version are separated by a
+space for easy consumption by e.g.\ shell scripts which can read
+space-separated columns.
 .TP
 \fB\-\-showdebug\fR
-Show /usr/lib/debug files
+Show /usr/lib/debug and /usr/src/debug files.
 .TP
 \fB\-e\fR, \fB\-\-exact\fR
-Exact match (only CAT/PN or PN without PV)
+Exact match (only CAT/PN or PN without PV).
 .TP
 \fB\-a\fR, \fB\-\-all\fR
-Show every installed package
+Show every installed package.
 .TP
 \fB\-d\fR, \fB\-\-dir\fR
-Only show directories
+Only show directories.
 .TP
 \fB\-o\fR, \fB\-\-obj\fR
-Only show objects
+Only show objects.
 .TP
 \fB\-s\fR, \fB\-\-sym\fR
-Only show symlinks
+Only show symlinks.
 .TP
 \fB\-\-root\fR \fI\fR
-Set the ROOT env var
+Set the ROOT env var.
 .TP
 \fB\-v\fR, \fB\-\-verbose\fR
-Make a lot of noise
+When used with \fB\-I\fR, print the package version next to name.
+When listing the package contents, a single \fB\-v\fR displays
+symlinks with an arrow (\->) to their target.  Two or more \fB\-v\fR
+adds colour to the entries and prints like \fB\-I\fR before the
+list

[gentoo-commits] proj/portage-utils:master commit in: man/, man/include/

2018-04-03 Thread Fabian Groffen
commit: 86085691d6a42e497c1a8902cf7c24212a2dd67d
Author: Fabian Groffen  gentoo  org>
AuthorDate: Tue Apr  3 12:56:17 2018 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Tue Apr  3 12:56:17 2018 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=86085691

qpkg: improve documentation

Bug: https://bugs.gentoo.org/645554

 man/include/qpkg.desc |  4 
 man/include/qpkg.optdesc.yaml |  2 ++
 man/qpkg.1| 31 ++-
 3 files changed, 24 insertions(+), 13 deletions(-)

diff --git a/man/include/qpkg.desc b/man/include/qpkg.desc
new file mode 100644
index 000..2bba24b
--- /dev/null
+++ b/man/include/qpkg.desc
@@ -0,0 +1,4 @@
+\fIqpkg\fR creates or cleans up Gentoo binary packages.  The default
+action is to create a new binpkg for the given package names and store
+them in pkgdir, which can be set explicitly using the \fB\-\-pkgdir\fR
+option.

diff --git a/man/include/qpkg.optdesc.yaml b/man/include/qpkg.optdesc.yaml
new file mode 100644
index 000..2da2810
--- /dev/null
+++ b/man/include/qpkg.optdesc.yaml
@@ -0,0 +1,2 @@
+verbose: Check and report MD5 hash mismatches during install.
+quiet: Ignored for compatability with other qapplets.

diff --git a/man/qpkg.1 b/man/qpkg.1
index 8bb098a..930d15c 100644
--- a/man/qpkg.1
+++ b/man/qpkg.1
@@ -1,47 +1,52 @@
-.TH qpkg "1" "Mar 2016" "Gentoo Foundation" "qpkg"
+.\" generated by mkman.py, please do NOT edit!
+.TH qpkg "1" "Apr 2018" "Gentoo Foundation" "qpkg"
 .SH NAME
 qpkg \- manipulate Gentoo binpkgs
 .SH SYNOPSIS
 .B qpkg
 \fI[opts] \fR
 .SH DESCRIPTION
-
+\fIqpkg\fR creates or cleans up Gentoo binary packages.  The default
+action is to create a new binpkg for the given package names and store
+them in pkgdir, which can be set explicitly using the \fB\-\-pkgdir\fR
+option.
 .SH OPTIONS
 .TP
 \fB\-c\fR, \fB\-\-clean\fR
-clean pkgdir of unused binary files
+clean pkgdir of unused binary files.
 .TP
 \fB\-E\fR, \fB\-\-eclean\fR
-clean pkgdir of files not in the tree anymore (slow)
+clean pkgdir of files not in the tree anymore (slow).
 .TP
 \fB\-p\fR, \fB\-\-pretend\fR
-pretend only
+pretend only.
 .TP
 \fB\-P\fR \fI\fR, \fB\-\-pkgdir\fR \fI\fR
-alternate package directory
+alternate package directory.
 .TP
 \fB\-\-root\fR \fI\fR
-Set the ROOT env var
+Set the ROOT env var.
 .TP
 \fB\-v\fR, \fB\-\-verbose\fR
-Make a lot of noise
+Check and report MD5 hash mismatches during install.
 .TP
 \fB\-q\fR, \fB\-\-quiet\fR
-Tighter output; suppress warnings
+Ignored for compatability with other qapplets.
 .TP
 \fB\-C\fR, \fB\-\-nocolor\fR
-Don't output color
+Don't output color.
 .TP
 \fB\-h\fR, \fB\-\-help\fR
-Print this help and exit
+Print this help and exit.
 .TP
 \fB\-V\fR, \fB\-\-version\fR
-Print version and exit
+Print version and exit.
 
 .SH "REPORTING BUGS"
 Please report bugs via http://bugs.gentoo.org/
 .br
-Product: Portage Development; Component: Tools
+Product: Portage Development; Component: Tools, Assignee:
+portage-ut...@gentoo.org
 .SH AUTHORS
 .nf
 Ned Ludd 



[gentoo-commits] proj/portage-utils:master commit in: man/, man/include/

2018-04-03 Thread Fabian Groffen
commit: f24b626027dceb5890b134837c6683f4593f6ce0
Author: Fabian Groffen  gentoo  org>
AuthorDate: Tue Apr  3 12:15:35 2018 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Tue Apr  3 12:15:35 2018 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=f24b6260

qmerge: improve documentation

Bug: https://bugs.gentoo.org/645554

 man/include/qmerge.desc |  6 ++
 man/qmerge.1| 43 +--
 2 files changed, 31 insertions(+), 18 deletions(-)

diff --git a/man/include/qmerge.desc b/man/include/qmerge.desc
new file mode 100644
index 000..08589ec
--- /dev/null
+++ b/man/include/qmerge.desc
@@ -0,0 +1,6 @@
+\fIqmerge\fR retrieves and installs Gentoo binary packages.  Simple
+dependency checking is performed, after which \fIqmerge\fR just unpacks
+the binpkg onto the filesystem and registers the package in the VDB.
+
+Retrieval of packages from a remote binhost is currently performed using
+\fBwget\fR(1).  More specifically, \fIFETCHCOMMAND\fR is ignored.

diff --git a/man/qmerge.1 b/man/qmerge.1
index f3d80db..f66908e 100644
--- a/man/qmerge.1
+++ b/man/qmerge.1
@@ -1,65 +1,72 @@
-.TH qmerge "1" "Mar 2016" "Gentoo Foundation" "qmerge"
+.\" generated by mkman.py, please do NOT edit!
+.TH qmerge "1" "Apr 2018" "Gentoo Foundation" "qmerge"
 .SH NAME
 qmerge \- fetch and merge binary package
 .SH SYNOPSIS
 .B qmerge
 \fI[opts] \fR
 .SH DESCRIPTION
+\fIqmerge\fR retrieves and installs Gentoo binary packages.  Simple
+dependency checking is performed, after which \fIqmerge\fR just unpacks
+the binpkg onto the filesystem and registers the package in the VDB.
 
+Retrieval of packages from a remote binhost is currently performed using
+\fBwget\fR(1).  More specifically, \fIFETCHCOMMAND\fR is ignored.
 .SH OPTIONS
 .TP
 \fB\-f\fR, \fB\-\-fetch\fR
-Fetch package and newest Packages metadata
+Fetch package and newest Packages metadata.
 .TP
 \fB\-F\fR, \fB\-\-force\fR
-Fetch package (skipping Packages)
+Fetch package (skipping Packages).
 .TP
 \fB\-s\fR, \fB\-\-search\fR
-Search available packages
+Search available packages.
 .TP
 \fB\-K\fR, \fB\-\-install\fR
-Install package
+Install package.
 .TP
 \fB\-U\fR, \fB\-\-unmerge\fR
-Uninstall package
+Uninstall package.
 .TP
 \fB\-p\fR, \fB\-\-pretend\fR
-Pretend only
+Pretend only.
 .TP
 \fB\-u\fR, \fB\-\-update\fR
-Update only
+Update only.
 .TP
 \fB\-y\fR, \fB\-\-yes\fR
-Don't prompt before overwriting
+Don't prompt before overwriting.
 .TP
 \fB\-O\fR, \fB\-\-nodeps\fR
-Don't merge dependencies
+Don't merge dependencies.
 .TP
 \fB\-\-debug\fR
-Run shell funcs with `set -x`
+Run shell funcs with `set -x`.
 .TP
 \fB\-\-root\fR \fI\fR
-Set the ROOT env var
+Set the ROOT env var.
 .TP
 \fB\-v\fR, \fB\-\-verbose\fR
-Make a lot of noise
+Make a lot of noise.
 .TP
 \fB\-q\fR, \fB\-\-quiet\fR
-Tighter output; suppress warnings
+Tighter output; suppress warnings.
 .TP
 \fB\-C\fR, \fB\-\-nocolor\fR
-Don't output color
+Don't output color.
 .TP
 \fB\-h\fR, \fB\-\-help\fR
-Print this help and exit
+Print this help and exit.
 .TP
 \fB\-V\fR, \fB\-\-version\fR
-Print version and exit
+Print version and exit.
 
 .SH "REPORTING BUGS"
 Please report bugs via http://bugs.gentoo.org/
 .br
-Product: Portage Development; Component: Tools
+Product: Portage Development; Component: Tools, Assignee:
+portage-ut...@gentoo.org
 .SH AUTHORS
 .nf
 Ned Ludd 



[gentoo-commits] proj/portage-utils:master commit in: man/, man/include/

2018-04-03 Thread Fabian Groffen
commit: 23b810c84c02a29f3b2766cf0fd005c53e668816
Author: Fabian Groffen  gentoo  org>
AuthorDate: Tue Apr  3 13:51:42 2018 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Tue Apr  3 13:51:42 2018 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=23b810c8

qtbz2: improve documentation

Bug: https://bugs.gentoo.org/645554

 man/include/qsize.desc |  3 +++
 man/include/qsize.optdesc.yaml |  5 +
 man/include/qtbz2.desc |  2 ++
 man/include/qtbz2.optdesc.yaml |  2 ++
 man/qtbz2.1| 33 ++---
 5 files changed, 30 insertions(+), 15 deletions(-)

diff --git a/man/include/qsize.desc b/man/include/qsize.desc
new file mode 100644
index 000..e4edce0
--- /dev/null
+++ b/man/include/qsize.desc
@@ -0,0 +1,3 @@
+\fIqsize\fR calculates the storage size taken by an installed package.
+The reported sizes can be the recorded exact sizes of all files, or the
+storage space they consume given the underlying filesystem.

diff --git a/man/include/qsize.optdesc.yaml b/man/include/qsize.optdesc.yaml
new file mode 100644
index 000..8dd58e4
--- /dev/null
+++ b/man/include/qsize.optdesc.yaml
@@ -0,0 +1,5 @@
+ignore: |
+Filter out entries matching \fI\fR, which is a regular
+expression, before calculating size.
+verbose: Ignored for compatibility with other qapplets.
+quiet: Ignored for compatibility with other qapplets.

diff --git a/man/include/qtbz2.desc b/man/include/qtbz2.desc
new file mode 100644
index 000..2ba37db
--- /dev/null
+++ b/man/include/qtbz2.desc
@@ -0,0 +1,2 @@
+\fIqtbz2\fR joins and splits combined xpak+tarbz2 files.  Gentoo binary
+packages are such combined files.

diff --git a/man/include/qtbz2.optdesc.yaml b/man/include/qtbz2.optdesc.yaml
new file mode 100644
index 000..c1ebcd1
--- /dev/null
+++ b/man/include/qtbz2.optdesc.yaml
@@ -0,0 +1,2 @@
+verbose: Print some files and sizes while joining and splitting.
+quiet: Ignored for compatibility with other qapplets.

diff --git a/man/qtbz2.1 b/man/qtbz2.1
index b22c70c..94db0d8 100644
--- a/man/qtbz2.1
+++ b/man/qtbz2.1
@@ -1,53 +1,56 @@
-.TH qtbz2 "1" "Mar 2016" "Gentoo Foundation" "qtbz2"
+.\" generated by mkman.py, please do NOT edit!
+.TH qtbz2 "1" "Apr 2018" "Gentoo Foundation" "qtbz2"
 .SH NAME
 qtbz2 \- manipulate tbz2 packages
 .SH SYNOPSIS
 .B qtbz2
 \fI[opts] \fR
 .SH DESCRIPTION
-
+\fIqtbz2\fR joins and splits combined xpak+tarbz2 files.  Gentoo binary
+packages are such combined files.
 .SH OPTIONS
 .TP
 \fB\-d\fR \fI\fR, \fB\-\-dir\fR \fI\fR
-Change to specified directory
+Change to specified directory.
 .TP
 \fB\-j\fR, \fB\-\-join\fR
-Join:   
+Join:   .
 .TP
 \fB\-s\fR, \fB\-\-split\fR
-Split a tbz2 into a tar.bz2 + xpak
+Split a tbz2 into a tar.bz2 + xpak.
 .TP
 \fB\-t\fR, \fB\-\-tarbz2\fR
-Just split the tar.bz2
+Just split the tar.bz2.
 .TP
 \fB\-x\fR, \fB\-\-xpak\fR
-Just split the xpak
+Just split the xpak.
 .TP
 \fB\-O\fR, \fB\-\-stdout\fR
-Write files to stdout
+Write files to stdout.
 .TP
 \fB\-\-root\fR \fI\fR
-Set the ROOT env var
+Set the ROOT env var.
 .TP
 \fB\-v\fR, \fB\-\-verbose\fR
-Make a lot of noise
+Print some files and sizes while joining and splitting.
 .TP
 \fB\-q\fR, \fB\-\-quiet\fR
-Tighter output; suppress warnings
+Ignored for compatibility with other qapplets.
 .TP
 \fB\-C\fR, \fB\-\-nocolor\fR
-Don't output color
+Don't output color.
 .TP
 \fB\-h\fR, \fB\-\-help\fR
-Print this help and exit
+Print this help and exit.
 .TP
 \fB\-V\fR, \fB\-\-version\fR
-Print version and exit
+Print version and exit.
 
 .SH "REPORTING BUGS"
 Please report bugs via http://bugs.gentoo.org/
 .br
-Product: Portage Development; Component: Tools
+Product: Portage Development; Component: Tools, Assignee:
+portage-ut...@gentoo.org
 .SH AUTHORS
 .nf
 Ned Ludd 



[gentoo-commits] proj/portage-utils:master commit in: man/, man/include/, /

2018-04-12 Thread Fabian Groffen
commit: 33d4e18b26cd37691a81584da0efd929097a22b3
Author: Fabian Groffen  gentoo  org>
AuthorDate: Thu Apr 12 19:14:19 2018 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Thu Apr 12 19:14:19 2018 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=33d4e18b

qlop: don't rely on %F for data parsing for portability

While at it document the date formats in the man-page.

 man/include/qlop.optdesc.yaml | 16 
 man/qlop.1| 16 +++-
 qlop.c|  6 +++---
 3 files changed, 34 insertions(+), 4 deletions(-)

diff --git a/man/include/qlop.optdesc.yaml b/man/include/qlop.optdesc.yaml
index 7864d6e..fad1670 100644
--- a/man/include/qlop.optdesc.yaml
+++ b/man/include/qlop.optdesc.yaml
@@ -1,3 +1,19 @@
+date: |
+Limit the selection of packages to the date given, or to the range
+of dates if this argument is given twice.  The \fB--date\fR option
+can take a few forms.
+.RS
+.IP "NUMBER [s] [ago]"
+Relative time, specifying \fINUMBER\fR \fIdays\fR, \fIweeks\fR,
+\fImonths\fR or \fIyears\fR, for example \fI3 days ago\fR.
+.IP -MM-DD
+Big-endian date, with components separated by hyphens, starting with
+year, followed by month and day of month.
+.IP S
+Seconds since 1970-01-01 00:00:00 + (UTC), the UNIX epoch.
+.IP FORMAT|DATE
+Use \fIFORMAT\fR as input for \fBstrptime\fR(3) to parse \fIDATE\fR.
+.RE
 gauge: |
 Gauge number of times a package has been merged.  This shows the
 merge time for each individual merge of package.

diff --git a/man/qlop.1 b/man/qlop.1
index c138054..9c449a9 100644
--- a/man/qlop.1
+++ b/man/qlop.1
@@ -39,7 +39,21 @@ Show current emerging packages.  This relies on
 in order to detect running merges.
 .TP
 \fB\-d\fR \fI\fR, \fB\-\-date\fR \fI\fR
-Limit selection to this time (1st -d is start, 2nd -d is end).
+Limit the selection of packages to the date given, or to the range
+of dates if this argument is given twice.  The \fB--date\fR option
+can take a few forms.
+.RS
+.IP "NUMBER [s] [ago]"
+Relative time, specifying \fINUMBER\fR \fIdays\fR, \fIweeks\fR,
+\fImonths\fR or \fIyears\fR, for example \fI3 days ago\fR.
+.IP -MM-DD
+Big-endian date, with components separated by hyphens, starting with
+year, followed by month and day of month.
+.IP S
+Seconds since 1970-01-01 00:00:00 + (UTC), the UNIX epoch.
+.IP FORMAT|DATE
+Use \fIFORMAT\fR as input for \fBstrptime\fR(3) to parse \fIDATE\fR.
+.RE
 .TP
 \fB\-f\fR \fI\fR, \fB\-\-logfile\fR \fI\fR
 Read emerge logfile instead of $EMERGE_LOG_DIR/emerge.log.

diff --git a/qlop.c b/qlop.c
index 67669ef..1d4e0d9 100644
--- a/qlop.c
+++ b/qlop.c
@@ -39,7 +39,7 @@ static const char qlop_desc[] =
"The --date option can take a few forms:\n"
"  -d '# [s] [ago]'  (e.g. '3 days ago')\n"
"Or using strptime(3) formats:\n"
-   "  -d '2015-12-25'   (detected as %F)\n"
+   "  -d '2015-12-25'   (detected as %Y-%m-%d)\n"
"  -d '1459101740'   (detected as %s)\n"
"  -d '%d.%m.%Y|25.12.2015'  (format is specified)";
 #define qlop_usage(ret) usage(ret, QLOP_FLAGS, qlop_long_opts, qlop_opts_help, 
qlop_desc, lookup_applet_idx("qlop"))
@@ -733,7 +733,7 @@ parse_date(const char *sdate, time_t *t)
} else {
/* Handle automatic formats:
 * - "12315128"   -> %s
-* - "2015-12-24" -> %F (same as %Y-%m-%d
+* - "2015-12-24" -> %Y-%m-%d
 * - human readable format (see below)
 */
size_t len = strspn(sdate, "0123456789-");
@@ -742,7 +742,7 @@ parse_date(const char *sdate, time_t *t)
if (strchr(sdate, '-') == NULL)
fmt = "%s";
else
-   fmt = "%F";
+   fmt = "%Y-%m-%d";
 
s = strptime(sdate, fmt, &tm);
if (s == NULL || s[0] != '\0')



[gentoo-commits] proj/portage-utils:master commit in: /, man/, man/include/

2021-03-13 Thread Fabian Groffen
commit: 7dc2cc4bfaf2bbb943c45bc8171843a523cea7e5
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sat Mar 13 20:30:48 2021 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sat Mar 13 20:30:48 2021 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=7dc2cc4b

q: show masking reason from comments when using -vv with -m

Signed-off-by: Fabian Groffen  gentoo.org>

 main.c |  1 -
 man/include/q.optdesc.yaml |  5 ++--
 man/q.1|  7 +++---
 q.c| 58 +++---
 4 files changed, 62 insertions(+), 9 deletions(-)

diff --git a/main.c b/main.c
index a68af63..ceab587 100644
--- a/main.c
+++ b/main.c
@@ -677,7 +677,6 @@ read_one_repos_conf(const char *repos_conf, char **primary)
 
main_repo = NULL;
repo = NULL;
-   line = 0;
for (p = strtok_r(buf, "\n", &s); p != NULL; p = strtok_r(NULL, "\n", 
&s))
{
/* trim trailing whitespace, remove comments, locate = */

diff --git a/man/include/q.optdesc.yaml b/man/include/q.optdesc.yaml
index cde6eed..468ffa9 100644
--- a/man/include/q.optdesc.yaml
+++ b/man/include/q.optdesc.yaml
@@ -10,5 +10,6 @@ envvar: |
 variable name and the value is printed as a shell-style declaration.
 masks: |
 Print the masks from package.mask files found.  Use \fI-v\fR to see
-the source (file) where the mask was declared.  Additional arguments
-are treated as atom selectors which must match the masks.
+the source (file) where the mask was declared.  Use multiple
+\fI-v\fR to print the comment right before the mask.  Additional
+arguments are treated as atom selectors which must match the masks.

diff --git a/man/q.1 b/man/q.1
index 2979cab..f43be6f 100644
--- a/man/q.1
+++ b/man/q.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH q "1" "Feb 2021" "Gentoo Foundation" "q"
+.TH q "1" "Mar 2021" "Gentoo Foundation" "q"
 .SH NAME
 q \- invoke a portage utility applet
 .SH SYNOPSIS
@@ -35,8 +35,9 @@ variable name and the value is printed as a shell-style 
declaration.
 .TP
 \fB\-m\fR, \fB\-\-masks\fR
 Print the masks from package.mask files found.  Use \fI-v\fR to see
-the source (file) where the mask was declared.  Additional arguments
-are treated as atom selectors which must match the masks.
+the source (file) where the mask was declared.  Use multiple
+\fI-v\fR to print the comment right before the mask.  Additional
+arguments are treated as atom selectors which must match the masks.
 .TP
 \fB\-\-root\fR \fI\fR
 Set the ROOT env var.

diff --git a/q.c b/q.c
index a6a9a0b..e514b0c 100644
--- a/q.c
+++ b/q.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005-2019 Gentoo Foundation
+ * Copyright 2005-2021 Gentoo Foundation
  * Distributed under the terms of the GNU General Public License v2
  *
  * Copyright 2005-2010 Ned Ludd- 
@@ -288,6 +288,11 @@ int q_main(int argc, char **argv)
size_t n;
int j;
bool match;
+   char *lastmfile = NULL;
+   long lastcbeg = 0;
+   long lastcend = 0;
+   char *buf = NULL;
+   size_t buflen = 0;
depend_atom *atom;
depend_atom *qatom;
 
@@ -313,16 +318,63 @@ int q_main(int argc, char **argv)
if (!match)
continue;
 
+   if (verbose > 1) {
+   char *mfile = (char *)array_get_elem(files, n);
+   char *l;
+   char *s = NULL;
+   long line = 0;
+   long cbeg = 0;
+   long cend = 0;
+
+   s = l = strchr(mfile, ':');
+   /* p cannot be NULL, just crash if something's 
wrong */
+   (void)strtol(l + 1, &l, 10);
+   if (*l == ':')
+   cbeg = strtol(l + 1, &l, 10);
+   if (*l == '-')
+   cend = strtol(l + 1, &l, 10);
+   if (cend < cbeg)
+   cend = cbeg = 0;
+
+   if (lastmfile == NULL ||
+   strncmp(lastmfile, mfile, s - 
mfile + 1) != 0 ||
+   lastcbeg != cbeg || lastcend != 
cend)
+   {
+   *s = '\0';
+   if (buf != NULL)
+   *buf = '\0';
+   eat_file(mfile, &buf, &buflen);
+   *s = ':';
+
+   line = 0;
+ 

[gentoo-commits] proj/portage-utils:master commit in: man/, /, man/include/

2019-12-27 Thread Fabian Groffen
commit: 1038786d92a885dece9cc82588e88d8367a0fda2
Author: Fabian Groffen  gentoo  org>
AuthorDate: Fri Dec 27 19:14:44 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Fri Dec 27 19:14:44 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=1038786d

qkeyword: apply profile masks to -S/-T results

Technically, this should be enough to implement the Puppet provider for
Gentoo.

Signed-off-by: Fabian Groffen  gentoo.org>

 man/include/qkeyword-01-latest-testing.include | 23 
 man/include/qkeyword.desc  | 10 +++-
 man/qkeyword.1 | 34 ++--
 qkeyword.c | 73 +-
 4 files changed, 121 insertions(+), 19 deletions(-)

diff --git a/man/include/qkeyword-01-latest-testing.include 
b/man/include/qkeyword-01-latest-testing.include
new file mode 100644
index 000..1c2fde5
--- /dev/null
+++ b/man/include/qkeyword-01-latest-testing.include
@@ -0,0 +1,23 @@
+.SH "RETRIEVING LATEST TESTING VERSION AVAILABLE"
+.PP
+To retrieve the latest available version in the ebuild tree marked as
+testing for the given ARCH, can be done with a combination of flags,
+mostly to restrict the search.  For instance, to find the latest version
+of \fIsys-devel/gcc\fR available, one could use:
+.nf
+$ qkeyword -p sys-devel/gcc -T
+sys-devel/gcc-8.3.0
+.fi
+It may be that there is a newer version available, but masked for the
+configured profile (via package.mask).  Using \fB-v\fR will inform about
+this scenario happening:
+.nf
+$ qkeyword -p dev-vcs/cvs -Tv
+masked by =dev-vcs/cvs-1.12.12*: dev-vcs/cvs-1.12.12-r12
+.fi
+Unrelated, but to locate the mask given, use verbose mode on \fIq\fR's
+mask listing:
+.nf
+$ q -mv dev-vcs/cvs
+=dev-vcs/cvs-1.12.12* [/repo/gentoo/profiles/prefix/sunos/solaris/package.mask]
+.fi

diff --git a/man/include/qkeyword.desc b/man/include/qkeyword.desc
index b7a863c..adc55ea 100644
--- a/man/include/qkeyword.desc
+++ b/man/include/qkeyword.desc
@@ -1,5 +1,5 @@
-\fIqkeyword\fR allows various searches based on KEYWORDS aimed at Gentoo
-developers.  Various modes allow to query which packages would be
+\fIqkeyword\fR allows various searches based on KEYWORDS.  Some uses are
+aimed at Gentoo developers, to allow querying which packages would be
 available, or are candidate for keywording.
 .P
 By default, the entire tree is traversed.  Since this process can be
@@ -12,3 +12,9 @@ as package in one go.  The \fB-m\fR maintainer match, while 
reducing the
 resulting set, is likely to slow down the query processing since the
 metadata.xml file has to be read for each package examined.  It is best
 used in combination with \fB-p\fR or \fB-c\fR.
+.P
+\fIqkeyword\fR uses the keyword found in the configured profile (ARCH)
+for its queries.  This keyword can be overridden by giving the desired
+keyword as argument.  Note that this does not change the profile in use,
+which most notably can result in incorrect masks being applied for the
+\fB-T\fR and \fB-S\fR options.

diff --git a/man/qkeyword.1 b/man/qkeyword.1
index 34beb18..5a26218 100644
--- a/man/qkeyword.1
+++ b/man/qkeyword.1
@@ -6,8 +6,8 @@ qkeyword \- list packages based on keywords
 .B qkeyword
 \fI[opts]  \fR
 .SH DESCRIPTION
-\fIqkeyword\fR allows various searches based on KEYWORDS aimed at Gentoo
-developers.  Various modes allow to query which packages would be
+\fIqkeyword\fR allows various searches based on KEYWORDS.  Some uses are
+aimed at Gentoo developers, to allow querying which packages would be
 available, or are candidate for keywording.
 .P
 By default, the entire tree is traversed.  Since this process can be
@@ -20,6 +20,12 @@ as package in one go.  The \fB-m\fR maintainer match, while 
reducing the
 resulting set, is likely to slow down the query processing since the
 metadata.xml file has to be read for each package examined.  It is best
 used in combination with \fB-p\fR or \fB-c\fR.
+.P
+\fIqkeyword\fR uses the keyword found in the configured profile (ARCH)
+for its queries.  This keyword can be overridden by giving the desired
+keyword as argument.  Note that this does not change the profile in use,
+which most notably can result in incorrect masks being applied for the
+\fB-T\fR and \fB-S\fR options.
 .SH OPTIONS
 .TP
 \fB\-p\fR \fI\fR, \fB\-\-matchpkg\fR \fI\fR
@@ -75,7 +81,29 @@ Print this help and exit.
 .TP
 \fB\-V\fR, \fB\-\-version\fR
 Print version and exit.
-
+.SH "RETRIEVING LATEST TESTING VERSION AVAILABLE"
+.PP
+To retrieve the latest available version in the ebuild tree marked as
+testing for the given ARCH, can be done with a combination of flags,
+mostly to restrict the search.  For instance, to find the latest version
+of \fIsys-devel/gcc\fR available, one could use:
+.nf
+$ qkeyword -p sys-devel/gcc -T
+sys-devel/gcc-8.3.0
+.fi
+It may be that there is a newer version available, but masked for the
+configured profile (via package.mask).  Using \fB-v\fR 

[gentoo-commits] proj/portage-utils:master commit in: /, man/, man/include/

2021-03-13 Thread Fabian Groffen
commit: 7dc2cc4bfaf2bbb943c45bc8171843a523cea7e5
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sat Mar 13 20:30:48 2021 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sat Mar 13 20:30:48 2021 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=7dc2cc4b

q: show masking reason from comments when using -vv with -m

Signed-off-by: Fabian Groffen  gentoo.org>

 main.c |  1 -
 man/include/q.optdesc.yaml |  5 ++--
 man/q.1|  7 +++---
 q.c| 58 +++---
 4 files changed, 62 insertions(+), 9 deletions(-)

diff --git a/main.c b/main.c
index a68af63..ceab587 100644
--- a/main.c
+++ b/main.c
@@ -677,7 +677,6 @@ read_one_repos_conf(const char *repos_conf, char **primary)
 
main_repo = NULL;
repo = NULL;
-   line = 0;
for (p = strtok_r(buf, "\n", &s); p != NULL; p = strtok_r(NULL, "\n", 
&s))
{
/* trim trailing whitespace, remove comments, locate = */

diff --git a/man/include/q.optdesc.yaml b/man/include/q.optdesc.yaml
index cde6eed..468ffa9 100644
--- a/man/include/q.optdesc.yaml
+++ b/man/include/q.optdesc.yaml
@@ -10,5 +10,6 @@ envvar: |
 variable name and the value is printed as a shell-style declaration.
 masks: |
 Print the masks from package.mask files found.  Use \fI-v\fR to see
-the source (file) where the mask was declared.  Additional arguments
-are treated as atom selectors which must match the masks.
+the source (file) where the mask was declared.  Use multiple
+\fI-v\fR to print the comment right before the mask.  Additional
+arguments are treated as atom selectors which must match the masks.

diff --git a/man/q.1 b/man/q.1
index 2979cab..f43be6f 100644
--- a/man/q.1
+++ b/man/q.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH q "1" "Feb 2021" "Gentoo Foundation" "q"
+.TH q "1" "Mar 2021" "Gentoo Foundation" "q"
 .SH NAME
 q \- invoke a portage utility applet
 .SH SYNOPSIS
@@ -35,8 +35,9 @@ variable name and the value is printed as a shell-style 
declaration.
 .TP
 \fB\-m\fR, \fB\-\-masks\fR
 Print the masks from package.mask files found.  Use \fI-v\fR to see
-the source (file) where the mask was declared.  Additional arguments
-are treated as atom selectors which must match the masks.
+the source (file) where the mask was declared.  Use multiple
+\fI-v\fR to print the comment right before the mask.  Additional
+arguments are treated as atom selectors which must match the masks.
 .TP
 \fB\-\-root\fR \fI\fR
 Set the ROOT env var.

diff --git a/q.c b/q.c
index a6a9a0b..e514b0c 100644
--- a/q.c
+++ b/q.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005-2019 Gentoo Foundation
+ * Copyright 2005-2021 Gentoo Foundation
  * Distributed under the terms of the GNU General Public License v2
  *
  * Copyright 2005-2010 Ned Ludd- 
@@ -288,6 +288,11 @@ int q_main(int argc, char **argv)
size_t n;
int j;
bool match;
+   char *lastmfile = NULL;
+   long lastcbeg = 0;
+   long lastcend = 0;
+   char *buf = NULL;
+   size_t buflen = 0;
depend_atom *atom;
depend_atom *qatom;
 
@@ -313,16 +318,63 @@ int q_main(int argc, char **argv)
if (!match)
continue;
 
+   if (verbose > 1) {
+   char *mfile = (char *)array_get_elem(files, n);
+   char *l;
+   char *s = NULL;
+   long line = 0;
+   long cbeg = 0;
+   long cend = 0;
+
+   s = l = strchr(mfile, ':');
+   /* p cannot be NULL, just crash if something's 
wrong */
+   (void)strtol(l + 1, &l, 10);
+   if (*l == ':')
+   cbeg = strtol(l + 1, &l, 10);
+   if (*l == '-')
+   cend = strtol(l + 1, &l, 10);
+   if (cend < cbeg)
+   cend = cbeg = 0;
+
+   if (lastmfile == NULL ||
+   strncmp(lastmfile, mfile, s - 
mfile + 1) != 0 ||
+   lastcbeg != cbeg || lastcend != 
cend)
+   {
+   *s = '\0';
+   if (buf != NULL)
+   *buf = '\0';
+   eat_file(mfile, &buf, &buflen);
+   *s = ':';
+
+   line = 0;
+ 

[gentoo-commits] proj/portage-utils:master commit in: man/, man/include/, /

2020-05-16 Thread Fabian Groffen
commit: a0780928edc76543e63709c915fb7d581bd13291
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sat May 16 14:29:45 2020 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sat May 16 14:29:45 2020 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=a0780928

qfile: print symlink targets in verbose mode

e.g.:
% qfile -v /bin/csh
app-shells/tcsh-6.21.00-r1: /bin/csh -> tcsh

Signed-off-by: Fabian Groffen  gentoo.org>

 man/include/qfile.optdesc.yaml | 6 +++---
 man/qfile.1| 8 
 qfile.c| 6 +-
 3 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/man/include/qfile.optdesc.yaml b/man/include/qfile.optdesc.yaml
index 66ee885..9e1d24b 100644
--- a/man/include/qfile.optdesc.yaml
+++ b/man/include/qfile.optdesc.yaml
@@ -1,7 +1,7 @@
 verbose: |
-Print package versions to matches, warn about problems with
-resolving symlinks or positioning packages under an alternative
-root.
+Print package versions and symlink targets for matches, warn about
+problems with resolving symlinks or positioning packages under an
+alternative root.
 quiet: |
 Don't print matching file for matches, just the package.  Don't
 report about orphan files.

diff --git a/man/qfile.1 b/man/qfile.1
index 7501311..7caa459 100644
--- a/man/qfile.1
+++ b/man/qfile.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qfile "1" "Nov 2019" "Gentoo Foundation" "qfile"
+.TH qfile "1" "May 2020" "Gentoo Foundation" "qfile"
 .SH NAME
 qfile \- list all pkgs owning files
 .SH SYNOPSIS
@@ -62,9 +62,9 @@ Don't look in the prunelib registry.
 Set the ROOT env var.
 .TP
 \fB\-v\fR, \fB\-\-verbose\fR
-Print package versions to matches, warn about problems with
-resolving symlinks or positioning packages under an alternative
-root.
+Print package versions and symlink targets for matches, warn about
+problems with resolving symlinks or positioning packages under an
+alternative root.
 .TP
 \fB\-q\fR, \fB\-\-quiet\fR
 Don't print matching file for matches, just the package.  Don't

diff --git a/qfile.c b/qfile.c
index d104848..efac60e 100644
--- a/qfile.c
+++ b/qfile.c
@@ -305,8 +305,12 @@ static int qfile_cb(tree_pkg_ctx *pkg_ctx, void *priv)
printf("%s", atom_format(state->format, atom));
if (quiet)
puts("");
+   else if (verbose && e->type == CONTENTS_SYM)
+   printf(": %s%s -> %s\n",
+   state->root ? 
state->root : "",
+   e->name, e->sym_target);
else
-   printf(": %s%s\n", state->root ? : "", 
e->name);
+   printf(": %s%s\n", state->root ? 
state->root : "", e->name);
} else {
non_orphans[i] = 1;
}



[gentoo-commits] proj/portage-utils:master commit in: man/, /, man/include/

2019-12-27 Thread Fabian Groffen
commit: 1038786d92a885dece9cc82588e88d8367a0fda2
Author: Fabian Groffen  gentoo  org>
AuthorDate: Fri Dec 27 19:14:44 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Fri Dec 27 19:14:44 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=1038786d

qkeyword: apply profile masks to -S/-T results

Technically, this should be enough to implement the Puppet provider for
Gentoo.

Signed-off-by: Fabian Groffen  gentoo.org>

 man/include/qkeyword-01-latest-testing.include | 23 
 man/include/qkeyword.desc  | 10 +++-
 man/qkeyword.1 | 34 ++--
 qkeyword.c | 73 +-
 4 files changed, 121 insertions(+), 19 deletions(-)

diff --git a/man/include/qkeyword-01-latest-testing.include 
b/man/include/qkeyword-01-latest-testing.include
new file mode 100644
index 000..1c2fde5
--- /dev/null
+++ b/man/include/qkeyword-01-latest-testing.include
@@ -0,0 +1,23 @@
+.SH "RETRIEVING LATEST TESTING VERSION AVAILABLE"
+.PP
+To retrieve the latest available version in the ebuild tree marked as
+testing for the given ARCH, can be done with a combination of flags,
+mostly to restrict the search.  For instance, to find the latest version
+of \fIsys-devel/gcc\fR available, one could use:
+.nf
+$ qkeyword -p sys-devel/gcc -T
+sys-devel/gcc-8.3.0
+.fi
+It may be that there is a newer version available, but masked for the
+configured profile (via package.mask).  Using \fB-v\fR will inform about
+this scenario happening:
+.nf
+$ qkeyword -p dev-vcs/cvs -Tv
+masked by =dev-vcs/cvs-1.12.12*: dev-vcs/cvs-1.12.12-r12
+.fi
+Unrelated, but to locate the mask given, use verbose mode on \fIq\fR's
+mask listing:
+.nf
+$ q -mv dev-vcs/cvs
+=dev-vcs/cvs-1.12.12* [/repo/gentoo/profiles/prefix/sunos/solaris/package.mask]
+.fi

diff --git a/man/include/qkeyword.desc b/man/include/qkeyword.desc
index b7a863c..adc55ea 100644
--- a/man/include/qkeyword.desc
+++ b/man/include/qkeyword.desc
@@ -1,5 +1,5 @@
-\fIqkeyword\fR allows various searches based on KEYWORDS aimed at Gentoo
-developers.  Various modes allow to query which packages would be
+\fIqkeyword\fR allows various searches based on KEYWORDS.  Some uses are
+aimed at Gentoo developers, to allow querying which packages would be
 available, or are candidate for keywording.
 .P
 By default, the entire tree is traversed.  Since this process can be
@@ -12,3 +12,9 @@ as package in one go.  The \fB-m\fR maintainer match, while 
reducing the
 resulting set, is likely to slow down the query processing since the
 metadata.xml file has to be read for each package examined.  It is best
 used in combination with \fB-p\fR or \fB-c\fR.
+.P
+\fIqkeyword\fR uses the keyword found in the configured profile (ARCH)
+for its queries.  This keyword can be overridden by giving the desired
+keyword as argument.  Note that this does not change the profile in use,
+which most notably can result in incorrect masks being applied for the
+\fB-T\fR and \fB-S\fR options.

diff --git a/man/qkeyword.1 b/man/qkeyword.1
index 34beb18..5a26218 100644
--- a/man/qkeyword.1
+++ b/man/qkeyword.1
@@ -6,8 +6,8 @@ qkeyword \- list packages based on keywords
 .B qkeyword
 \fI[opts]  \fR
 .SH DESCRIPTION
-\fIqkeyword\fR allows various searches based on KEYWORDS aimed at Gentoo
-developers.  Various modes allow to query which packages would be
+\fIqkeyword\fR allows various searches based on KEYWORDS.  Some uses are
+aimed at Gentoo developers, to allow querying which packages would be
 available, or are candidate for keywording.
 .P
 By default, the entire tree is traversed.  Since this process can be
@@ -20,6 +20,12 @@ as package in one go.  The \fB-m\fR maintainer match, while 
reducing the
 resulting set, is likely to slow down the query processing since the
 metadata.xml file has to be read for each package examined.  It is best
 used in combination with \fB-p\fR or \fB-c\fR.
+.P
+\fIqkeyword\fR uses the keyword found in the configured profile (ARCH)
+for its queries.  This keyword can be overridden by giving the desired
+keyword as argument.  Note that this does not change the profile in use,
+which most notably can result in incorrect masks being applied for the
+\fB-T\fR and \fB-S\fR options.
 .SH OPTIONS
 .TP
 \fB\-p\fR \fI\fR, \fB\-\-matchpkg\fR \fI\fR
@@ -75,7 +81,29 @@ Print this help and exit.
 .TP
 \fB\-V\fR, \fB\-\-version\fR
 Print version and exit.
-
+.SH "RETRIEVING LATEST TESTING VERSION AVAILABLE"
+.PP
+To retrieve the latest available version in the ebuild tree marked as
+testing for the given ARCH, can be done with a combination of flags,
+mostly to restrict the search.  For instance, to find the latest version
+of \fIsys-devel/gcc\fR available, one could use:
+.nf
+$ qkeyword -p sys-devel/gcc -T
+sys-devel/gcc-8.3.0
+.fi
+It may be that there is a newer version available, but masked for the
+configured profile (via package.mask).  Using \fB-v\fR 

[gentoo-commits] proj/portage-utils:master commit in: man/, man/include/, /

2019-07-14 Thread Fabian Groffen
commit: 26b9374ee23d16b3957b6ebc0cd80f53b22a4d16
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sun Jul 14 13:30:06 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sun Jul 14 13:30:06 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=26b9374e

quse: add -F argument, move some -v functionality to -D

-v now controls default atom formatting, as with other applets, the
ability to list USE-flags, their state and description per package now
is enabled by the -D (describe) flag, which incidentally also makes more
sense.

Signed-off-by: Fabian Groffen  gentoo.org>

 man/include/quse.optdesc.yaml | 11 +++---
 man/quse.1| 14 ---
 quse.c| 85 ---
 3 files changed, 62 insertions(+), 48 deletions(-)

diff --git a/man/include/quse.optdesc.yaml b/man/include/quse.optdesc.yaml
index 693aade..71fcd2d 100644
--- a/man/include/quse.optdesc.yaml
+++ b/man/include/quse.optdesc.yaml
@@ -1,10 +1,11 @@
 exact: Search for exact string, e.g.\ do not use regular expression matching.
 verbose: |
-Show descriptions for USE-flags for packages that match the search.
+Show versions for packages that match the search.
 Also shows problems encountered during parsing.  These are mostly
 diagnostic and indicate possible incorrectness in the results.
 quiet: Ignored for compatibility with other qapplets.
-installed: |
-Only search installed packages.  Together with \fB-v\fR this shows
-USE-flags and their descriptions, and currently enabled flags
-prefixed with an asterisk (\fI*\fR).
+describe: |
+Describe the USE flag, when no USE-flag given and combined with
+\fB-p\fR, lists all USE-flags with their descriptions (and enabled
+state prefixed with an asterisk when used with \fB-I\fR) per
+package.

diff --git a/man/quse.1 b/man/quse.1
index a30e189..8306ca5 100644
--- a/man/quse.1
+++ b/man/quse.1
@@ -20,12 +20,13 @@ List all ebuilds, don't match anything.
 Use the LICENSE vs IUSE.
 .TP
 \fB\-D\fR, \fB\-\-describe\fR
-Describe the USE flag.
+Describe the USE flag, when no USE-flag given and combined with
+\fB-p\fR, lists all USE-flags with their descriptions (and enabled
+state prefixed with an asterisk when used with \fB-I\fR) per
+package.
 .TP
 \fB\-I\fR, \fB\-\-installed\fR
-Only search installed packages.  Together with \fB-v\fR this shows
-USE-flags and their descriptions, and currently enabled flags
-prefixed with an asterisk (\fI*\fR).
+Only search installed packages.
 .TP
 \fB\-p\fR \fI\fR, \fB\-\-package\fR \fI\fR
 Restrict matching to package or category.
@@ -33,11 +34,14 @@ Restrict matching to package or category.
 \fB\-R\fR, \fB\-\-repo\fR
 Show repository the ebuild originates from.
 .TP
+\fB\-F\fR \fI\fR, \fB\-\-format\fR \fI\fR
+Print matched atom using given format string.
+.TP
 \fB\-\-root\fR \fI\fR
 Set the ROOT env var.
 .TP
 \fB\-v\fR, \fB\-\-verbose\fR
-Show descriptions for USE-flags for packages that match the search.
+Show versions for packages that match the search.
 Also shows problems encountered during parsing.  These are mostly
 diagnostic and indicate possible incorrectness in the results.
 .TP

diff --git a/quse.c b/quse.c
index bc99c3b..df8626e 100644
--- a/quse.c
+++ b/quse.c
@@ -27,7 +27,7 @@
 #include "xarray.h"
 #include "xregex.h"
 
-#define QUSE_FLAGS "eaLDIp:R" COMMON_FLAGS
+#define QUSE_FLAGS "eaLDIp:RF:" COMMON_FLAGS
 static struct option const quse_long_opts[] = {
{"exact", no_argument, NULL, 'e'},
{"all",   no_argument, NULL, 'a'},
@@ -36,6 +36,7 @@ static struct option const quse_long_opts[] = {
{"installed", no_argument, NULL, 'I'},
{"package",a_argument, NULL, 'p'},
{"repo",  no_argument, NULL, 'R'},
+   {"format", a_argument, NULL, 'F'},
COMMON_LONG_OPTS
 };
 static const char * const quse_opts_help[] = {
@@ -46,6 +47,7 @@ static const char * const quse_opts_help[] = {
"Only search installed packages",
"Restrict matching to package or category",
"Show repository the ebuild originates from",
+   "Print matched atom using given format string",
COMMON_OPTS_HELP
 };
 #define quse_usage(ret) usage(ret, QUSE_FLAGS, quse_long_opts, quse_opts_help, 
NULL, lookup_applet_idx("quse"))
@@ -61,9 +63,10 @@ struct quse_state {
bool do_licence:1;
bool do_installed:1;
bool do_list:1;
-   bool do_repo:1;
+   bool need_full_atom:1;
depend_atom *match;
regex_t *pregv;
+   const char *fmt;
 };
 
 static char *_quse_getline_buf = NULL;
@@ -142,9 +145,8 @@ quse_search_use_local_desc(int portdirfd, struct quse_state 
*state)
if (state->do_list) {
state->retv[i] = xstrdup(q);
} else {
-   printf("%s%s/%s%s%s[%s%s%s] %s\n",
- 

[gentoo-commits] proj/portage-utils:master commit in: man/, /, man/include/

2019-07-18 Thread Fabian Groffen
commit: 94ca500baf225994b88f750262c0895553c70a8a
Author: Fabian Groffen  gentoo  org>
AuthorDate: Thu Jul 18 18:34:19 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Thu Jul 18 18:34:19 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=94ca500b

qlop: enhance running time indicator

Fix elapsed time mode (-t) when using -r displaying the elapsed time
also as the ETA.  When using -v, display what ETA is being used (average
or longest run).

Also, better document which flags can be combined with -r.

Signed-off-by: Fabian Groffen  gentoo.org>

 man/include/qlop.optdesc.yaml |  7 +--
 man/qlop.1|  7 +--
 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.

diff --git a/man/qlop.1 b/man/qlop.1
index 10eaa27..909ebdc 100644
--- a/man/qlop.1
+++ b/man/qlop.1
@@ -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\fR, \fB\-\-date\fR \fI\fR
 Limit the selection of packages to the date given, or to the range

diff --git a/qlop.c b/qlop.c
index e20c97b..fce0f69 100644
--- a/qlop.c
+++ b/qlop.c
@@ -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" :
-

[gentoo-commits] proj/portage-utils:master commit in: man/, man/include/

2019-08-17 Thread Fabian Groffen
commit: 4b27faa3832c62110573d4fa587a117047bf139c
Author: Fabian Groffen  gentoo  org>
AuthorDate: Thu Jul 18 18:38:46 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Thu Jul 18 18:38:46 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=4b27faa3

man/qlop: q -> g

g is now best matched by t, q was never doing anything in particular

Signed-off-by: Fabian Groffen  gentoo.org>

 man/include/qlop.desc | 2 +-
 man/qlop.1| 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/man/include/qlop.desc b/man/include/qlop.desc
index 3505173..e39f689 100644
--- a/man/include/qlop.desc
+++ b/man/include/qlop.desc
@@ -21,6 +21,6 @@ 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
 of reporting the time the operation finished, \fIqlop\fR now reports the
-time the operation started.  The behaviour of the old \fB-q\fR flag is
+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
 is matched by the new \fB-a\fR flag.

diff --git a/man/qlop.1 b/man/qlop.1
index 909ebdc..baa5bf5 100644
--- a/man/qlop.1
+++ b/man/qlop.1
@@ -29,7 +29,7 @@ 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
 of reporting the time the operation finished, \fIqlop\fR now reports the
-time the operation started.  The behaviour of the old \fB-q\fR flag is
+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
 is matched by the new \fB-a\fR flag.
 .SH OPTIONS



[gentoo-commits] proj/portage-utils:master commit in: man/, /, man/include/

2019-03-07 Thread Fabian Groffen
commit: 9ae56f85211d2c7c00b77b836e797339fc76f9b8
Author: Fabian Groffen  gentoo  org>
AuthorDate: Thu Mar  7 18:18:47 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Thu Mar  7 18:18:47 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=9ae56f85

qlist: change -U to display disabled flags with -v

reimplement umapstr() to allow printing flags not enabled, this is
slightly related to bug #656550.

Signed-off-by: Fabian Groffen  gentoo.org>

 man/include/qlist.optdesc.yaml |   2 +-
 man/qlist.1|   4 +-
 qlist.c| 183 ++---
 3 files changed, 119 insertions(+), 70 deletions(-)

diff --git a/man/include/qlist.optdesc.yaml b/man/include/qlist.optdesc.yaml
index a60ef0d..2b9299c 100644
--- a/man/include/qlist.optdesc.yaml
+++ b/man/include/qlist.optdesc.yaml
@@ -19,6 +19,6 @@ verbose: |
 When listing the package contents, a single \fB\-v\fR displays
 symlinks with an arrow (\->) to their target.  Two or more \fB\-v\fR
 adds colour to the entries and prints like \fB\-I\fR before the
-listing.
+listing.  Shows disabled USE-flags when used with \fB\-U\fR.
 quiet: |
 Suppresses the parenthesis around the USE-flags when used with \fB\-U\fR.

diff --git a/man/qlist.1 b/man/qlist.1
index c2c585c..4df7dab 100644
--- a/man/qlist.1
+++ b/man/qlist.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qlist "1" "Feb 2019" "Gentoo Foundation" "qlist"
+.TH qlist "1" "Mar 2019" "Gentoo Foundation" "qlist"
 .SH NAME
 qlist \- list files owned by pkgname
 .SH SYNOPSIS
@@ -60,7 +60,7 @@ When used with \fB\-I\fR, print the package version next to 
name.
 When listing the package contents, a single \fB\-v\fR displays
 symlinks with an arrow (\->) to their target.  Two or more \fB\-v\fR
 adds colour to the entries and prints like \fB\-I\fR before the
-listing.
+listing.  Shows disabled USE-flags when used with \fB\-U\fR.
 .TP
 \fB\-q\fR, \fB\-\-quiet\fR
 Suppresses the parenthesis around the USE-flags when used with \fB\-U\fR.

diff --git a/qlist.c b/qlist.c
index 4a3b95a..3ca3f5e 100644
--- a/qlist.c
+++ b/qlist.c
@@ -43,84 +43,124 @@ static const char * const qlist_opts_help[] = {
 };
 #define qlist_usage(ret) usage(ret, QLIST_FLAGS, qlist_long_opts, 
qlist_opts_help, NULL, lookup_applet_idx("qlist"))
 
-static char *
-grab_pkg_umap(q_vdb_pkg_ctx *pkg_ctx)
+static int
+cmpstringp(const void *p1, const void *p2)
+{
+   /* case insensitive comparator */
+   return strcasecmp(*((char * const *)p1), *((char * const *)p2));
+}
+
+/*
+ * ==> /var/db/pkg/mail-mta/exim-4.92/IUSE <==
+ * arc dane dcc +dkim dlfunc dmarc +dnsdb doc dovecot-sasl dsn
+ * elibc_glibc exiscan-acl gnutls idn ipv6 ldap libressl lmtp maildir
+ * mbx mysql nis pam perl pkcs11 postgres +prdr proxy radius redis sasl
+ * selinux spf sqlite srs ssl syslog tcpd +tpda X
+ *
+ * ==> /var/db/pkg/mail-mta/exim-4.92/PKGUSE <==
+ * -X dkim dmarc exiscan-acl ipv6 -ldap lmtp maildir -mbox pam -perl spf
+ * ssl tcpd
+ *
+ * ==> /var/db/pkg/mail-mta/exim-4.92/USE <==
+ * abi_x86_64 amd64 dkim dmarc dnsdb elibc_glibc exiscan-acl ipv6
+ * kernel_linux lmtp maildir pam prdr spf ssl tcpd tpda userland_GNU
+ *
+ * % emerge -pv exim
+ *
+ * These are the packages that would be merged, in order:
+ *
+ * Calculating dependencies... done!
+ * [ebuild   R   ~] mail-mta/exim-4.92::gentoo  USE="dkim dmarc dnsdb
+ * exiscan-acl ipv6 lmtp maildir pam prdr spf ssl tcpd tpda -X -arc
+ * -dane -dcc -dlfunc -doc -dovecot-sasl -dsn -gnutls -idn -ldap
+ * -libressl -mbx -mysql -nis -perl -pkcs11 -postgres -proxy -radius
+ * -redis -sasl (-selinux) -sqlite -srs -syslog" 0 KiB
+ *
+ * % qlist -IUv exim
+ * mail-mta/exim-4.92 (-arc -dane -dcc dkim -dlfunc dmarc dnsdb -doc
+ * -dovecot-sasl -dsn exiscan-acl -gnutls -idn ipv6 -ldap -libressl lmtp
+ * maildir -mbx -mysql -nis pam -perl -pkcs11 -postgres prdr -proxy
+ * -radius -redis -sasl -selinux spf -sqlite -srs ssl -syslog tcpd tpda
+ * -X)
+ */
+static char _umapstr_buf[BUFSIZ];
+static const char *
+umapstr(char display, q_vdb_pkg_ctx *pkg_ctx)
 {
-   static char umap[BUFSIZ];
-   static char *use, *iuse;
-   static size_t use_len, iuse_len;
-   int use_argc = 0, iuse_argc = 0;
-   char **use_argv = NULL, **iuse_argv = NULL;
-   queue *ll = NULL;
-   queue *sets = NULL;
-   int i, u;
+   char *bufp = _umapstr_buf;
+   char *use = NULL;
+   char *iuse = NULL;
+   size_t use_len;
+   size_t iuse_len;
+   int use_argc = 0;
+   int iuse_argc = 0;
+   char **use_argv = NULL;
+   char **iuse_argv = NULL;
+   int i;
+   int u;
+   int d;
+
+   *bufp = '\0';
+   if (!display)
+   return bufp;
 
q_vdb_pkg_eat(pkg_ctx, "USE", &use, &use_len);
if (!use[0])
-   return NULL;
+   return bufp;
q_vdb_pkg_eat(pkg_ctx, "IUSE", &iuse, &iuse_le

[gentoo-commits] proj/portage-utils:master commit in: man/, man/include/, /

2019-02-05 Thread Fabian Groffen
commit: 5674671e9d7e0e1251561d81a1154dd5d92e60ec
Author: Fabian Groffen  gentoo  org>
AuthorDate: Tue Feb  5 13:47:59 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Tue Feb  5 13:50:23 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=5674671e

qdepends: add support for BDEPEND

Bug: https://bugs.gentoo.org/674936
Signed-off-by: Fabian Groffen  gentoo.org>

 man/include/qdepends.optdesc.yaml |  8 
 man/qdepends.1| 13 -
 qdepends.c| 15 ---
 3 files changed, 24 insertions(+), 12 deletions(-)

diff --git a/man/include/qdepends.optdesc.yaml 
b/man/include/qdepends.optdesc.yaml
index 51b1cc7..5d786f3 100644
--- a/man/include/qdepends.optdesc.yaml
+++ b/man/include/qdepends.optdesc.yaml
@@ -1,13 +1,13 @@
 all: |
-Show *DEPEND, alias for \fB\-drp\fR.
+Show *DEPEND, alias for \fB\-drpb\fR.
 key: |
 Advanced option to allow querying the VDB.  This option overrides
-\fB\-d\fR, \fB\-r\fR, \fB\-p\fR or \fB\-a\fR.  \fI\fR can be
-any key from Portage's VDB, e.g.\ any file from
+\fB\-d\fR, \fB\-r\fR, \fB\-p\fR, \fB\-b\fR or \fB\-a\fR.
+\fI\fR can be any key from Portage's VDB, e.g.\ any file from
 var/db/pkg///.
 query: |
 Query reverse deps.  This basically reverses the search to any
-package that references \fI\fR in DEPEND, RDEPEND or PDEPEND.
+package that references \fI\fR in DEPEND, RDEPEND, PDEPEND or BDEPEND.
 This can be useful to find consumers of a given package, e.g.\ to
 search for packages that have \fIlogwatch\fR in their DEPEND.
 name-only: |

diff --git a/man/qdepends.1 b/man/qdepends.1
index 2e1aab2..0273999 100644
--- a/man/qdepends.1
+++ b/man/qdepends.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qdepends "1" "May 2018" "Gentoo Foundation" "qdepends"
+.TH qdepends "1" "Feb 2019" "Gentoo Foundation" "qdepends"
 .SH NAME
 qdepends \- show dependency info
 .SH SYNOPSIS
@@ -32,15 +32,18 @@ Show RDEPEND info.
 \fB\-p\fR, \fB\-\-pdepend\fR
 Show PDEPEND info.
 .TP
+\fB\-b\fR, \fB\-\-bdepend\fR
+Show BDEPEND info.
+.TP
 \fB\-k\fR \fI\fR, \fB\-\-key\fR \fI\fR
 Advanced option to allow querying the VDB.  This option overrides
-\fB\-d\fR, \fB\-r\fR, \fB\-p\fR or \fB\-a\fR.  \fI\fR can be
-any key from Portage's VDB, e.g.\ any file from
+\fB\-d\fR, \fB\-r\fR, \fB\-p\fR, \fB\-b\fR or \fB\-a\fR.
+\fI\fR can be any key from Portage's VDB, e.g.\ any file from
 var/db/pkg///.
 .TP
 \fB\-Q\fR \fI\fR, \fB\-\-query\fR \fI\fR
 Query reverse deps.  This basically reverses the search to any
-package that references \fI\fR in DEPEND, RDEPEND or PDEPEND.
+package that references \fI\fR in DEPEND, RDEPEND, PDEPEND or BDEPEND.
 This can be useful to find consumers of a given package, e.g.\ to
 search for packages that have \fIlogwatch\fR in their DEPEND.
 .TP
@@ -48,7 +51,7 @@ search for packages that have \fIlogwatch\fR in their DEPEND.
 Only show category/package, instead of category/package-version.
 .TP
 \fB\-a\fR, \fB\-\-all\fR
-Show *DEPEND, alias for \fB\-drp\fR.
+Show *DEPEND, alias for \fB\-drpb\fR.
 .TP
 \fB\-f\fR, \fB\-\-format\fR
 Pretty-print DEPEND declaration to be used in an ebuild.  This

diff --git a/qdepends.c b/qdepends.c
index e6b9bcf..92ae57b 100644
--- a/qdepends.c
+++ b/qdepends.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005-2018 Gentoo Authors
+ * Copyright 2005-2019 Gentoo Authors
  * Distributed under the terms of the GNU General Public License v2
  *
  * Copyright 2005-2010 Ned Ludd- 
@@ -9,11 +9,12 @@
 
 #ifdef APPLET_qdepends
 
-#define QDEPENDS_FLAGS "drpafNk:Q:" COMMON_FLAGS
+#define QDEPENDS_FLAGS "drpbafNk:Q:" COMMON_FLAGS
 static struct option const qdepends_long_opts[] = {
{"depend",no_argument, NULL, 'd'},
{"rdepend",   no_argument, NULL, 'r'},
{"pdepend",   no_argument, NULL, 'p'},
+   {"bdepend",   no_argument, NULL, 'b'},
{"key",a_argument, NULL, 'k'},
{"query",  a_argument, NULL, 'Q'},
{"name-only", no_argument, NULL, 'N'},
@@ -25,6 +26,7 @@ static const char * const qdepends_opts_help[] = {
"Show DEPEND info (default)",
"Show RDEPEND info",
"Show PDEPEND info",
+   "Show BDEPEND info",
"User defined vdb key",
"Query reverse deps",
"Only show package name",
@@ -639,7 +641,13 @@ int qdepends_main(int argc, char **argv)
bool do_format = false;
const char *query = NULL;
const char *depend_file;
-   const char *depend_files[] = { "DEPEND", "RDEPEND", "PDEPEND", NULL, 
NULL };
+   const char *depend_files[] = {
+   /* 0 */ "DEPEND",
+   /* 1 */ "RDEPEND",
+   /* 2 */ "PDEPEND",
+   /* 3 */ "BDEPEND",
+   /* 4 */ NULL
+   };
 
depend_file = depend_files[0];
 
@@ -650,6 +658,7 @@ int qdepends_main(int argc, char **argv)
case 'd': depend_file = dep

[gentoo-commits] proj/portage-utils:master commit in: man/, /, man/include/

2019-03-29 Thread Fabian Groffen
commit: c701892114d5b3eea773ff13f013f4d3a71fa571
Author: Fabian Groffen  gentoo  org>
AuthorDate: Fri Mar 29 16:31:50 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Fri Mar 29 16:31:50 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=c7018921

qlop: support standard date output format in parse_date

This allows to cut 'n' paste dates to limit output.

Signed-off-by: Fabian Groffen  gentoo.org>

 man/include/qlop.optdesc.yaml |  3 +++
 man/qlop.1|  5 -
 qlop.c| 14 +-
 3 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/man/include/qlop.optdesc.yaml b/man/include/qlop.optdesc.yaml
index a8fae61..25143b2 100644
--- a/man/include/qlop.optdesc.yaml
+++ b/man/include/qlop.optdesc.yaml
@@ -13,6 +13,9 @@ date: |
 .IP -MM-DD
 Big-endian date, with components separated by hyphens, starting with
 year, followed by month and day of month.
+.IP -MM-DDThh:mm:ss
+As before, but hours, minutes and seconds added.  This is the same
+format qlop prints for timestamps.
 .IP S
 Seconds since 1970-01-01 00:00:00 + (UTC), the UNIX epoch.
 .IP FORMAT|DATE

diff --git a/man/qlop.1 b/man/qlop.1
index 407c9ea..f0ef69a 100644
--- a/man/qlop.1
+++ b/man/qlop.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qlop "1" "Feb 2019" "Gentoo Foundation" "qlop"
+.TH qlop "1" "Mar 2019" "Gentoo Foundation" "qlop"
 .SH NAME
 qlop \- emerge log analyzer
 .SH SYNOPSIS
@@ -89,6 +89,9 @@ Alias for \fI1 day ago\fR.
 .IP -MM-DD
 Big-endian date, with components separated by hyphens, starting with
 year, followed by month and day of month.
+.IP -MM-DDThh:mm:ss
+As before, but hours, minutes and seconds added.  This is the same
+format qlop prints for timestamps.
 .IP S
 Seconds since 1970-01-01 00:00:00 + (UTC), the UNIX epoch.
 .IP FORMAT|DATE

diff --git a/qlop.c b/qlop.c
index b6970d0..a87cc5c 100644
--- a/qlop.c
+++ b/qlop.c
@@ -103,17 +103,21 @@ parse_date(const char *sdate, time_t *t)
return false;
} else {
/* Handle automatic formats:
-* - "12315128"   -> %s
-* - "2015-12-24" -> %Y-%m-%d
+* - "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-");
+   size_t len = strspn(sdate, "0123456789-:T");
if (sdate[len] == '\0') {
const char *fmt;
-   if (strchr(sdate, '-') == NULL)
+   if (strchr(sdate, '-') == NULL) {
fmt = "%s";
-   else
+   } else if ((s = strchr(sdate, 'T')) == NULL) {
fmt = "%Y-%m-%d";
+   } else {
+   fmt = "%Y-%m-%dT%H:%M:%S";
+   }
 
s = strptime(sdate, fmt, &tm);
if (s == NULL || s[0] != '\0')



[gentoo-commits] proj/portage-utils:master commit in: man/, man/include/, /

2020-05-16 Thread Fabian Groffen
commit: a0780928edc76543e63709c915fb7d581bd13291
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sat May 16 14:29:45 2020 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sat May 16 14:29:45 2020 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=a0780928

qfile: print symlink targets in verbose mode

e.g.:
% qfile -v /bin/csh
app-shells/tcsh-6.21.00-r1: /bin/csh -> tcsh

Signed-off-by: Fabian Groffen  gentoo.org>

 man/include/qfile.optdesc.yaml | 6 +++---
 man/qfile.1| 8 
 qfile.c| 6 +-
 3 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/man/include/qfile.optdesc.yaml b/man/include/qfile.optdesc.yaml
index 66ee885..9e1d24b 100644
--- a/man/include/qfile.optdesc.yaml
+++ b/man/include/qfile.optdesc.yaml
@@ -1,7 +1,7 @@
 verbose: |
-Print package versions to matches, warn about problems with
-resolving symlinks or positioning packages under an alternative
-root.
+Print package versions and symlink targets for matches, warn about
+problems with resolving symlinks or positioning packages under an
+alternative root.
 quiet: |
 Don't print matching file for matches, just the package.  Don't
 report about orphan files.

diff --git a/man/qfile.1 b/man/qfile.1
index 7501311..7caa459 100644
--- a/man/qfile.1
+++ b/man/qfile.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qfile "1" "Nov 2019" "Gentoo Foundation" "qfile"
+.TH qfile "1" "May 2020" "Gentoo Foundation" "qfile"
 .SH NAME
 qfile \- list all pkgs owning files
 .SH SYNOPSIS
@@ -62,9 +62,9 @@ Don't look in the prunelib registry.
 Set the ROOT env var.
 .TP
 \fB\-v\fR, \fB\-\-verbose\fR
-Print package versions to matches, warn about problems with
-resolving symlinks or positioning packages under an alternative
-root.
+Print package versions and symlink targets for matches, warn about
+problems with resolving symlinks or positioning packages under an
+alternative root.
 .TP
 \fB\-q\fR, \fB\-\-quiet\fR
 Don't print matching file for matches, just the package.  Don't

diff --git a/qfile.c b/qfile.c
index d104848..efac60e 100644
--- a/qfile.c
+++ b/qfile.c
@@ -305,8 +305,12 @@ static int qfile_cb(tree_pkg_ctx *pkg_ctx, void *priv)
printf("%s", atom_format(state->format, atom));
if (quiet)
puts("");
+   else if (verbose && e->type == CONTENTS_SYM)
+   printf(": %s%s -> %s\n",
+   state->root ? 
state->root : "",
+   e->name, e->sym_target);
else
-   printf(": %s%s\n", state->root ? : "", 
e->name);
+   printf(": %s%s\n", state->root ? 
state->root : "", e->name);
} else {
non_orphans[i] = 1;
}



[gentoo-commits] proj/portage-utils:master commit in: man/, man/include/

2018-04-01 Thread Fabian Groffen
commit: b10334e70c272bb554228acea075011925f260fb
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sun Apr  1 12:44:30 2018 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sun Apr  1 12:44:30 2018 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=b10334e7

man/qlop: regen manpage

commit fe42f2a99297fed36720e71ba2ed77cf7a9da804 changed the generated
file, this commit ensures that future regenerate operations don't lose
the changes

 man/include/qlop.desc |  4 
 man/include/qlop.optdesc.yaml | 15 +++
 man/qlop.1| 26 +++---
 3 files changed, 34 insertions(+), 11 deletions(-)

diff --git a/man/include/qlop.desc b/man/include/qlop.desc
new file mode 100644
index 000..d99cc94
--- /dev/null
+++ b/man/include/qlop.desc
@@ -0,0 +1,4 @@
+.I qlop
+reads from $EMERGE_LOG_DIR/emerge.log and tries to extract
+information about merges, unmerges and syncs.  For packages, it can
+calculate average merge times or just list them.

diff --git a/man/include/qlop.optdesc.yaml b/man/include/qlop.optdesc.yaml
new file mode 100644
index 000..7864d6e
--- /dev/null
+++ b/man/include/qlop.optdesc.yaml
@@ -0,0 +1,15 @@
+gauge: |
+Gauge number of times a package has been merged.  This shows the
+merge time for each individual merge of package.
+time: |
+Calculate merge time for a specific package.  This is the average
+time for all merges of package.
+human: |
+Print seconds in human readable format (needs \fB\-t\fR), using
+minutes, hours and days instead of just seconds.
+current: |
+Show current emerging packages.  This relies on
+.I FEATURES=sandbox
+in order to detect running merges.
+verbose: |
+Print package versions and revisions.

diff --git a/man/qlop.1 b/man/qlop.1
index 70fb411..c138054 100644
--- a/man/qlop.1
+++ b/man/qlop.1
@@ -1,26 +1,28 @@
-.TH qlop "1" "Mar 2018" "Gentoo Foundation" "qlop"
+.\" generated by mkman.py, please do NOT edit!
+.TH qlop "1" "Apr 2018" "Gentoo Foundation" "qlop"
 .SH NAME
 qlop \- emerge log analyzer
 .SH SYNOPSIS
 .B qlop
 \fI[opts] \fR
 .SH DESCRIPTION
-qlop reads from $EMERGE_LOG_DIR/emerge.log and tries to extract
+.I qlop
+reads from $EMERGE_LOG_DIR/emerge.log and tries to extract
 information about merges, unmerges and syncs.  For packages, it can
 calculate average merge times or just list them.
 .SH OPTIONS
 .TP
 \fB\-g\fR, \fB\-\-gauge\fR
-Gauge number of times a package has been merged.  This shows the merge
-time for each individual merge of package.
+Gauge number of times a package has been merged.  This shows the
+merge time for each individual merge of package.
 .TP
 \fB\-t\fR, \fB\-\-time\fR
-Calculate merge time for a specific package.  This is the average time
-for all merges of package.
+Calculate merge time for a specific package.  This is the average
+time for all merges of package.
 .TP
 \fB\-H\fR, \fB\-\-human\fR
-Print seconds in human readable format (needs -t), using minutes, hours
-and days instead of just seconds.
+Print seconds in human readable format (needs \fB\-t\fR), using
+minutes, hours and days instead of just seconds.
 .TP
 \fB\-l\fR, \fB\-\-list\fR
 Show merge history.
@@ -32,8 +34,9 @@ Show unmerge history.
 Show sync history.
 .TP
 \fB\-c\fR, \fB\-\-current\fR
-Show current emerging packages.  This relies on FEATURES=sandbox in
-order to detect running merges.
+Show current emerging packages.  This relies on
+.I FEATURES=sandbox
+in order to detect running merges.
 .TP
 \fB\-d\fR \fI\fR, \fB\-\-date\fR \fI\fR
 Limit selection to this time (1st -d is start, 2nd -d is end).
@@ -62,7 +65,8 @@ Print version and exit.
 .SH "REPORTING BUGS"
 Please report bugs via http://bugs.gentoo.org/
 .br
-Product: Portage Development; Component: Tools
+Product: Portage Development; Component: Tools, Assignee:
+portage-ut...@gentoo.org
 .SH AUTHORS
 .nf
 Ned Ludd 



[gentoo-commits] proj/portage-utils:master commit in: man/, man/include/

2018-04-01 Thread Fabian Groffen
commit: 3b1cb130c9d20ef0d1190d7b7baf25a910765167
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sun Apr  1 13:47:10 2018 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sun Apr  1 13:47:10 2018 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=3b1cb130

man/qdepends: improve manpage

Bug https://bugs.gentoo.org/645554

 man/include/qdepends-05-examples.include | 17 +++
 man/include/qdepends.desc| 10 +++--
 man/include/qdepends.optdesc.yaml| 29 
 man/qdepends.1   | 77 
 4 files changed, 111 insertions(+), 22 deletions(-)

diff --git a/man/include/qdepends-05-examples.include 
b/man/include/qdepends-05-examples.include
index d4779ea..04fb92f 100644
--- a/man/include/qdepends-05-examples.include
+++ b/man/include/qdepends-05-examples.include
@@ -6,3 +6,20 @@ For finding out what a particular package depends on for 
building, you could do:
 .fi
 This tells us that we have \fIapp-editors/nano-2.3.2\fR installed and it 
depends
 on ncurses (among other things).
+
+Searching for packages that actually have nano in their RDEPEND:
+.nf
+   $ \fIqdepends -rQ nano\fR
+   virtual/editor-0
+.fi
+Tells us that \fIvirtual/editor\fR depends on nano.  However, if we
+wanted to know in what way a package specifically depends on another
+package, one can use \fB\-v\fR.
+.nf
+   $ \fIqdepends -vrQ logrotate\fR
+   sys-apps/portage-2.3.18: >=app-admin/logrotate-3.8.0
+.fi
+This way we can see there is a specific dependency expressed here.  If
+the above had used \fI\fR can be
+any key from Portage's VDB, e.g.\ any file from
+var/db/pkg///.
+query: |
+Query reverse deps.  This basically reverses the search to any
+package that references \fI\fR in DEPEND, RDEPEND or PDEPEND.
+This can be useful to find consumers of a given package, e.g.\ to
+search for packages that have \fIlogwatch\fR in their DEPEND.
+name-only: |
+Only show category/package, instead of category/package-version.
+format: |
+Pretty-print DEPEND declaration to be used in an ebuild.  This
+option initiates a very different mode of operation.  Instead of
+printing searching through packages, it constructs a multi-line
+statement in with shell syntax, to be used in an ebuild.  Each
+argument is turned into a separate DEPEND variable declaration.  You
+need to quote dependency strings in order for them to be printed as
+a single dependency declaration.  When used with the \fB\-q\fR
+option, only the pretty-printed dependency declaration is printed,
+e.g.\ the DEPEND= part is skipped.
+verbose: |
+When in reverse dep mode, print the package or packages that matched
+the query from the dependency line being searched.  This includes
+specifiers and versions.
+quiet: Suppress DEPEND= output for \fB\-f\fR.

diff --git a/man/qdepends.1 b/man/qdepends.1
index a0cac5b..c51a02d 100644
--- a/man/qdepends.1
+++ b/man/qdepends.1
@@ -1,64 +1,85 @@
-.TH qdepends "1" "Mar 2016" "Gentoo Foundation" "qdepends"
+.\" generated by mkman.py, please do NOT edit!
+.TH qdepends "1" "Apr 2018" "Gentoo Foundation" "qdepends"
 .SH NAME
 qdepends \- show dependency info
 .SH SYNOPSIS
 .B qdepends
 \fI[opts] \fR
 .SH DESCRIPTION
-The qdepends applet has a couple different modes.  Normally it is geared 
towards
+The
+.I qdepends
+applet has a couple different modes.  Normally it is geared towards
 answering the queries "what does package X depend on" and "what packages depend
 on X".  Both can further be classified into build, run, and post dependencies.
 
 By default, it will tell you the build time dependencies only (DEPEND).
 
-Currently, qdepends will only query installed packages.  There is no support 
for
-querying packages not yet installed (the \fBequery\fR(1) tool can do that).
+Currently,
+.I qdepends
+will only query installed packages.  There is no support for
+querying packages not yet installed (see \fBequery\fR(1) for that).
 
 If there is no answer to your query (i.e. you've asked for a package that is 
not
 installed, or a version that does not match), then you will get back no output.
 .SH OPTIONS
 .TP
 \fB\-d\fR, \fB\-\-depend\fR
-Show DEPEND info (default)
+Show DEPEND info (default).
 .TP
 \fB\-r\fR, \fB\-\-rdepend\fR
-Show RDEPEND info
+Show RDEPEND info.
 .TP
 \fB\-p\fR, \fB\-\-pdepend\fR
-Show PDEPEND info
+Show PDEPEND info.
 .TP
 \fB\-k\fR \fI\fR, \fB\-\-key\fR \fI\fR
-User defined vdb key
+Advanced option to allow querying the VDB.  This option overrides
+\fB\-d\fR, \fB\-r\fR, \fB\-p\fR or \fB\-a\fR.  \fI\fR can be
+any key from Portage's VDB, e.g.\ any file from
+var/db/pkg///.
 .TP
 \fB\-Q\fR \fI\fR, \fB\-\-query\fR \fI\fR
-Query reverse deps
+Query reverse deps.  This basically reverses the search to any
+package that references \fI\fR in DEPEND, RDEPEND or PDEPEND.
+This can be useful to find consumers of a given package, e.g.\ to

[gentoo-commits] proj/portage-utils:master commit in: man/, man/include/

2018-04-02 Thread Fabian Groffen
commit: 9164549006068637d060a23a9a24f657982bfbaf
Author: Fabian Groffen  gentoo  org>
AuthorDate: Mon Apr  2 17:26:35 2018 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Mon Apr  2 17:26:35 2018 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=91645490

qatom: improve manpage

Bug: https://bugs.gentoo.org/645554

 man/include/qatom.desc | 15 +
 man/include/qatom.optdesc.yaml | 43 
 man/qatom.1| 74 --
 3 files changed, 122 insertions(+), 10 deletions(-)

diff --git a/man/include/qatom.desc b/man/include/qatom.desc
new file mode 100644
index 000..10f0c1c
--- /dev/null
+++ b/man/include/qatom.desc
@@ -0,0 +1,15 @@
+\fIqatom\fR parses strings into atoms and optionally compares them.  The
+parsing into atoms results in CATEGORY, PN (package name), PV (package
+version), PR (package revision), SLOT and REPO.  Next to these version
+qualifiers (e.g.\ >, <, or =) and optional * suffix are extracted.  All
+but PN are optional.
+
+Comparison of atoms returns the relationship between two parsed atoms.
+\fIqatom\fR does not allow to test conditions.  It is possible to
+perform multiple comparisons by simply adding more arguments.
+Comparisons are, however, always performed two by two, so there must be
+an even count of arguments to the compare function.
+
+The \fIqatom\fR applet is a direct wrapper around the atom parsing
+functionalities used by various other applets.  As such this applet
+allows easy testing or atom parsing and comparison behaviour.

diff --git a/man/include/qatom.optdesc.yaml b/man/include/qatom.optdesc.yaml
new file mode 100644
index 000..e71dfb7
--- /dev/null
+++ b/man/include/qatom.optdesc.yaml
@@ -0,0 +1,43 @@
+format: |
+Specify a custom  output  format.  The default format is
+.nf
+%{CATEGORY} %{PN} %{PV} %[PR] %[SLOT] %[pfx] %[sfx]
+.fi
+Conversion specifiers start with a \fI%\fR symbol and are followed
+by either \fI{\fR or \fI[\fR.  Next is the name of the field to
+expand, followed by a matching \fI}\fR or \fI]\fR.  The difference
+between \fI{\fR and \fI[\fR is that the latter is only printed if
+the field referred is set, while the former prints \fI\fR in
+that case.
+
+The following fields are supported, which are inline with the
+variables from \fBebuild\fR(5).
+.RS
+.IP CATEGORY
+The category of the package.
+.IP P
+The package name and version without the ebuild revision.
+.IP PN
+The package name.
+.IP PV
+The package version without the ebuild revision.
+.IP PVR
+The package version including ebuild revision, which is also printed
+when zero, unlike for \fIPF\fR.
+.IP PF
+The package name, version and revision when not zero.  Thus, a zero
+revision \fI\-r0\fR is not printed.
+.IP PR
+The ebuild revision, when force printed, outputs \fI\-r0\fR when unset.
+.IP SLOT
+The package slot, when force printed, outputs \fI\-\fR when unset.
+.IP REPO
+The package repository.
+.IP pfx
+The package prefixes, that is version specifiers.
+.IP sfx
+The package suffices, currently that is just the asterisk.
+.RE
+verbose: Force all expansions, basically treat all \fI[\fR like \fI{\fR.
+quiet: Ignored for compatibility with other qapplets.
+nocolor: Ignored for compatibility with other qapplets.

diff --git a/man/qatom.1 b/man/qatom.1
index 4a30343..aeb9629 100644
--- a/man/qatom.1
+++ b/man/qatom.1
@@ -1,41 +1,95 @@
-.TH qatom "1" "Mar 2016" "Gentoo Foundation" "qatom"
+.\" generated by mkman.py, please do NOT edit!
+.TH qatom "1" "Apr 2018" "Gentoo Foundation" "qatom"
 .SH NAME
 qatom \- split atom strings
 .SH SYNOPSIS
 .B qatom
 \fI[opts] \fR
 .SH DESCRIPTION
+\fIqatom\fR parses strings into atoms and optionally compares them.  The
+parsing into atoms results in CATEGORY, PN (package name), PV (package
+version), PR (package revision), SLOT and REPO.  Next to these version
+qualifiers (e.g.\ >, <, or =) and optional * suffix are extracted.  All
+but PN are optional.
 
+Comparison of atoms returns the relationship between two parsed atoms.
+\fIqatom\fR does not allow to test conditions.  It is possible to
+perform multiple comparisons by simply adding more arguments.
+Comparisons are, however, always performed two by two, so there must be
+an even count of arguments to the compare function.
+
+The \fIqatom\fR applet is a direct wrapper around the atom parsing
+functionalities used by various other applets.  As such this applet
+allows easy testing or atom parsing and comparison behaviour.
 .SH OPTIONS
 .TP
 \fB\-F\fR \fI\fR, \fB\-\-format\fR \fI\fR
-Custom output format (default: %{CATEGORY} %{PN} %{PV} %[PR] %[SLOT] %[pfx] 
%[sfx])
+Specify a custom  output  format.  The default format is
+.nf
+%{CATEGORY} %{PN} %{PV} %[PR] %[SLOT] %[pfx] %[sfx]
+.fi
+Conversion specifiers start with a \fI%

[gentoo-commits] proj/portage-utils:master commit in: man/, man/include/, /

2018-04-03 Thread Fabian Groffen
commit: 1def9d468742c0d6d6b24aa1f1d76243be6e24cd
Author: Fabian Groffen  gentoo  org>
AuthorDate: Tue Apr  3 11:49:41 2018 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Tue Apr  3 11:49:41 2018 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=1def9d46

qlist: improve documentation

Bug: https://bugs.gentoo.org/645554

 man/include/qlist.desc |  6 +
 man/include/qlist.optdesc.yaml | 24 ++
 man/qlist.1| 56 +++---
 qlist.c|  2 +-
 4 files changed, 67 insertions(+), 21 deletions(-)

diff --git a/man/include/qlist.desc b/man/include/qlist.desc
new file mode 100644
index 000..e02d971
--- /dev/null
+++ b/man/include/qlist.desc
@@ -0,0 +1,6 @@
+\fIqlist\fR shows the contents, or a subset thereof, of an installed
+package.  Alternatively, lists whether a package is installed,
+optionally with version, USE-flag, SLOT or REPO information.  The
+\fIpkgname\fR to query for does not have to be an exact match, it may be
+part of it, e.g.\ an entire category, or any package with some string in
+its name.

diff --git a/man/include/qlist.optdesc.yaml b/man/include/qlist.optdesc.yaml
new file mode 100644
index 000..a60ef0d
--- /dev/null
+++ b/man/include/qlist.optdesc.yaml
@@ -0,0 +1,24 @@
+installed: |
+Instead of listing the contents of a package, just print the package
+name if the package is currently installed.
+umap: |
+List USE-flags enabled when the package was installed.  This flag
+implies \fB\-I\fR.
+slot: |
+Display installed packages with slots (use twice for subslots).
+This flag implies \fB\-I\fR.
+repo: |
+Display installed packages with repository the ebuild originated from.
+This flag implies \fB\-I\fR.
+columns: |
+Like \fB\-Iv\fR, but package name and version are separated by a
+space for easy consumption by e.g.\ shell scripts which can read
+space-separated columns.
+verbose: |
+When used with \fB\-I\fR, print the package version next to name.
+When listing the package contents, a single \fB\-v\fR displays
+symlinks with an arrow (\->) to their target.  Two or more \fB\-v\fR
+adds colour to the entries and prints like \fB\-I\fR before the
+listing.
+quiet: |
+Suppresses the parenthesis around the USE-flags when used with \fB\-U\fR.

diff --git a/man/qlist.1 b/man/qlist.1
index 05e9326..f7dd847 100644
--- a/man/qlist.1
+++ b/man/qlist.1
@@ -1,68 +1,84 @@
-.TH qlist "1" "Mar 2016" "Gentoo Foundation" "qlist"
+.\" generated by mkman.py, please do NOT edit!
+.TH qlist "1" "Apr 2018" "Gentoo Foundation" "qlist"
 .SH NAME
 qlist \- list files owned by pkgname
 .SH SYNOPSIS
 .B qlist
 \fI[opts] \fR
 .SH DESCRIPTION
-
+\fIqlist\fR shows the contents, or a subset thereof, of an installed
+package.  Alternatively, lists whether a package is installed,
+optionally with version, USE-flag, SLOT or REPO information.  The
+\fIpkgname\fR to query for does not have to be an exact match, it may be
+part of it, e.g.\ an entire category, or any package with some string in
+its name.
 .SH OPTIONS
 .TP
 \fB\-I\fR, \fB\-\-installed\fR
-Just show installed packages
+Instead of listing the contents of a package, just print the package
+name if the package is currently installed.
 .TP
 \fB\-S\fR, \fB\-\-slots\fR
-Display installed packages with slots (use twice for subslots)
+Display installed packages with slots (use twice for subslots).
 .TP
 \fB\-R\fR, \fB\-\-repo\fR
-Display installed packages with repository
+Display installed packages with repository the ebuild originated from.
+This flag implies \fB\-I\fR.
 .TP
 \fB\-U\fR, \fB\-\-umap\fR
-Display installed packages with flags used
+List USE-flags enabled when the package was installed.  This flag
+implies \fB\-I\fR.
 .TP
 \fB\-c\fR, \fB\-\-columns\fR
-Display column view
+Like \fB\-Iv\fR, but package name and version are separated by a
+space for easy consumption by e.g.\ shell scripts which can read
+space-separated columns.
 .TP
 \fB\-\-showdebug\fR
-Show /usr/lib/debug files
+Show /usr/lib/debug and /usr/src/debug files.
 .TP
 \fB\-e\fR, \fB\-\-exact\fR
-Exact match (only CAT/PN or PN without PV)
+Exact match (only CAT/PN or PN without PV).
 .TP
 \fB\-a\fR, \fB\-\-all\fR
-Show every installed package
+Show every installed package.
 .TP
 \fB\-d\fR, \fB\-\-dir\fR
-Only show directories
+Only show directories.
 .TP
 \fB\-o\fR, \fB\-\-obj\fR
-Only show objects
+Only show objects.
 .TP
 \fB\-s\fR, \fB\-\-sym\fR
-Only show symlinks
+Only show symlinks.
 .TP
 \fB\-\-root\fR \fI\fR
-Set the ROOT env var
+Set the ROOT env var.
 .TP
 \fB\-v\fR, \fB\-\-verbose\fR
-Make a lot of noise
+When used with \fB\-I\fR, print the package version next to name.
+When listing the package contents, a single \fB\-v\fR displays
+symlinks with an arrow (\->) to their target.  Two or more \fB\-v\fR
+adds colour to the entries and prints like \fB\-I\fR before the
+list

[gentoo-commits] proj/portage-utils:master commit in: man/, man/include/

2018-04-03 Thread Fabian Groffen
commit: 86085691d6a42e497c1a8902cf7c24212a2dd67d
Author: Fabian Groffen  gentoo  org>
AuthorDate: Tue Apr  3 12:56:17 2018 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Tue Apr  3 12:56:17 2018 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=86085691

qpkg: improve documentation

Bug: https://bugs.gentoo.org/645554

 man/include/qpkg.desc |  4 
 man/include/qpkg.optdesc.yaml |  2 ++
 man/qpkg.1| 31 ++-
 3 files changed, 24 insertions(+), 13 deletions(-)

diff --git a/man/include/qpkg.desc b/man/include/qpkg.desc
new file mode 100644
index 000..2bba24b
--- /dev/null
+++ b/man/include/qpkg.desc
@@ -0,0 +1,4 @@
+\fIqpkg\fR creates or cleans up Gentoo binary packages.  The default
+action is to create a new binpkg for the given package names and store
+them in pkgdir, which can be set explicitly using the \fB\-\-pkgdir\fR
+option.

diff --git a/man/include/qpkg.optdesc.yaml b/man/include/qpkg.optdesc.yaml
new file mode 100644
index 000..2da2810
--- /dev/null
+++ b/man/include/qpkg.optdesc.yaml
@@ -0,0 +1,2 @@
+verbose: Check and report MD5 hash mismatches during install.
+quiet: Ignored for compatability with other qapplets.

diff --git a/man/qpkg.1 b/man/qpkg.1
index 8bb098a..930d15c 100644
--- a/man/qpkg.1
+++ b/man/qpkg.1
@@ -1,47 +1,52 @@
-.TH qpkg "1" "Mar 2016" "Gentoo Foundation" "qpkg"
+.\" generated by mkman.py, please do NOT edit!
+.TH qpkg "1" "Apr 2018" "Gentoo Foundation" "qpkg"
 .SH NAME
 qpkg \- manipulate Gentoo binpkgs
 .SH SYNOPSIS
 .B qpkg
 \fI[opts] \fR
 .SH DESCRIPTION
-
+\fIqpkg\fR creates or cleans up Gentoo binary packages.  The default
+action is to create a new binpkg for the given package names and store
+them in pkgdir, which can be set explicitly using the \fB\-\-pkgdir\fR
+option.
 .SH OPTIONS
 .TP
 \fB\-c\fR, \fB\-\-clean\fR
-clean pkgdir of unused binary files
+clean pkgdir of unused binary files.
 .TP
 \fB\-E\fR, \fB\-\-eclean\fR
-clean pkgdir of files not in the tree anymore (slow)
+clean pkgdir of files not in the tree anymore (slow).
 .TP
 \fB\-p\fR, \fB\-\-pretend\fR
-pretend only
+pretend only.
 .TP
 \fB\-P\fR \fI\fR, \fB\-\-pkgdir\fR \fI\fR
-alternate package directory
+alternate package directory.
 .TP
 \fB\-\-root\fR \fI\fR
-Set the ROOT env var
+Set the ROOT env var.
 .TP
 \fB\-v\fR, \fB\-\-verbose\fR
-Make a lot of noise
+Check and report MD5 hash mismatches during install.
 .TP
 \fB\-q\fR, \fB\-\-quiet\fR
-Tighter output; suppress warnings
+Ignored for compatability with other qapplets.
 .TP
 \fB\-C\fR, \fB\-\-nocolor\fR
-Don't output color
+Don't output color.
 .TP
 \fB\-h\fR, \fB\-\-help\fR
-Print this help and exit
+Print this help and exit.
 .TP
 \fB\-V\fR, \fB\-\-version\fR
-Print version and exit
+Print version and exit.
 
 .SH "REPORTING BUGS"
 Please report bugs via http://bugs.gentoo.org/
 .br
-Product: Portage Development; Component: Tools
+Product: Portage Development; Component: Tools, Assignee:
+portage-ut...@gentoo.org
 .SH AUTHORS
 .nf
 Ned Ludd 



[gentoo-commits] proj/portage-utils:master commit in: man/, man/include/

2018-04-03 Thread Fabian Groffen
commit: f24b626027dceb5890b134837c6683f4593f6ce0
Author: Fabian Groffen  gentoo  org>
AuthorDate: Tue Apr  3 12:15:35 2018 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Tue Apr  3 12:15:35 2018 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=f24b6260

qmerge: improve documentation

Bug: https://bugs.gentoo.org/645554

 man/include/qmerge.desc |  6 ++
 man/qmerge.1| 43 +--
 2 files changed, 31 insertions(+), 18 deletions(-)

diff --git a/man/include/qmerge.desc b/man/include/qmerge.desc
new file mode 100644
index 000..08589ec
--- /dev/null
+++ b/man/include/qmerge.desc
@@ -0,0 +1,6 @@
+\fIqmerge\fR retrieves and installs Gentoo binary packages.  Simple
+dependency checking is performed, after which \fIqmerge\fR just unpacks
+the binpkg onto the filesystem and registers the package in the VDB.
+
+Retrieval of packages from a remote binhost is currently performed using
+\fBwget\fR(1).  More specifically, \fIFETCHCOMMAND\fR is ignored.

diff --git a/man/qmerge.1 b/man/qmerge.1
index f3d80db..f66908e 100644
--- a/man/qmerge.1
+++ b/man/qmerge.1
@@ -1,65 +1,72 @@
-.TH qmerge "1" "Mar 2016" "Gentoo Foundation" "qmerge"
+.\" generated by mkman.py, please do NOT edit!
+.TH qmerge "1" "Apr 2018" "Gentoo Foundation" "qmerge"
 .SH NAME
 qmerge \- fetch and merge binary package
 .SH SYNOPSIS
 .B qmerge
 \fI[opts] \fR
 .SH DESCRIPTION
+\fIqmerge\fR retrieves and installs Gentoo binary packages.  Simple
+dependency checking is performed, after which \fIqmerge\fR just unpacks
+the binpkg onto the filesystem and registers the package in the VDB.
 
+Retrieval of packages from a remote binhost is currently performed using
+\fBwget\fR(1).  More specifically, \fIFETCHCOMMAND\fR is ignored.
 .SH OPTIONS
 .TP
 \fB\-f\fR, \fB\-\-fetch\fR
-Fetch package and newest Packages metadata
+Fetch package and newest Packages metadata.
 .TP
 \fB\-F\fR, \fB\-\-force\fR
-Fetch package (skipping Packages)
+Fetch package (skipping Packages).
 .TP
 \fB\-s\fR, \fB\-\-search\fR
-Search available packages
+Search available packages.
 .TP
 \fB\-K\fR, \fB\-\-install\fR
-Install package
+Install package.
 .TP
 \fB\-U\fR, \fB\-\-unmerge\fR
-Uninstall package
+Uninstall package.
 .TP
 \fB\-p\fR, \fB\-\-pretend\fR
-Pretend only
+Pretend only.
 .TP
 \fB\-u\fR, \fB\-\-update\fR
-Update only
+Update only.
 .TP
 \fB\-y\fR, \fB\-\-yes\fR
-Don't prompt before overwriting
+Don't prompt before overwriting.
 .TP
 \fB\-O\fR, \fB\-\-nodeps\fR
-Don't merge dependencies
+Don't merge dependencies.
 .TP
 \fB\-\-debug\fR
-Run shell funcs with `set -x`
+Run shell funcs with `set -x`.
 .TP
 \fB\-\-root\fR \fI\fR
-Set the ROOT env var
+Set the ROOT env var.
 .TP
 \fB\-v\fR, \fB\-\-verbose\fR
-Make a lot of noise
+Make a lot of noise.
 .TP
 \fB\-q\fR, \fB\-\-quiet\fR
-Tighter output; suppress warnings
+Tighter output; suppress warnings.
 .TP
 \fB\-C\fR, \fB\-\-nocolor\fR
-Don't output color
+Don't output color.
 .TP
 \fB\-h\fR, \fB\-\-help\fR
-Print this help and exit
+Print this help and exit.
 .TP
 \fB\-V\fR, \fB\-\-version\fR
-Print version and exit
+Print version and exit.
 
 .SH "REPORTING BUGS"
 Please report bugs via http://bugs.gentoo.org/
 .br
-Product: Portage Development; Component: Tools
+Product: Portage Development; Component: Tools, Assignee:
+portage-ut...@gentoo.org
 .SH AUTHORS
 .nf
 Ned Ludd 



[gentoo-commits] proj/portage-utils:master commit in: man/, man/include/

2018-04-03 Thread Fabian Groffen
commit: 23b810c84c02a29f3b2766cf0fd005c53e668816
Author: Fabian Groffen  gentoo  org>
AuthorDate: Tue Apr  3 13:51:42 2018 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Tue Apr  3 13:51:42 2018 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=23b810c8

qtbz2: improve documentation

Bug: https://bugs.gentoo.org/645554

 man/include/qsize.desc |  3 +++
 man/include/qsize.optdesc.yaml |  5 +
 man/include/qtbz2.desc |  2 ++
 man/include/qtbz2.optdesc.yaml |  2 ++
 man/qtbz2.1| 33 ++---
 5 files changed, 30 insertions(+), 15 deletions(-)

diff --git a/man/include/qsize.desc b/man/include/qsize.desc
new file mode 100644
index 000..e4edce0
--- /dev/null
+++ b/man/include/qsize.desc
@@ -0,0 +1,3 @@
+\fIqsize\fR calculates the storage size taken by an installed package.
+The reported sizes can be the recorded exact sizes of all files, or the
+storage space they consume given the underlying filesystem.

diff --git a/man/include/qsize.optdesc.yaml b/man/include/qsize.optdesc.yaml
new file mode 100644
index 000..8dd58e4
--- /dev/null
+++ b/man/include/qsize.optdesc.yaml
@@ -0,0 +1,5 @@
+ignore: |
+Filter out entries matching \fI\fR, which is a regular
+expression, before calculating size.
+verbose: Ignored for compatibility with other qapplets.
+quiet: Ignored for compatibility with other qapplets.

diff --git a/man/include/qtbz2.desc b/man/include/qtbz2.desc
new file mode 100644
index 000..2ba37db
--- /dev/null
+++ b/man/include/qtbz2.desc
@@ -0,0 +1,2 @@
+\fIqtbz2\fR joins and splits combined xpak+tarbz2 files.  Gentoo binary
+packages are such combined files.

diff --git a/man/include/qtbz2.optdesc.yaml b/man/include/qtbz2.optdesc.yaml
new file mode 100644
index 000..c1ebcd1
--- /dev/null
+++ b/man/include/qtbz2.optdesc.yaml
@@ -0,0 +1,2 @@
+verbose: Print some files and sizes while joining and splitting.
+quiet: Ignored for compatibility with other qapplets.

diff --git a/man/qtbz2.1 b/man/qtbz2.1
index b22c70c..94db0d8 100644
--- a/man/qtbz2.1
+++ b/man/qtbz2.1
@@ -1,53 +1,56 @@
-.TH qtbz2 "1" "Mar 2016" "Gentoo Foundation" "qtbz2"
+.\" generated by mkman.py, please do NOT edit!
+.TH qtbz2 "1" "Apr 2018" "Gentoo Foundation" "qtbz2"
 .SH NAME
 qtbz2 \- manipulate tbz2 packages
 .SH SYNOPSIS
 .B qtbz2
 \fI[opts] \fR
 .SH DESCRIPTION
-
+\fIqtbz2\fR joins and splits combined xpak+tarbz2 files.  Gentoo binary
+packages are such combined files.
 .SH OPTIONS
 .TP
 \fB\-d\fR \fI\fR, \fB\-\-dir\fR \fI\fR
-Change to specified directory
+Change to specified directory.
 .TP
 \fB\-j\fR, \fB\-\-join\fR
-Join:   
+Join:   .
 .TP
 \fB\-s\fR, \fB\-\-split\fR
-Split a tbz2 into a tar.bz2 + xpak
+Split a tbz2 into a tar.bz2 + xpak.
 .TP
 \fB\-t\fR, \fB\-\-tarbz2\fR
-Just split the tar.bz2
+Just split the tar.bz2.
 .TP
 \fB\-x\fR, \fB\-\-xpak\fR
-Just split the xpak
+Just split the xpak.
 .TP
 \fB\-O\fR, \fB\-\-stdout\fR
-Write files to stdout
+Write files to stdout.
 .TP
 \fB\-\-root\fR \fI\fR
-Set the ROOT env var
+Set the ROOT env var.
 .TP
 \fB\-v\fR, \fB\-\-verbose\fR
-Make a lot of noise
+Print some files and sizes while joining and splitting.
 .TP
 \fB\-q\fR, \fB\-\-quiet\fR
-Tighter output; suppress warnings
+Ignored for compatibility with other qapplets.
 .TP
 \fB\-C\fR, \fB\-\-nocolor\fR
-Don't output color
+Don't output color.
 .TP
 \fB\-h\fR, \fB\-\-help\fR
-Print this help and exit
+Print this help and exit.
 .TP
 \fB\-V\fR, \fB\-\-version\fR
-Print version and exit
+Print version and exit.
 
 .SH "REPORTING BUGS"
 Please report bugs via http://bugs.gentoo.org/
 .br
-Product: Portage Development; Component: Tools
+Product: Portage Development; Component: Tools, Assignee:
+portage-ut...@gentoo.org
 .SH AUTHORS
 .nf
 Ned Ludd 



[gentoo-commits] proj/portage-utils:master commit in: man/, man/include/, /

2019-07-14 Thread Fabian Groffen
commit: 26b9374ee23d16b3957b6ebc0cd80f53b22a4d16
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sun Jul 14 13:30:06 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sun Jul 14 13:30:06 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=26b9374e

quse: add -F argument, move some -v functionality to -D

-v now controls default atom formatting, as with other applets, the
ability to list USE-flags, their state and description per package now
is enabled by the -D (describe) flag, which incidentally also makes more
sense.

Signed-off-by: Fabian Groffen  gentoo.org>

 man/include/quse.optdesc.yaml | 11 +++---
 man/quse.1| 14 ---
 quse.c| 85 ---
 3 files changed, 62 insertions(+), 48 deletions(-)

diff --git a/man/include/quse.optdesc.yaml b/man/include/quse.optdesc.yaml
index 693aade..71fcd2d 100644
--- a/man/include/quse.optdesc.yaml
+++ b/man/include/quse.optdesc.yaml
@@ -1,10 +1,11 @@
 exact: Search for exact string, e.g.\ do not use regular expression matching.
 verbose: |
-Show descriptions for USE-flags for packages that match the search.
+Show versions for packages that match the search.
 Also shows problems encountered during parsing.  These are mostly
 diagnostic and indicate possible incorrectness in the results.
 quiet: Ignored for compatibility with other qapplets.
-installed: |
-Only search installed packages.  Together with \fB-v\fR this shows
-USE-flags and their descriptions, and currently enabled flags
-prefixed with an asterisk (\fI*\fR).
+describe: |
+Describe the USE flag, when no USE-flag given and combined with
+\fB-p\fR, lists all USE-flags with their descriptions (and enabled
+state prefixed with an asterisk when used with \fB-I\fR) per
+package.

diff --git a/man/quse.1 b/man/quse.1
index a30e189..8306ca5 100644
--- a/man/quse.1
+++ b/man/quse.1
@@ -20,12 +20,13 @@ List all ebuilds, don't match anything.
 Use the LICENSE vs IUSE.
 .TP
 \fB\-D\fR, \fB\-\-describe\fR
-Describe the USE flag.
+Describe the USE flag, when no USE-flag given and combined with
+\fB-p\fR, lists all USE-flags with their descriptions (and enabled
+state prefixed with an asterisk when used with \fB-I\fR) per
+package.
 .TP
 \fB\-I\fR, \fB\-\-installed\fR
-Only search installed packages.  Together with \fB-v\fR this shows
-USE-flags and their descriptions, and currently enabled flags
-prefixed with an asterisk (\fI*\fR).
+Only search installed packages.
 .TP
 \fB\-p\fR \fI\fR, \fB\-\-package\fR \fI\fR
 Restrict matching to package or category.
@@ -33,11 +34,14 @@ Restrict matching to package or category.
 \fB\-R\fR, \fB\-\-repo\fR
 Show repository the ebuild originates from.
 .TP
+\fB\-F\fR \fI\fR, \fB\-\-format\fR \fI\fR
+Print matched atom using given format string.
+.TP
 \fB\-\-root\fR \fI\fR
 Set the ROOT env var.
 .TP
 \fB\-v\fR, \fB\-\-verbose\fR
-Show descriptions for USE-flags for packages that match the search.
+Show versions for packages that match the search.
 Also shows problems encountered during parsing.  These are mostly
 diagnostic and indicate possible incorrectness in the results.
 .TP

diff --git a/quse.c b/quse.c
index bc99c3b..df8626e 100644
--- a/quse.c
+++ b/quse.c
@@ -27,7 +27,7 @@
 #include "xarray.h"
 #include "xregex.h"
 
-#define QUSE_FLAGS "eaLDIp:R" COMMON_FLAGS
+#define QUSE_FLAGS "eaLDIp:RF:" COMMON_FLAGS
 static struct option const quse_long_opts[] = {
{"exact", no_argument, NULL, 'e'},
{"all",   no_argument, NULL, 'a'},
@@ -36,6 +36,7 @@ static struct option const quse_long_opts[] = {
{"installed", no_argument, NULL, 'I'},
{"package",a_argument, NULL, 'p'},
{"repo",  no_argument, NULL, 'R'},
+   {"format", a_argument, NULL, 'F'},
COMMON_LONG_OPTS
 };
 static const char * const quse_opts_help[] = {
@@ -46,6 +47,7 @@ static const char * const quse_opts_help[] = {
"Only search installed packages",
"Restrict matching to package or category",
"Show repository the ebuild originates from",
+   "Print matched atom using given format string",
COMMON_OPTS_HELP
 };
 #define quse_usage(ret) usage(ret, QUSE_FLAGS, quse_long_opts, quse_opts_help, 
NULL, lookup_applet_idx("quse"))
@@ -61,9 +63,10 @@ struct quse_state {
bool do_licence:1;
bool do_installed:1;
bool do_list:1;
-   bool do_repo:1;
+   bool need_full_atom:1;
depend_atom *match;
regex_t *pregv;
+   const char *fmt;
 };
 
 static char *_quse_getline_buf = NULL;
@@ -142,9 +145,8 @@ quse_search_use_local_desc(int portdirfd, struct quse_state 
*state)
if (state->do_list) {
state->retv[i] = xstrdup(q);
} else {
-   printf("%s%s/%s%s%s[%s%s%s] %s\n",
- 

[gentoo-commits] proj/portage-utils:master commit in: man/, /, man/include/

2019-07-18 Thread Fabian Groffen
commit: 94ca500baf225994b88f750262c0895553c70a8a
Author: Fabian Groffen  gentoo  org>
AuthorDate: Thu Jul 18 18:34:19 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Thu Jul 18 18:34:19 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=94ca500b

qlop: enhance running time indicator

Fix elapsed time mode (-t) when using -r displaying the elapsed time
also as the ETA.  When using -v, display what ETA is being used (average
or longest run).

Also, better document which flags can be combined with -r.

Signed-off-by: Fabian Groffen  gentoo.org>

 man/include/qlop.optdesc.yaml |  7 +--
 man/qlop.1|  7 +--
 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.

diff --git a/man/qlop.1 b/man/qlop.1
index 10eaa27..909ebdc 100644
--- a/man/qlop.1
+++ b/man/qlop.1
@@ -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\fR, \fB\-\-date\fR \fI\fR
 Limit the selection of packages to the date given, or to the range

diff --git a/qlop.c b/qlop.c
index e20c97b..fce0f69 100644
--- a/qlop.c
+++ b/qlop.c
@@ -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" :
-

[gentoo-commits] proj/portage-utils:master commit in: man/, /, man/include/

2019-06-09 Thread Fabian Groffen
commit: c0b88fe2b32679f1548a280d906b82b1651cd804
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sun Jun  9 09:51:26 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sun Jun  9 09:51:26 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=c0b88fe2

qgrep: print filename for matches by default, fix atom_compare call

remove very similar vdb callback in favour of generic tree one
format atoms using atom_format for consistency and ease of use
retrieve full atoms when SLOT or REPO matches are attempted

Signed-off-by: Fabian Groffen  gentoo.org>

 man/include/qgrep.optdesc.yaml |   2 +-
 man/qgrep.1|  41 -
 qgrep.c| 100 +++--
 3 files changed, 47 insertions(+), 96 deletions(-)

diff --git a/man/include/qgrep.optdesc.yaml b/man/include/qgrep.optdesc.yaml
index ad3874d..9716bf0 100644
--- a/man/include/qgrep.optdesc.yaml
+++ b/man/include/qgrep.optdesc.yaml
@@ -1,4 +1,4 @@
 verbose: |
 Prefix each matching line with filename (like \fB-H\fR).  When this
 option is given multiple times, also linenumbers are printed.
-quiet: Ignored for compatibility with other qapplets.
+quiet: Do not prefix each match with filename.

diff --git a/man/qgrep.1 b/man/qgrep.1
index 180b5dd..6701061 100644
--- a/man/qgrep.1
+++ b/man/qgrep.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qgrep "1" "May 2019" "Gentoo Foundation" "qgrep"
+.TH qgrep "1" "Jun 2019" "Gentoo Foundation" "qgrep"
 .SH NAME
 qgrep \- grep in ebuilds
 .SH SYNOPSIS
@@ -20,66 +20,63 @@ Select non-matching lines.
 \fB\-i\fR, \fB\-\-ignore\-case\fR
 Ignore case distinctions.
 .TP
-\fB\-H\fR, \fB\-\-with\-filename\fR
-Print the filename for each match.
-.TP
 \fB\-N\fR, \fB\-\-with\-name\fR
-Print the package or eclass name for each match.
+Print the filename for each match.
 .TP
 \fB\-c\fR, \fB\-\-count\fR
-Only print a count of matching lines per FILE.
+Print the package or eclass name for each match.
 .TP
 \fB\-l\fR, \fB\-\-list\fR
-Only print FILE names containing matches.
+Only print a count of matching lines per FILE.
 .TP
 \fB\-L\fR, \fB\-\-invert\-list\fR
-Only print FILE names containing no match.
+Only print FILE names containing matches.
 .TP
 \fB\-e\fR, \fB\-\-regexp\fR
-Use PATTERN as a regular expression.
+Only print FILE names containing no match.
 .TP
 \fB\-x\fR, \fB\-\-extended\fR
-Use PATTERN as an extended regular expression.
+Use PATTERN as a regular expression.
 .TP
 \fB\-J\fR, \fB\-\-installed\fR
-Search in installed ebuilds instead of the tree.
+Use PATTERN as an extended regular expression.
 .TP
 \fB\-E\fR, \fB\-\-eclass\fR
-Search in eclasses instead of ebuilds.
+Search in installed ebuilds instead of the tree.
 .TP
 \fB\-s\fR, \fB\-\-skip\-comments\fR
-Skip comments lines.
+Search in eclasses instead of ebuilds.
 .TP
 \fB\-R\fR, \fB\-\-repo\fR
-Print source repository name for each match (implies -N).
+Skip comments lines.
 .TP
 \fB\-S\fR \fI\fR, \fB\-\-skip\fR \fI\fR
-Skip lines matching .
+Print source repository name for each match (implies -N).
 .TP
 \fB\-B\fR \fI\fR, \fB\-\-before\fR \fI\fR
-Print  lines of leading context.
+Skip lines matching .
 .TP
 \fB\-A\fR \fI\fR, \fB\-\-after\fR \fI\fR
-Print  lines of trailing context.
+Print  lines of leading context.
 .TP
 \fB\-\-root\fR \fI\fR
-Set the ROOT env var.
+Print  lines of trailing context.
 .TP
 \fB\-v\fR, \fB\-\-verbose\fR
 Prefix each matching line with filename (like \fB-H\fR).  When this
 option is given multiple times, also linenumbers are printed.
 .TP
 \fB\-q\fR, \fB\-\-quiet\fR
-Ignored for compatibility with other qapplets.
+Do not prefix each match with filename.
 .TP
 \fB\-C\fR, \fB\-\-nocolor\fR
-Don't output color.
+Tighter output; suppress warnings.
 .TP
 \fB\-h\fR, \fB\-\-help\fR
-Print this help and exit.
+Don't output color.
 .TP
 \fB\-V\fR, \fB\-\-version\fR
-Print version and exit.
+Print this help and exit.
 
 .SH "REPORTING BUGS"
 Please report bugs via http://bugs.gentoo.org/

diff --git a/qgrep.c b/qgrep.c
index dff959b..058026e 100644
--- a/qgrep.c
+++ b/qgrep.c
@@ -24,11 +24,10 @@
 #include "xchdir.h"
 #include "xregex.h"
 
-#define QGREP_FLAGS "IiHNclLexJEsRS:B:A:" COMMON_FLAGS
+#define QGREP_FLAGS "IiNclLexJEsRS:B:A:" COMMON_FLAGS
 static struct option const qgrep_long_opts[] = {
{"invert-match",  no_argument, NULL, 'I'},
{"ignore-case",   no_argument, NULL, 'i'},
-   {"with-filename", no_argument, NULL, 'H'},
{"with-name", no_argument, NULL, 'N'},
{"count", no_argument, NULL, 'c'},
{"list",  no_argument, NULL, 'l'},
@@ -398,6 +397,8 @@ qgrep_cache_cb(tree_pkg_ctx *pkg_ctx, void *priv)
if (data->include_atoms != NULL) {
depend_atom **d;
for (d = data->include_atoms; *d != NULL; d++) {
+   if ((*d)->SLOT != NULL || (*d)->REPO != NULL)
+  

[gentoo-commits] proj/portage-utils:master commit in: man/, man/include/

2019-08-17 Thread Fabian Groffen
commit: 4b27faa3832c62110573d4fa587a117047bf139c
Author: Fabian Groffen  gentoo  org>
AuthorDate: Thu Jul 18 18:38:46 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Thu Jul 18 18:38:46 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=4b27faa3

man/qlop: q -> g

g is now best matched by t, q was never doing anything in particular

Signed-off-by: Fabian Groffen  gentoo.org>

 man/include/qlop.desc | 2 +-
 man/qlop.1| 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/man/include/qlop.desc b/man/include/qlop.desc
index 3505173..e39f689 100644
--- a/man/include/qlop.desc
+++ b/man/include/qlop.desc
@@ -21,6 +21,6 @@ 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
 of reporting the time the operation finished, \fIqlop\fR now reports the
-time the operation started.  The behaviour of the old \fB-q\fR flag is
+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
 is matched by the new \fB-a\fR flag.

diff --git a/man/qlop.1 b/man/qlop.1
index 909ebdc..baa5bf5 100644
--- a/man/qlop.1
+++ b/man/qlop.1
@@ -29,7 +29,7 @@ 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
 of reporting the time the operation finished, \fIqlop\fR now reports the
-time the operation started.  The behaviour of the old \fB-q\fR flag is
+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
 is matched by the new \fB-a\fR flag.
 .SH OPTIONS



[gentoo-commits] proj/portage-utils:master commit in: man/, man/include/, /

2019-05-13 Thread Fabian Groffen
commit: 7854ca6d12f793f3b516373784831131db36bca9
Author: Fabian Groffen  gentoo  org>
AuthorDate: Mon May 13 12:56:30 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Mon May 13 12:56:30 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=7854ca6d

qlop: add mode for listing last emerge contents

add -l flag to list packages/sync from last emerge operation and make it
default (when no flags are given)

Signed-off-by: Fabian Groffen  gentoo.org>

 TODO.md   |  2 --
 man/include/qlop.desc |  5 ++--
 man/include/qlop.optdesc.yaml |  3 +++
 man/qlop.1|  9 +--
 qlop.c| 62 ---
 5 files changed, 60 insertions(+), 21 deletions(-)

diff --git a/TODO.md b/TODO.md
index 7df8983..58ea4c5 100644
--- a/TODO.md
+++ b/TODO.md
@@ -83,8 +83,6 @@
 
 - have a mode that doesn't print timestamp (to get just atoms, -v should
   work)
-- make a -d mode that allows to do equivalent of "last portage emerge"
-  to make it easy to see what was newly merged/unmerged
 
 # qlist
 - have -F for use with -I so one can do things like print SLOT for

diff --git a/man/include/qlop.desc b/man/include/qlop.desc
index 0c14e00..3505173 100644
--- a/man/include/qlop.desc
+++ b/man/include/qlop.desc
@@ -2,9 +2,10 @@
 reads from $EMERGE_LOG_DIR/emerge.log and tries to extract
 information about merges, unmerges and syncs.  It can
 calculate average merge times or just list them.  When given no
-arguments or just \fB-v\fR, \fIqlop\fR acts as if \fB-must\fR was given
+arguments or just \fB-v\fR, \fIqlop\fR acts as if \fB-slumt\fR was given
 and thus lists the time taken for all occurrances of merges, unmerges
-and sync operations found in the log.
+and sync operations found in the log for the last \fBemerge\fR(1) action
+performed by Portage.
 .P
 By default, packages are printed as CATEGORY/PN.  Use \fB-v\fR to print
 the package version and revision numbers, e.g\. CATEGORY/PF.  Note that

diff --git a/man/include/qlop.optdesc.yaml b/man/include/qlop.optdesc.yaml
index 25143b2..677c4d2 100644
--- a/man/include/qlop.optdesc.yaml
+++ b/man/include/qlop.optdesc.yaml
@@ -21,6 +21,9 @@ date: |
 .IP FORMAT|DATE
 Use \fIFORMAT\fR as input for \fBstrptime\fR(3) to parse \fIDATE\fR.
 .RE
+lastmerge: |
+Limit selection to last Portage emerge action.  This option is a
+dynamic version of \fB-d\fR, and hence both cannot be used together.
 time: |
 Show the time it took to merge, unmerge or sync.
 average: |

diff --git a/man/qlop.1 b/man/qlop.1
index 83b62f8..ae40fa7 100644
--- a/man/qlop.1
+++ b/man/qlop.1
@@ -10,9 +10,10 @@ qlop \- emerge log analyzer
 reads from $EMERGE_LOG_DIR/emerge.log and tries to extract
 information about merges, unmerges and syncs.  It can
 calculate average merge times or just list them.  When given no
-arguments or just \fB-v\fR, \fIqlop\fR acts as if \fB-must\fR was given
+arguments or just \fB-v\fR, \fIqlop\fR acts as if \fB-slumt\fR was given
 and thus lists the time taken for all occurrances of merges, unmerges
-and sync operations found in the log.
+and sync operations found in the log for the last \fBemerge\fR(1) action
+performed by Portage.
 .P
 By default, packages are printed as CATEGORY/PN.  Use \fB-v\fR to print
 the package version and revision numbers, e.g\. CATEGORY/PF.  Note that
@@ -98,6 +99,10 @@ Seconds since 1970-01-01 00:00:00 + (UTC), the UNIX 
epoch.
 Use \fIFORMAT\fR as input for \fBstrptime\fR(3) to parse \fIDATE\fR.
 .RE
 .TP
+\fB\-l\fR, \fB\-\-lastmerge\fR
+Limit selection to last Portage emerge action.  This option is a
+dynamic version of \fB-d\fR, and hence both cannot be used together.
+.TP
 \fB\-f\fR \fI\fR, \fB\-\-logfile\fR \fI\fR
 Read emerge logfile instead of $EMERGE_LOG_DIR/emerge.log.
 .TP

diff --git a/qlop.c b/qlop.c
index a60e5ac..5217638 100644
--- a/qlop.c
+++ b/qlop.c
@@ -24,7 +24,7 @@
 
 #define QLOP_DEFAULT_LOGFILE "emerge.log"
 
-#define QLOP_FLAGS "ctaHMmuUserd:f:w:" COMMON_FLAGS
+#define QLOP_FLAGS "ctaHMmuUslerd:f:w:" COMMON_FLAGS
 static struct option const qlop_long_opts[] = {
{"summary",   no_argument, NULL, 'c'},
{"time",  no_argument, NULL, 't'},
@@ -38,6 +38,7 @@ static struct option const qlop_long_opts[] = {
{"endtime",   no_argument, NULL, 'e'},
{"running",   no_argument, NULL, 'r'},
{"date",   a_argument, NULL, 'd'},
+   {"lastmerge", no_argument, NULL, 'l'},
{"logfile",a_argument, NULL, 'f'},
{"atoms",  a_argument, NULL, 'w'},
COMMON_LONG_OPTS
@@ -55,6 +56,7 @@ static const char * const qlop_opts_help[] = {
"Report time at which the operation finished (iso started)",
"Show current emerging packages",
"Limit selection to this time (1st -d is start, 2nd -d is end)",
+   "Limit selection to last Portage emerge action",
"Read emerge logfile instead of $EMERGE_LOG_

[gentoo-commits] proj/portage-utils:master commit in: man/, /, man/include/

2019-05-13 Thread Fabian Groffen
commit: 966de456d8af3b5102950e608a771f776efdd014
Author: Fabian Groffen  gentoo  org>
AuthorDate: Mon May 13 13:37:31 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Mon May 13 13:37:31 2019 +
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",
+  

[gentoo-commits] proj/portage-utils:master commit in: man/, /, man/include/

2019-05-17 Thread Fabian Groffen
commit: 5531d5c97a27c002abfcc1bd229d0716bba4b2e3
Author: Fabian Groffen  gentoo  org>
AuthorDate: Fri May 17 14:34:09 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Fri May 17 14:34:09 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=5531d5c9

qfile: allow matching basenames to objects by default

one can now do qfile qfile to find app-portage/portage-utils
updated the manpage somewhat

Signed-off-by: Fabian Groffen  gentoo.org>

 man/include/qfile-01-owners.include | 30 ++-
 man/include/qfile-02-orphans.include| 15 +++---
 man/include/qfile-03-ROOT.include   | 20 
 man/include/qfile-05-collisions.include |  8 +--
 man/include/qfile.desc  | 23 +
 man/include/qfile.optdesc.yaml  |  4 ++
 man/qfile.1 | 88 -
 qfile.c | 35 -
 8 files changed, 140 insertions(+), 83 deletions(-)

diff --git a/man/include/qfile-01-owners.include 
b/man/include/qfile-01-owners.include
index a4bdc76..39b1e03 100644
--- a/man/include/qfile-01-owners.include
+++ b/man/include/qfile-01-owners.include
@@ -1,16 +1,14 @@
 .SH "FINDING FILE OWNERS"
 .PP
-This is the default behavior of \fBqfile\fP.  It will list the packages which
-own the files (or directories, or symlinks, or anything else Portage can 
-install) you are querying.  Query items may be file paths or simple file
-names when the \fB\-b\fP option is used.
-By default, output includes packages names and the complete paths to
-the matching files.  If using \fB\-\-exact\fP, versions of the packages will 
-also be shown.  At the contrary, when using \fB\-\-quiet\fP, only package 
-names are listed, without files paths.  Finally, \fB\-\-verbose\fP is similar
-to \fB\-\-exact\fP, but may add a few warnings.  The return status of 
-\fBqfile\fP will be \fI0\fP as soon as an owning package has been found for 
-one of the query items.
+This is the default behavior of \fBqfile\fP.  It will list the packages
+which own the files (or directories, or symlinks, or anything else
+Portage can install) you are querying.  Query items may be file paths or
+simple file names.  By default, output includes packages names and the
+complete paths to the matching files.  If using \fB\-\-verbose\fP,
+versions of the packages will also be shown.  In contrast, when using
+\fB\-\-quiet\fP, only package names are listed, without files paths.
+The return status of \fBqfile\fP will be \fI0\fP as soon as an owning
+package has been found for one of the query items.
 .PP
 Find names of package(s) owning "/bin/bash":
 .nf\fI
@@ -20,17 +18,17 @@ Find names of package(s) owning "/bin/bash":
 .PP
 Find package(s) owning any file named "bash", and show paths of this files:
 .nf\fI
-   $ qfile -b bash
-   app-shells/bash (/bin/bash)
-   app-shells/bash (/etc/bash)
+   $ qfile -d bash
+   app-shells/bash: /bin/bash
+   app-shells/bash: /etc/bash
 .fi
 .PP
 Find packages(s) owning the file named "bash" in the current directory. Also 
 display their exact version:
 .nf\fI
$ cd /bin
-   $ qfile -e ./bash
-   app-shells/bash-3.1_p17 (/bin/bash)
+   $ qfile -v ./bash
+   app-shells/bash-3.1_p17: /bin/bash
 .fi
 .PP
 Find the package(s) owning the libraries needed by the Bash binary:

diff --git a/man/include/qfile-02-orphans.include 
b/man/include/qfile-02-orphans.include
index ca23796..f6754aa 100644
--- a/man/include/qfile-02-orphans.include
+++ b/man/include/qfile-02-orphans.include
@@ -1,13 +1,12 @@
 .SH "FINDING ORPHAN FILES"
 .PP
-\fBqfile\fP can also, with the \fB\-\-orphans\fP option, find files which are 
-not owned by any package.  This behavior is the opposite of the usual file 
-owner search: the output is the list of query items for which no reference has
-been found in your installed packages database.  The \fB\-\-exact\fP option has
-no effect in this mode, whereas \fB\-\-verbose\fP may add a few warning 
-messages.  As for \fB\-\-quiet\fP, it will completly turn off the output, 
-leaving just a silent test command, which returns \fI0\fP if and only if
-there was no orphan in your query items.
+\fBqfile\fP can also, with the \fB\-\-orphans\fP option, find files
+which are not owned by any package.  This behaviour is the opposite of
+the usual file owner search: the output is the list of query items for
+which no reference has been found in your installed packages database.
+As for \fB\-\-quiet\fP, it will completly turn off the output, leaving
+just a silent test command, which returns \fI0\fP if and only if there
+was no orphan in your query items.
 .PP
 Find the orphan libtool files of your system:
 .nf\fI

diff --git a/man/include/qfile-03-ROOT.include 
b/man/include/qfile-03-ROOT.include
index 61d965d..3bfbe51 100644
--- a/man/include/qfile-03-ROOT.include
+++ b/man/include/qfile-03-ROOT.include
@@ -1,7 +1,7 @@
 .SH "$ROOT HANDLING"
 .PP

[gentoo-commits] proj/portage-utils:master commit in: man/, /, man/include/

2019-04-28 Thread Fabian Groffen
commit: c5aba3a0bd055688120dbabb9c3826ed46ffc795
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sun Apr 28 07:57:05 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sun Apr 28 07:57:05 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=c5aba3a0

qgrep: rewrite using libq/vdb and libq/cache

(re)use the traversion logic from libq instead of re-implementing this.
Additional benefits are less code and usage of metadata when available.

Signed-off-by: Fabian Groffen  gentoo.org>

 applets.h  |   2 +-
 man/include/qgrep.desc |   9 +-
 man/include/qgrep.optdesc.yaml |   5 +-
 man/q.1|   2 +-
 man/qgrep.1|  16 +-
 qgrep.c| 756 ++---
 6 files changed, 429 insertions(+), 361 deletions(-)

diff --git a/applets.h b/applets.h
index 5889de6..4dd5bc2 100644
--- a/applets.h
+++ b/applets.h
@@ -73,7 +73,7 @@ static const struct applet_t {
/*
{"qglsa", qglsa_main, " ", "check GLSAs against 
system"},
*/
-   {"qgrep", qgrep_main, "", "grep in ebuilds"},
+   {"qgrep", qgrep_main, " [pkg ...]", "grep in ebuilds"},
{"qlist", qlist_main, "",   "list files owned by 
pkgname"},
{"qlop",  qlop_main,  "",   "emerge log analyzer"},
{"qmerge",qmerge_main,"",  "fetch and merge 
binary package"},

diff --git a/man/include/qgrep.desc b/man/include/qgrep.desc
index c95d35a..98bcc09 100644
--- a/man/include/qgrep.desc
+++ b/man/include/qgrep.desc
@@ -1,3 +1,6 @@
-\fIqgrep\fR searches for a given pattern in all ebuilds of the current
-portage tree.  Optionally the search is in all eclasses, or just in the
-ebuilds that are currently installed.
+\fIqgrep\fR searches for a given expression in all ebuilds of the
+current portage tree and defined additional overlays.  Optionally the
+search is in all eclasses, or just in the ebuilds that are currently
+installed.  To narrow the search, multiple targets can be given using
+atom syntax.  In particular, the trailing slash (/) syntax can be used
+to match an entire category.  See also \fIqatom\fR(1).

diff --git a/man/include/qgrep.optdesc.yaml b/man/include/qgrep.optdesc.yaml
index 87b174e..ad3874d 100644
--- a/man/include/qgrep.optdesc.yaml
+++ b/man/include/qgrep.optdesc.yaml
@@ -1,5 +1,4 @@
 verbose: |
-Print multiple matches per files.  When this option is given
-multiple times, also linenumber are printed for matches next to file
-names.
+Prefix each matching line with filename (like \fB-H\fR).  When this
+option is given multiple times, also linenumbers are printed.
 quiet: Ignored for compatibility with other qapplets.

diff --git a/man/q.1 b/man/q.1
index b3e985b..afba24a 100644
--- a/man/q.1
+++ b/man/q.1
@@ -41,7 +41,7 @@ Print version and exit.
qcheck: verify integrity of installed packages
  qdepends: show dependency info
 qfile   : list all pkgs owning files
-qgrep  : grep in ebuilds
+qgrep  [pkg ...]: grep in ebuilds
 qlist: list files owned by pkgname
  qlop: emerge log analyzer
qmerge   : fetch and merge binary package

diff --git a/man/qgrep.1 b/man/qgrep.1
index 662122d..048e28e 100644
--- a/man/qgrep.1
+++ b/man/qgrep.1
@@ -4,11 +4,14 @@
 qgrep \- grep in ebuilds
 .SH SYNOPSIS
 .B qgrep
-\fI[opts] \fR
+\fI[opts]  [pkg ...]\fR
 .SH DESCRIPTION
-\fIqgrep\fR searches for a given pattern in all ebuilds of the current
-portage tree.  Optionally the search is in all eclasses, or just in the
-ebuilds that are currently installed.
+\fIqgrep\fR searches for a given expression in all ebuilds of the
+current portage tree and defined additional overlays.  Optionally the
+search is in all eclasses, or just in the ebuilds that are currently
+installed.  To narrow the search, multiple targets can be given using
+atom syntax.  In particular, the trailing slash (/) syntax can be used
+to match an entire category.  See also \fIqatom\fR(1).
 .SH OPTIONS
 .TP
 \fB\-I\fR, \fB\-\-invert\-match\fR
@@ -60,9 +63,8 @@ Print  lines of trailing context.
 Set the ROOT env var.
 .TP
 \fB\-v\fR, \fB\-\-verbose\fR
-Print multiple matches per files.  When this option is given
-multiple times, also linenumber are printed for matches next to file
-names.
+Prefix each matching line with filename (like \fB-H\fR).  When this
+option is given multiple times, also linenumbers are printed.
 .TP
 \fB\-q\fR, \fB\-\-quiet\fR
 Ignored for compatibility with other qapplets.

diff --git a/qgrep.c b/qgrep.c
index 16bb4c1..3950c22 100644
--- a/qgrep.c
+++ b/qgrep.c
@@ -64,35 +64,6 @@ static const char * const qgrep_opts_help[] = {
 };
 #define qgrep_usage(ret) usage(ret, QGREP_FLAGS, qgrep_long_opts, 
qgrep_opts_help, NULL, lookup_applet_idx("qgrep"))
 
-static char
-qgrep_name_match(const char* name, const int argc, depend_atom** a

[gentoo-commits] proj/portage-utils:master commit in: man/, man/include/, /

2020-05-16 Thread Fabian Groffen
commit: a0780928edc76543e63709c915fb7d581bd13291
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sat May 16 14:29:45 2020 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sat May 16 14:29:45 2020 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=a0780928

qfile: print symlink targets in verbose mode

e.g.:
% qfile -v /bin/csh
app-shells/tcsh-6.21.00-r1: /bin/csh -> tcsh

Signed-off-by: Fabian Groffen  gentoo.org>

 man/include/qfile.optdesc.yaml | 6 +++---
 man/qfile.1| 8 
 qfile.c| 6 +-
 3 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/man/include/qfile.optdesc.yaml b/man/include/qfile.optdesc.yaml
index 66ee885..9e1d24b 100644
--- a/man/include/qfile.optdesc.yaml
+++ b/man/include/qfile.optdesc.yaml
@@ -1,7 +1,7 @@
 verbose: |
-Print package versions to matches, warn about problems with
-resolving symlinks or positioning packages under an alternative
-root.
+Print package versions and symlink targets for matches, warn about
+problems with resolving symlinks or positioning packages under an
+alternative root.
 quiet: |
 Don't print matching file for matches, just the package.  Don't
 report about orphan files.

diff --git a/man/qfile.1 b/man/qfile.1
index 7501311..7caa459 100644
--- a/man/qfile.1
+++ b/man/qfile.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qfile "1" "Nov 2019" "Gentoo Foundation" "qfile"
+.TH qfile "1" "May 2020" "Gentoo Foundation" "qfile"
 .SH NAME
 qfile \- list all pkgs owning files
 .SH SYNOPSIS
@@ -62,9 +62,9 @@ Don't look in the prunelib registry.
 Set the ROOT env var.
 .TP
 \fB\-v\fR, \fB\-\-verbose\fR
-Print package versions to matches, warn about problems with
-resolving symlinks or positioning packages under an alternative
-root.
+Print package versions and symlink targets for matches, warn about
+problems with resolving symlinks or positioning packages under an
+alternative root.
 .TP
 \fB\-q\fR, \fB\-\-quiet\fR
 Don't print matching file for matches, just the package.  Don't

diff --git a/qfile.c b/qfile.c
index d104848..efac60e 100644
--- a/qfile.c
+++ b/qfile.c
@@ -305,8 +305,12 @@ static int qfile_cb(tree_pkg_ctx *pkg_ctx, void *priv)
printf("%s", atom_format(state->format, atom));
if (quiet)
puts("");
+   else if (verbose && e->type == CONTENTS_SYM)
+   printf(": %s%s -> %s\n",
+   state->root ? 
state->root : "",
+   e->name, e->sym_target);
else
-   printf(": %s%s\n", state->root ? : "", 
e->name);
+   printf(": %s%s\n", state->root ? 
state->root : "", e->name);
} else {
non_orphans[i] = 1;
}



[gentoo-commits] proj/portage-utils:master commit in: /, man/, man/include/

2021-03-13 Thread Fabian Groffen
commit: 7dc2cc4bfaf2bbb943c45bc8171843a523cea7e5
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sat Mar 13 20:30:48 2021 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sat Mar 13 20:30:48 2021 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=7dc2cc4b

q: show masking reason from comments when using -vv with -m

Signed-off-by: Fabian Groffen  gentoo.org>

 main.c |  1 -
 man/include/q.optdesc.yaml |  5 ++--
 man/q.1|  7 +++---
 q.c| 58 +++---
 4 files changed, 62 insertions(+), 9 deletions(-)

diff --git a/main.c b/main.c
index a68af63..ceab587 100644
--- a/main.c
+++ b/main.c
@@ -677,7 +677,6 @@ read_one_repos_conf(const char *repos_conf, char **primary)
 
main_repo = NULL;
repo = NULL;
-   line = 0;
for (p = strtok_r(buf, "\n", &s); p != NULL; p = strtok_r(NULL, "\n", 
&s))
{
/* trim trailing whitespace, remove comments, locate = */

diff --git a/man/include/q.optdesc.yaml b/man/include/q.optdesc.yaml
index cde6eed..468ffa9 100644
--- a/man/include/q.optdesc.yaml
+++ b/man/include/q.optdesc.yaml
@@ -10,5 +10,6 @@ envvar: |
 variable name and the value is printed as a shell-style declaration.
 masks: |
 Print the masks from package.mask files found.  Use \fI-v\fR to see
-the source (file) where the mask was declared.  Additional arguments
-are treated as atom selectors which must match the masks.
+the source (file) where the mask was declared.  Use multiple
+\fI-v\fR to print the comment right before the mask.  Additional
+arguments are treated as atom selectors which must match the masks.

diff --git a/man/q.1 b/man/q.1
index 2979cab..f43be6f 100644
--- a/man/q.1
+++ b/man/q.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH q "1" "Feb 2021" "Gentoo Foundation" "q"
+.TH q "1" "Mar 2021" "Gentoo Foundation" "q"
 .SH NAME
 q \- invoke a portage utility applet
 .SH SYNOPSIS
@@ -35,8 +35,9 @@ variable name and the value is printed as a shell-style 
declaration.
 .TP
 \fB\-m\fR, \fB\-\-masks\fR
 Print the masks from package.mask files found.  Use \fI-v\fR to see
-the source (file) where the mask was declared.  Additional arguments
-are treated as atom selectors which must match the masks.
+the source (file) where the mask was declared.  Use multiple
+\fI-v\fR to print the comment right before the mask.  Additional
+arguments are treated as atom selectors which must match the masks.
 .TP
 \fB\-\-root\fR \fI\fR
 Set the ROOT env var.

diff --git a/q.c b/q.c
index a6a9a0b..e514b0c 100644
--- a/q.c
+++ b/q.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005-2019 Gentoo Foundation
+ * Copyright 2005-2021 Gentoo Foundation
  * Distributed under the terms of the GNU General Public License v2
  *
  * Copyright 2005-2010 Ned Ludd- 
@@ -288,6 +288,11 @@ int q_main(int argc, char **argv)
size_t n;
int j;
bool match;
+   char *lastmfile = NULL;
+   long lastcbeg = 0;
+   long lastcend = 0;
+   char *buf = NULL;
+   size_t buflen = 0;
depend_atom *atom;
depend_atom *qatom;
 
@@ -313,16 +318,63 @@ int q_main(int argc, char **argv)
if (!match)
continue;
 
+   if (verbose > 1) {
+   char *mfile = (char *)array_get_elem(files, n);
+   char *l;
+   char *s = NULL;
+   long line = 0;
+   long cbeg = 0;
+   long cend = 0;
+
+   s = l = strchr(mfile, ':');
+   /* p cannot be NULL, just crash if something's 
wrong */
+   (void)strtol(l + 1, &l, 10);
+   if (*l == ':')
+   cbeg = strtol(l + 1, &l, 10);
+   if (*l == '-')
+   cend = strtol(l + 1, &l, 10);
+   if (cend < cbeg)
+   cend = cbeg = 0;
+
+   if (lastmfile == NULL ||
+   strncmp(lastmfile, mfile, s - 
mfile + 1) != 0 ||
+   lastcbeg != cbeg || lastcend != 
cend)
+   {
+   *s = '\0';
+   if (buf != NULL)
+   *buf = '\0';
+   eat_file(mfile, &buf, &buflen);
+   *s = ':';
+
+   line = 0;
+ 

[gentoo-commits] proj/portage-utils:master commit in: man/, /, man/include/

2019-12-27 Thread Fabian Groffen
commit: 1038786d92a885dece9cc82588e88d8367a0fda2
Author: Fabian Groffen  gentoo  org>
AuthorDate: Fri Dec 27 19:14:44 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Fri Dec 27 19:14:44 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=1038786d

qkeyword: apply profile masks to -S/-T results

Technically, this should be enough to implement the Puppet provider for
Gentoo.

Signed-off-by: Fabian Groffen  gentoo.org>

 man/include/qkeyword-01-latest-testing.include | 23 
 man/include/qkeyword.desc  | 10 +++-
 man/qkeyword.1 | 34 ++--
 qkeyword.c | 73 +-
 4 files changed, 121 insertions(+), 19 deletions(-)

diff --git a/man/include/qkeyword-01-latest-testing.include 
b/man/include/qkeyword-01-latest-testing.include
new file mode 100644
index 000..1c2fde5
--- /dev/null
+++ b/man/include/qkeyword-01-latest-testing.include
@@ -0,0 +1,23 @@
+.SH "RETRIEVING LATEST TESTING VERSION AVAILABLE"
+.PP
+To retrieve the latest available version in the ebuild tree marked as
+testing for the given ARCH, can be done with a combination of flags,
+mostly to restrict the search.  For instance, to find the latest version
+of \fIsys-devel/gcc\fR available, one could use:
+.nf
+$ qkeyword -p sys-devel/gcc -T
+sys-devel/gcc-8.3.0
+.fi
+It may be that there is a newer version available, but masked for the
+configured profile (via package.mask).  Using \fB-v\fR will inform about
+this scenario happening:
+.nf
+$ qkeyword -p dev-vcs/cvs -Tv
+masked by =dev-vcs/cvs-1.12.12*: dev-vcs/cvs-1.12.12-r12
+.fi
+Unrelated, but to locate the mask given, use verbose mode on \fIq\fR's
+mask listing:
+.nf
+$ q -mv dev-vcs/cvs
+=dev-vcs/cvs-1.12.12* [/repo/gentoo/profiles/prefix/sunos/solaris/package.mask]
+.fi

diff --git a/man/include/qkeyword.desc b/man/include/qkeyword.desc
index b7a863c..adc55ea 100644
--- a/man/include/qkeyword.desc
+++ b/man/include/qkeyword.desc
@@ -1,5 +1,5 @@
-\fIqkeyword\fR allows various searches based on KEYWORDS aimed at Gentoo
-developers.  Various modes allow to query which packages would be
+\fIqkeyword\fR allows various searches based on KEYWORDS.  Some uses are
+aimed at Gentoo developers, to allow querying which packages would be
 available, or are candidate for keywording.
 .P
 By default, the entire tree is traversed.  Since this process can be
@@ -12,3 +12,9 @@ as package in one go.  The \fB-m\fR maintainer match, while 
reducing the
 resulting set, is likely to slow down the query processing since the
 metadata.xml file has to be read for each package examined.  It is best
 used in combination with \fB-p\fR or \fB-c\fR.
+.P
+\fIqkeyword\fR uses the keyword found in the configured profile (ARCH)
+for its queries.  This keyword can be overridden by giving the desired
+keyword as argument.  Note that this does not change the profile in use,
+which most notably can result in incorrect masks being applied for the
+\fB-T\fR and \fB-S\fR options.

diff --git a/man/qkeyword.1 b/man/qkeyword.1
index 34beb18..5a26218 100644
--- a/man/qkeyword.1
+++ b/man/qkeyword.1
@@ -6,8 +6,8 @@ qkeyword \- list packages based on keywords
 .B qkeyword
 \fI[opts]  \fR
 .SH DESCRIPTION
-\fIqkeyword\fR allows various searches based on KEYWORDS aimed at Gentoo
-developers.  Various modes allow to query which packages would be
+\fIqkeyword\fR allows various searches based on KEYWORDS.  Some uses are
+aimed at Gentoo developers, to allow querying which packages would be
 available, or are candidate for keywording.
 .P
 By default, the entire tree is traversed.  Since this process can be
@@ -20,6 +20,12 @@ as package in one go.  The \fB-m\fR maintainer match, while 
reducing the
 resulting set, is likely to slow down the query processing since the
 metadata.xml file has to be read for each package examined.  It is best
 used in combination with \fB-p\fR or \fB-c\fR.
+.P
+\fIqkeyword\fR uses the keyword found in the configured profile (ARCH)
+for its queries.  This keyword can be overridden by giving the desired
+keyword as argument.  Note that this does not change the profile in use,
+which most notably can result in incorrect masks being applied for the
+\fB-T\fR and \fB-S\fR options.
 .SH OPTIONS
 .TP
 \fB\-p\fR \fI\fR, \fB\-\-matchpkg\fR \fI\fR
@@ -75,7 +81,29 @@ Print this help and exit.
 .TP
 \fB\-V\fR, \fB\-\-version\fR
 Print version and exit.
-
+.SH "RETRIEVING LATEST TESTING VERSION AVAILABLE"
+.PP
+To retrieve the latest available version in the ebuild tree marked as
+testing for the given ARCH, can be done with a combination of flags,
+mostly to restrict the search.  For instance, to find the latest version
+of \fIsys-devel/gcc\fR available, one could use:
+.nf
+$ qkeyword -p sys-devel/gcc -T
+sys-devel/gcc-8.3.0
+.fi
+It may be that there is a newer version available, but masked for the
+configured profile (via package.mask).  Using \fB-v\fR 

[gentoo-commits] proj/portage-utils:master commit in: man/, man/include/, /

2018-04-12 Thread Fabian Groffen
commit: 33d4e18b26cd37691a81584da0efd929097a22b3
Author: Fabian Groffen  gentoo  org>
AuthorDate: Thu Apr 12 19:14:19 2018 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Thu Apr 12 19:14:19 2018 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=33d4e18b

qlop: don't rely on %F for data parsing for portability

While at it document the date formats in the man-page.

 man/include/qlop.optdesc.yaml | 16 
 man/qlop.1| 16 +++-
 qlop.c|  6 +++---
 3 files changed, 34 insertions(+), 4 deletions(-)

diff --git a/man/include/qlop.optdesc.yaml b/man/include/qlop.optdesc.yaml
index 7864d6e..fad1670 100644
--- a/man/include/qlop.optdesc.yaml
+++ b/man/include/qlop.optdesc.yaml
@@ -1,3 +1,19 @@
+date: |
+Limit the selection of packages to the date given, or to the range
+of dates if this argument is given twice.  The \fB--date\fR option
+can take a few forms.
+.RS
+.IP "NUMBER [s] [ago]"
+Relative time, specifying \fINUMBER\fR \fIdays\fR, \fIweeks\fR,
+\fImonths\fR or \fIyears\fR, for example \fI3 days ago\fR.
+.IP -MM-DD
+Big-endian date, with components separated by hyphens, starting with
+year, followed by month and day of month.
+.IP S
+Seconds since 1970-01-01 00:00:00 + (UTC), the UNIX epoch.
+.IP FORMAT|DATE
+Use \fIFORMAT\fR as input for \fBstrptime\fR(3) to parse \fIDATE\fR.
+.RE
 gauge: |
 Gauge number of times a package has been merged.  This shows the
 merge time for each individual merge of package.

diff --git a/man/qlop.1 b/man/qlop.1
index c138054..9c449a9 100644
--- a/man/qlop.1
+++ b/man/qlop.1
@@ -39,7 +39,21 @@ Show current emerging packages.  This relies on
 in order to detect running merges.
 .TP
 \fB\-d\fR \fI\fR, \fB\-\-date\fR \fI\fR
-Limit selection to this time (1st -d is start, 2nd -d is end).
+Limit the selection of packages to the date given, or to the range
+of dates if this argument is given twice.  The \fB--date\fR option
+can take a few forms.
+.RS
+.IP "NUMBER [s] [ago]"
+Relative time, specifying \fINUMBER\fR \fIdays\fR, \fIweeks\fR,
+\fImonths\fR or \fIyears\fR, for example \fI3 days ago\fR.
+.IP -MM-DD
+Big-endian date, with components separated by hyphens, starting with
+year, followed by month and day of month.
+.IP S
+Seconds since 1970-01-01 00:00:00 + (UTC), the UNIX epoch.
+.IP FORMAT|DATE
+Use \fIFORMAT\fR as input for \fBstrptime\fR(3) to parse \fIDATE\fR.
+.RE
 .TP
 \fB\-f\fR \fI\fR, \fB\-\-logfile\fR \fI\fR
 Read emerge logfile instead of $EMERGE_LOG_DIR/emerge.log.

diff --git a/qlop.c b/qlop.c
index 67669ef..1d4e0d9 100644
--- a/qlop.c
+++ b/qlop.c
@@ -39,7 +39,7 @@ static const char qlop_desc[] =
"The --date option can take a few forms:\n"
"  -d '# [s] [ago]'  (e.g. '3 days ago')\n"
"Or using strptime(3) formats:\n"
-   "  -d '2015-12-25'   (detected as %F)\n"
+   "  -d '2015-12-25'   (detected as %Y-%m-%d)\n"
"  -d '1459101740'   (detected as %s)\n"
"  -d '%d.%m.%Y|25.12.2015'  (format is specified)";
 #define qlop_usage(ret) usage(ret, QLOP_FLAGS, qlop_long_opts, qlop_opts_help, 
qlop_desc, lookup_applet_idx("qlop"))
@@ -733,7 +733,7 @@ parse_date(const char *sdate, time_t *t)
} else {
/* Handle automatic formats:
 * - "12315128"   -> %s
-* - "2015-12-24" -> %F (same as %Y-%m-%d
+* - "2015-12-24" -> %Y-%m-%d
 * - human readable format (see below)
 */
size_t len = strspn(sdate, "0123456789-");
@@ -742,7 +742,7 @@ parse_date(const char *sdate, time_t *t)
if (strchr(sdate, '-') == NULL)
fmt = "%s";
else
-   fmt = "%F";
+   fmt = "%Y-%m-%d";
 
s = strptime(sdate, fmt, &tm);
if (s == NULL || s[0] != '\0')



[gentoo-commits] proj/portage-utils:master commit in: man/, man/include/, /

2019-07-14 Thread Fabian Groffen
commit: 26b9374ee23d16b3957b6ebc0cd80f53b22a4d16
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sun Jul 14 13:30:06 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sun Jul 14 13:30:06 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=26b9374e

quse: add -F argument, move some -v functionality to -D

-v now controls default atom formatting, as with other applets, the
ability to list USE-flags, their state and description per package now
is enabled by the -D (describe) flag, which incidentally also makes more
sense.

Signed-off-by: Fabian Groffen  gentoo.org>

 man/include/quse.optdesc.yaml | 11 +++---
 man/quse.1| 14 ---
 quse.c| 85 ---
 3 files changed, 62 insertions(+), 48 deletions(-)

diff --git a/man/include/quse.optdesc.yaml b/man/include/quse.optdesc.yaml
index 693aade..71fcd2d 100644
--- a/man/include/quse.optdesc.yaml
+++ b/man/include/quse.optdesc.yaml
@@ -1,10 +1,11 @@
 exact: Search for exact string, e.g.\ do not use regular expression matching.
 verbose: |
-Show descriptions for USE-flags for packages that match the search.
+Show versions for packages that match the search.
 Also shows problems encountered during parsing.  These are mostly
 diagnostic and indicate possible incorrectness in the results.
 quiet: Ignored for compatibility with other qapplets.
-installed: |
-Only search installed packages.  Together with \fB-v\fR this shows
-USE-flags and their descriptions, and currently enabled flags
-prefixed with an asterisk (\fI*\fR).
+describe: |
+Describe the USE flag, when no USE-flag given and combined with
+\fB-p\fR, lists all USE-flags with their descriptions (and enabled
+state prefixed with an asterisk when used with \fB-I\fR) per
+package.

diff --git a/man/quse.1 b/man/quse.1
index a30e189..8306ca5 100644
--- a/man/quse.1
+++ b/man/quse.1
@@ -20,12 +20,13 @@ List all ebuilds, don't match anything.
 Use the LICENSE vs IUSE.
 .TP
 \fB\-D\fR, \fB\-\-describe\fR
-Describe the USE flag.
+Describe the USE flag, when no USE-flag given and combined with
+\fB-p\fR, lists all USE-flags with their descriptions (and enabled
+state prefixed with an asterisk when used with \fB-I\fR) per
+package.
 .TP
 \fB\-I\fR, \fB\-\-installed\fR
-Only search installed packages.  Together with \fB-v\fR this shows
-USE-flags and their descriptions, and currently enabled flags
-prefixed with an asterisk (\fI*\fR).
+Only search installed packages.
 .TP
 \fB\-p\fR \fI\fR, \fB\-\-package\fR \fI\fR
 Restrict matching to package or category.
@@ -33,11 +34,14 @@ Restrict matching to package or category.
 \fB\-R\fR, \fB\-\-repo\fR
 Show repository the ebuild originates from.
 .TP
+\fB\-F\fR \fI\fR, \fB\-\-format\fR \fI\fR
+Print matched atom using given format string.
+.TP
 \fB\-\-root\fR \fI\fR
 Set the ROOT env var.
 .TP
 \fB\-v\fR, \fB\-\-verbose\fR
-Show descriptions for USE-flags for packages that match the search.
+Show versions for packages that match the search.
 Also shows problems encountered during parsing.  These are mostly
 diagnostic and indicate possible incorrectness in the results.
 .TP

diff --git a/quse.c b/quse.c
index bc99c3b..df8626e 100644
--- a/quse.c
+++ b/quse.c
@@ -27,7 +27,7 @@
 #include "xarray.h"
 #include "xregex.h"
 
-#define QUSE_FLAGS "eaLDIp:R" COMMON_FLAGS
+#define QUSE_FLAGS "eaLDIp:RF:" COMMON_FLAGS
 static struct option const quse_long_opts[] = {
{"exact", no_argument, NULL, 'e'},
{"all",   no_argument, NULL, 'a'},
@@ -36,6 +36,7 @@ static struct option const quse_long_opts[] = {
{"installed", no_argument, NULL, 'I'},
{"package",a_argument, NULL, 'p'},
{"repo",  no_argument, NULL, 'R'},
+   {"format", a_argument, NULL, 'F'},
COMMON_LONG_OPTS
 };
 static const char * const quse_opts_help[] = {
@@ -46,6 +47,7 @@ static const char * const quse_opts_help[] = {
"Only search installed packages",
"Restrict matching to package or category",
"Show repository the ebuild originates from",
+   "Print matched atom using given format string",
COMMON_OPTS_HELP
 };
 #define quse_usage(ret) usage(ret, QUSE_FLAGS, quse_long_opts, quse_opts_help, 
NULL, lookup_applet_idx("quse"))
@@ -61,9 +63,10 @@ struct quse_state {
bool do_licence:1;
bool do_installed:1;
bool do_list:1;
-   bool do_repo:1;
+   bool need_full_atom:1;
depend_atom *match;
regex_t *pregv;
+   const char *fmt;
 };
 
 static char *_quse_getline_buf = NULL;
@@ -142,9 +145,8 @@ quse_search_use_local_desc(int portdirfd, struct quse_state 
*state)
if (state->do_list) {
state->retv[i] = xstrdup(q);
} else {
-   printf("%s%s/%s%s%s[%s%s%s] %s\n",
- 

[gentoo-commits] proj/portage-utils:master commit in: man/, /, man/include/

2019-07-18 Thread Fabian Groffen
commit: 94ca500baf225994b88f750262c0895553c70a8a
Author: Fabian Groffen  gentoo  org>
AuthorDate: Thu Jul 18 18:34:19 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Thu Jul 18 18:34:19 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=94ca500b

qlop: enhance running time indicator

Fix elapsed time mode (-t) when using -r displaying the elapsed time
also as the ETA.  When using -v, display what ETA is being used (average
or longest run).

Also, better document which flags can be combined with -r.

Signed-off-by: Fabian Groffen  gentoo.org>

 man/include/qlop.optdesc.yaml |  7 +--
 man/qlop.1|  7 +--
 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.

diff --git a/man/qlop.1 b/man/qlop.1
index 10eaa27..909ebdc 100644
--- a/man/qlop.1
+++ b/man/qlop.1
@@ -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\fR, \fB\-\-date\fR \fI\fR
 Limit the selection of packages to the date given, or to the range

diff --git a/qlop.c b/qlop.c
index e20c97b..fce0f69 100644
--- a/qlop.c
+++ b/qlop.c
@@ -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" :
-

[gentoo-commits] proj/portage-utils:master commit in: man/, /, man/include/

2019-06-09 Thread Fabian Groffen
commit: c0b88fe2b32679f1548a280d906b82b1651cd804
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sun Jun  9 09:51:26 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sun Jun  9 09:51:26 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=c0b88fe2

qgrep: print filename for matches by default, fix atom_compare call

remove very similar vdb callback in favour of generic tree one
format atoms using atom_format for consistency and ease of use
retrieve full atoms when SLOT or REPO matches are attempted

Signed-off-by: Fabian Groffen  gentoo.org>

 man/include/qgrep.optdesc.yaml |   2 +-
 man/qgrep.1|  41 -
 qgrep.c| 100 +++--
 3 files changed, 47 insertions(+), 96 deletions(-)

diff --git a/man/include/qgrep.optdesc.yaml b/man/include/qgrep.optdesc.yaml
index ad3874d..9716bf0 100644
--- a/man/include/qgrep.optdesc.yaml
+++ b/man/include/qgrep.optdesc.yaml
@@ -1,4 +1,4 @@
 verbose: |
 Prefix each matching line with filename (like \fB-H\fR).  When this
 option is given multiple times, also linenumbers are printed.
-quiet: Ignored for compatibility with other qapplets.
+quiet: Do not prefix each match with filename.

diff --git a/man/qgrep.1 b/man/qgrep.1
index 180b5dd..6701061 100644
--- a/man/qgrep.1
+++ b/man/qgrep.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qgrep "1" "May 2019" "Gentoo Foundation" "qgrep"
+.TH qgrep "1" "Jun 2019" "Gentoo Foundation" "qgrep"
 .SH NAME
 qgrep \- grep in ebuilds
 .SH SYNOPSIS
@@ -20,66 +20,63 @@ Select non-matching lines.
 \fB\-i\fR, \fB\-\-ignore\-case\fR
 Ignore case distinctions.
 .TP
-\fB\-H\fR, \fB\-\-with\-filename\fR
-Print the filename for each match.
-.TP
 \fB\-N\fR, \fB\-\-with\-name\fR
-Print the package or eclass name for each match.
+Print the filename for each match.
 .TP
 \fB\-c\fR, \fB\-\-count\fR
-Only print a count of matching lines per FILE.
+Print the package or eclass name for each match.
 .TP
 \fB\-l\fR, \fB\-\-list\fR
-Only print FILE names containing matches.
+Only print a count of matching lines per FILE.
 .TP
 \fB\-L\fR, \fB\-\-invert\-list\fR
-Only print FILE names containing no match.
+Only print FILE names containing matches.
 .TP
 \fB\-e\fR, \fB\-\-regexp\fR
-Use PATTERN as a regular expression.
+Only print FILE names containing no match.
 .TP
 \fB\-x\fR, \fB\-\-extended\fR
-Use PATTERN as an extended regular expression.
+Use PATTERN as a regular expression.
 .TP
 \fB\-J\fR, \fB\-\-installed\fR
-Search in installed ebuilds instead of the tree.
+Use PATTERN as an extended regular expression.
 .TP
 \fB\-E\fR, \fB\-\-eclass\fR
-Search in eclasses instead of ebuilds.
+Search in installed ebuilds instead of the tree.
 .TP
 \fB\-s\fR, \fB\-\-skip\-comments\fR
-Skip comments lines.
+Search in eclasses instead of ebuilds.
 .TP
 \fB\-R\fR, \fB\-\-repo\fR
-Print source repository name for each match (implies -N).
+Skip comments lines.
 .TP
 \fB\-S\fR \fI\fR, \fB\-\-skip\fR \fI\fR
-Skip lines matching .
+Print source repository name for each match (implies -N).
 .TP
 \fB\-B\fR \fI\fR, \fB\-\-before\fR \fI\fR
-Print  lines of leading context.
+Skip lines matching .
 .TP
 \fB\-A\fR \fI\fR, \fB\-\-after\fR \fI\fR
-Print  lines of trailing context.
+Print  lines of leading context.
 .TP
 \fB\-\-root\fR \fI\fR
-Set the ROOT env var.
+Print  lines of trailing context.
 .TP
 \fB\-v\fR, \fB\-\-verbose\fR
 Prefix each matching line with filename (like \fB-H\fR).  When this
 option is given multiple times, also linenumbers are printed.
 .TP
 \fB\-q\fR, \fB\-\-quiet\fR
-Ignored for compatibility with other qapplets.
+Do not prefix each match with filename.
 .TP
 \fB\-C\fR, \fB\-\-nocolor\fR
-Don't output color.
+Tighter output; suppress warnings.
 .TP
 \fB\-h\fR, \fB\-\-help\fR
-Print this help and exit.
+Don't output color.
 .TP
 \fB\-V\fR, \fB\-\-version\fR
-Print version and exit.
+Print this help and exit.
 
 .SH "REPORTING BUGS"
 Please report bugs via http://bugs.gentoo.org/

diff --git a/qgrep.c b/qgrep.c
index dff959b..058026e 100644
--- a/qgrep.c
+++ b/qgrep.c
@@ -24,11 +24,10 @@
 #include "xchdir.h"
 #include "xregex.h"
 
-#define QGREP_FLAGS "IiHNclLexJEsRS:B:A:" COMMON_FLAGS
+#define QGREP_FLAGS "IiNclLexJEsRS:B:A:" COMMON_FLAGS
 static struct option const qgrep_long_opts[] = {
{"invert-match",  no_argument, NULL, 'I'},
{"ignore-case",   no_argument, NULL, 'i'},
-   {"with-filename", no_argument, NULL, 'H'},
{"with-name", no_argument, NULL, 'N'},
{"count", no_argument, NULL, 'c'},
{"list",  no_argument, NULL, 'l'},
@@ -398,6 +397,8 @@ qgrep_cache_cb(tree_pkg_ctx *pkg_ctx, void *priv)
if (data->include_atoms != NULL) {
depend_atom **d;
for (d = data->include_atoms; *d != NULL; d++) {
+   if ((*d)->SLOT != NULL || (*d)->REPO != NULL)
+  

[gentoo-commits] proj/portage-utils:master commit in: man/, man/include/

2019-08-17 Thread Fabian Groffen
commit: 4b27faa3832c62110573d4fa587a117047bf139c
Author: Fabian Groffen  gentoo  org>
AuthorDate: Thu Jul 18 18:38:46 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Thu Jul 18 18:38:46 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=4b27faa3

man/qlop: q -> g

g is now best matched by t, q was never doing anything in particular

Signed-off-by: Fabian Groffen  gentoo.org>

 man/include/qlop.desc | 2 +-
 man/qlop.1| 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/man/include/qlop.desc b/man/include/qlop.desc
index 3505173..e39f689 100644
--- a/man/include/qlop.desc
+++ b/man/include/qlop.desc
@@ -21,6 +21,6 @@ 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
 of reporting the time the operation finished, \fIqlop\fR now reports the
-time the operation started.  The behaviour of the old \fB-q\fR flag is
+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
 is matched by the new \fB-a\fR flag.

diff --git a/man/qlop.1 b/man/qlop.1
index 909ebdc..baa5bf5 100644
--- a/man/qlop.1
+++ b/man/qlop.1
@@ -29,7 +29,7 @@ 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
 of reporting the time the operation finished, \fIqlop\fR now reports the
-time the operation started.  The behaviour of the old \fB-q\fR flag is
+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
 is matched by the new \fB-a\fR flag.
 .SH OPTIONS



[gentoo-commits] proj/portage-utils:master commit in: man/, /, man/include/

2019-03-07 Thread Fabian Groffen
commit: 9ae56f85211d2c7c00b77b836e797339fc76f9b8
Author: Fabian Groffen  gentoo  org>
AuthorDate: Thu Mar  7 18:18:47 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Thu Mar  7 18:18:47 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=9ae56f85

qlist: change -U to display disabled flags with -v

reimplement umapstr() to allow printing flags not enabled, this is
slightly related to bug #656550.

Signed-off-by: Fabian Groffen  gentoo.org>

 man/include/qlist.optdesc.yaml |   2 +-
 man/qlist.1|   4 +-
 qlist.c| 183 ++---
 3 files changed, 119 insertions(+), 70 deletions(-)

diff --git a/man/include/qlist.optdesc.yaml b/man/include/qlist.optdesc.yaml
index a60ef0d..2b9299c 100644
--- a/man/include/qlist.optdesc.yaml
+++ b/man/include/qlist.optdesc.yaml
@@ -19,6 +19,6 @@ verbose: |
 When listing the package contents, a single \fB\-v\fR displays
 symlinks with an arrow (\->) to their target.  Two or more \fB\-v\fR
 adds colour to the entries and prints like \fB\-I\fR before the
-listing.
+listing.  Shows disabled USE-flags when used with \fB\-U\fR.
 quiet: |
 Suppresses the parenthesis around the USE-flags when used with \fB\-U\fR.

diff --git a/man/qlist.1 b/man/qlist.1
index c2c585c..4df7dab 100644
--- a/man/qlist.1
+++ b/man/qlist.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qlist "1" "Feb 2019" "Gentoo Foundation" "qlist"
+.TH qlist "1" "Mar 2019" "Gentoo Foundation" "qlist"
 .SH NAME
 qlist \- list files owned by pkgname
 .SH SYNOPSIS
@@ -60,7 +60,7 @@ When used with \fB\-I\fR, print the package version next to 
name.
 When listing the package contents, a single \fB\-v\fR displays
 symlinks with an arrow (\->) to their target.  Two or more \fB\-v\fR
 adds colour to the entries and prints like \fB\-I\fR before the
-listing.
+listing.  Shows disabled USE-flags when used with \fB\-U\fR.
 .TP
 \fB\-q\fR, \fB\-\-quiet\fR
 Suppresses the parenthesis around the USE-flags when used with \fB\-U\fR.

diff --git a/qlist.c b/qlist.c
index 4a3b95a..3ca3f5e 100644
--- a/qlist.c
+++ b/qlist.c
@@ -43,84 +43,124 @@ static const char * const qlist_opts_help[] = {
 };
 #define qlist_usage(ret) usage(ret, QLIST_FLAGS, qlist_long_opts, 
qlist_opts_help, NULL, lookup_applet_idx("qlist"))
 
-static char *
-grab_pkg_umap(q_vdb_pkg_ctx *pkg_ctx)
+static int
+cmpstringp(const void *p1, const void *p2)
+{
+   /* case insensitive comparator */
+   return strcasecmp(*((char * const *)p1), *((char * const *)p2));
+}
+
+/*
+ * ==> /var/db/pkg/mail-mta/exim-4.92/IUSE <==
+ * arc dane dcc +dkim dlfunc dmarc +dnsdb doc dovecot-sasl dsn
+ * elibc_glibc exiscan-acl gnutls idn ipv6 ldap libressl lmtp maildir
+ * mbx mysql nis pam perl pkcs11 postgres +prdr proxy radius redis sasl
+ * selinux spf sqlite srs ssl syslog tcpd +tpda X
+ *
+ * ==> /var/db/pkg/mail-mta/exim-4.92/PKGUSE <==
+ * -X dkim dmarc exiscan-acl ipv6 -ldap lmtp maildir -mbox pam -perl spf
+ * ssl tcpd
+ *
+ * ==> /var/db/pkg/mail-mta/exim-4.92/USE <==
+ * abi_x86_64 amd64 dkim dmarc dnsdb elibc_glibc exiscan-acl ipv6
+ * kernel_linux lmtp maildir pam prdr spf ssl tcpd tpda userland_GNU
+ *
+ * % emerge -pv exim
+ *
+ * These are the packages that would be merged, in order:
+ *
+ * Calculating dependencies... done!
+ * [ebuild   R   ~] mail-mta/exim-4.92::gentoo  USE="dkim dmarc dnsdb
+ * exiscan-acl ipv6 lmtp maildir pam prdr spf ssl tcpd tpda -X -arc
+ * -dane -dcc -dlfunc -doc -dovecot-sasl -dsn -gnutls -idn -ldap
+ * -libressl -mbx -mysql -nis -perl -pkcs11 -postgres -proxy -radius
+ * -redis -sasl (-selinux) -sqlite -srs -syslog" 0 KiB
+ *
+ * % qlist -IUv exim
+ * mail-mta/exim-4.92 (-arc -dane -dcc dkim -dlfunc dmarc dnsdb -doc
+ * -dovecot-sasl -dsn exiscan-acl -gnutls -idn ipv6 -ldap -libressl lmtp
+ * maildir -mbx -mysql -nis pam -perl -pkcs11 -postgres prdr -proxy
+ * -radius -redis -sasl -selinux spf -sqlite -srs ssl -syslog tcpd tpda
+ * -X)
+ */
+static char _umapstr_buf[BUFSIZ];
+static const char *
+umapstr(char display, q_vdb_pkg_ctx *pkg_ctx)
 {
-   static char umap[BUFSIZ];
-   static char *use, *iuse;
-   static size_t use_len, iuse_len;
-   int use_argc = 0, iuse_argc = 0;
-   char **use_argv = NULL, **iuse_argv = NULL;
-   queue *ll = NULL;
-   queue *sets = NULL;
-   int i, u;
+   char *bufp = _umapstr_buf;
+   char *use = NULL;
+   char *iuse = NULL;
+   size_t use_len;
+   size_t iuse_len;
+   int use_argc = 0;
+   int iuse_argc = 0;
+   char **use_argv = NULL;
+   char **iuse_argv = NULL;
+   int i;
+   int u;
+   int d;
+
+   *bufp = '\0';
+   if (!display)
+   return bufp;
 
q_vdb_pkg_eat(pkg_ctx, "USE", &use, &use_len);
if (!use[0])
-   return NULL;
+   return bufp;
q_vdb_pkg_eat(pkg_ctx, "IUSE", &iuse, &iuse_le

[gentoo-commits] proj/portage-utils:master commit in: man/, /, man/include/

2019-03-29 Thread Fabian Groffen
commit: c701892114d5b3eea773ff13f013f4d3a71fa571
Author: Fabian Groffen  gentoo  org>
AuthorDate: Fri Mar 29 16:31:50 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Fri Mar 29 16:31:50 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=c7018921

qlop: support standard date output format in parse_date

This allows to cut 'n' paste dates to limit output.

Signed-off-by: Fabian Groffen  gentoo.org>

 man/include/qlop.optdesc.yaml |  3 +++
 man/qlop.1|  5 -
 qlop.c| 14 +-
 3 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/man/include/qlop.optdesc.yaml b/man/include/qlop.optdesc.yaml
index a8fae61..25143b2 100644
--- a/man/include/qlop.optdesc.yaml
+++ b/man/include/qlop.optdesc.yaml
@@ -13,6 +13,9 @@ date: |
 .IP -MM-DD
 Big-endian date, with components separated by hyphens, starting with
 year, followed by month and day of month.
+.IP -MM-DDThh:mm:ss
+As before, but hours, minutes and seconds added.  This is the same
+format qlop prints for timestamps.
 .IP S
 Seconds since 1970-01-01 00:00:00 + (UTC), the UNIX epoch.
 .IP FORMAT|DATE

diff --git a/man/qlop.1 b/man/qlop.1
index 407c9ea..f0ef69a 100644
--- a/man/qlop.1
+++ b/man/qlop.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qlop "1" "Feb 2019" "Gentoo Foundation" "qlop"
+.TH qlop "1" "Mar 2019" "Gentoo Foundation" "qlop"
 .SH NAME
 qlop \- emerge log analyzer
 .SH SYNOPSIS
@@ -89,6 +89,9 @@ Alias for \fI1 day ago\fR.
 .IP -MM-DD
 Big-endian date, with components separated by hyphens, starting with
 year, followed by month and day of month.
+.IP -MM-DDThh:mm:ss
+As before, but hours, minutes and seconds added.  This is the same
+format qlop prints for timestamps.
 .IP S
 Seconds since 1970-01-01 00:00:00 + (UTC), the UNIX epoch.
 .IP FORMAT|DATE

diff --git a/qlop.c b/qlop.c
index b6970d0..a87cc5c 100644
--- a/qlop.c
+++ b/qlop.c
@@ -103,17 +103,21 @@ parse_date(const char *sdate, time_t *t)
return false;
} else {
/* Handle automatic formats:
-* - "12315128"   -> %s
-* - "2015-12-24" -> %Y-%m-%d
+* - "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-");
+   size_t len = strspn(sdate, "0123456789-:T");
if (sdate[len] == '\0') {
const char *fmt;
-   if (strchr(sdate, '-') == NULL)
+   if (strchr(sdate, '-') == NULL) {
fmt = "%s";
-   else
+   } else if ((s = strchr(sdate, 'T')) == NULL) {
fmt = "%Y-%m-%d";
+   } else {
+   fmt = "%Y-%m-%dT%H:%M:%S";
+   }
 
s = strptime(sdate, fmt, &tm);
if (s == NULL || s[0] != '\0')



[gentoo-commits] proj/portage-utils:master commit in: man/, man/include/, /

2019-05-13 Thread Fabian Groffen
commit: 7854ca6d12f793f3b516373784831131db36bca9
Author: Fabian Groffen  gentoo  org>
AuthorDate: Mon May 13 12:56:30 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Mon May 13 12:56:30 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=7854ca6d

qlop: add mode for listing last emerge contents

add -l flag to list packages/sync from last emerge operation and make it
default (when no flags are given)

Signed-off-by: Fabian Groffen  gentoo.org>

 TODO.md   |  2 --
 man/include/qlop.desc |  5 ++--
 man/include/qlop.optdesc.yaml |  3 +++
 man/qlop.1|  9 +--
 qlop.c| 62 ---
 5 files changed, 60 insertions(+), 21 deletions(-)

diff --git a/TODO.md b/TODO.md
index 7df8983..58ea4c5 100644
--- a/TODO.md
+++ b/TODO.md
@@ -83,8 +83,6 @@
 
 - have a mode that doesn't print timestamp (to get just atoms, -v should
   work)
-- make a -d mode that allows to do equivalent of "last portage emerge"
-  to make it easy to see what was newly merged/unmerged
 
 # qlist
 - have -F for use with -I so one can do things like print SLOT for

diff --git a/man/include/qlop.desc b/man/include/qlop.desc
index 0c14e00..3505173 100644
--- a/man/include/qlop.desc
+++ b/man/include/qlop.desc
@@ -2,9 +2,10 @@
 reads from $EMERGE_LOG_DIR/emerge.log and tries to extract
 information about merges, unmerges and syncs.  It can
 calculate average merge times or just list them.  When given no
-arguments or just \fB-v\fR, \fIqlop\fR acts as if \fB-must\fR was given
+arguments or just \fB-v\fR, \fIqlop\fR acts as if \fB-slumt\fR was given
 and thus lists the time taken for all occurrances of merges, unmerges
-and sync operations found in the log.
+and sync operations found in the log for the last \fBemerge\fR(1) action
+performed by Portage.
 .P
 By default, packages are printed as CATEGORY/PN.  Use \fB-v\fR to print
 the package version and revision numbers, e.g\. CATEGORY/PF.  Note that

diff --git a/man/include/qlop.optdesc.yaml b/man/include/qlop.optdesc.yaml
index 25143b2..677c4d2 100644
--- a/man/include/qlop.optdesc.yaml
+++ b/man/include/qlop.optdesc.yaml
@@ -21,6 +21,9 @@ date: |
 .IP FORMAT|DATE
 Use \fIFORMAT\fR as input for \fBstrptime\fR(3) to parse \fIDATE\fR.
 .RE
+lastmerge: |
+Limit selection to last Portage emerge action.  This option is a
+dynamic version of \fB-d\fR, and hence both cannot be used together.
 time: |
 Show the time it took to merge, unmerge or sync.
 average: |

diff --git a/man/qlop.1 b/man/qlop.1
index 83b62f8..ae40fa7 100644
--- a/man/qlop.1
+++ b/man/qlop.1
@@ -10,9 +10,10 @@ qlop \- emerge log analyzer
 reads from $EMERGE_LOG_DIR/emerge.log and tries to extract
 information about merges, unmerges and syncs.  It can
 calculate average merge times or just list them.  When given no
-arguments or just \fB-v\fR, \fIqlop\fR acts as if \fB-must\fR was given
+arguments or just \fB-v\fR, \fIqlop\fR acts as if \fB-slumt\fR was given
 and thus lists the time taken for all occurrances of merges, unmerges
-and sync operations found in the log.
+and sync operations found in the log for the last \fBemerge\fR(1) action
+performed by Portage.
 .P
 By default, packages are printed as CATEGORY/PN.  Use \fB-v\fR to print
 the package version and revision numbers, e.g\. CATEGORY/PF.  Note that
@@ -98,6 +99,10 @@ Seconds since 1970-01-01 00:00:00 + (UTC), the UNIX 
epoch.
 Use \fIFORMAT\fR as input for \fBstrptime\fR(3) to parse \fIDATE\fR.
 .RE
 .TP
+\fB\-l\fR, \fB\-\-lastmerge\fR
+Limit selection to last Portage emerge action.  This option is a
+dynamic version of \fB-d\fR, and hence both cannot be used together.
+.TP
 \fB\-f\fR \fI\fR, \fB\-\-logfile\fR \fI\fR
 Read emerge logfile instead of $EMERGE_LOG_DIR/emerge.log.
 .TP

diff --git a/qlop.c b/qlop.c
index a60e5ac..5217638 100644
--- a/qlop.c
+++ b/qlop.c
@@ -24,7 +24,7 @@
 
 #define QLOP_DEFAULT_LOGFILE "emerge.log"
 
-#define QLOP_FLAGS "ctaHMmuUserd:f:w:" COMMON_FLAGS
+#define QLOP_FLAGS "ctaHMmuUslerd:f:w:" COMMON_FLAGS
 static struct option const qlop_long_opts[] = {
{"summary",   no_argument, NULL, 'c'},
{"time",  no_argument, NULL, 't'},
@@ -38,6 +38,7 @@ static struct option const qlop_long_opts[] = {
{"endtime",   no_argument, NULL, 'e'},
{"running",   no_argument, NULL, 'r'},
{"date",   a_argument, NULL, 'd'},
+   {"lastmerge", no_argument, NULL, 'l'},
{"logfile",a_argument, NULL, 'f'},
{"atoms",  a_argument, NULL, 'w'},
COMMON_LONG_OPTS
@@ -55,6 +56,7 @@ static const char * const qlop_opts_help[] = {
"Report time at which the operation finished (iso started)",
"Show current emerging packages",
"Limit selection to this time (1st -d is start, 2nd -d is end)",
+   "Limit selection to last Portage emerge action",
"Read emerge logfile instead of $EMERGE_LOG_

[gentoo-commits] proj/portage-utils:master commit in: man/, /, man/include/

2019-05-13 Thread Fabian Groffen
commit: 966de456d8af3b5102950e608a771f776efdd014
Author: Fabian Groffen  gentoo  org>
AuthorDate: Mon May 13 13:37:31 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Mon May 13 13:37:31 2019 +
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",
+  

[gentoo-commits] proj/portage-utils:master commit in: man/, /, man/include/

2019-05-17 Thread Fabian Groffen
commit: 5531d5c97a27c002abfcc1bd229d0716bba4b2e3
Author: Fabian Groffen  gentoo  org>
AuthorDate: Fri May 17 14:34:09 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Fri May 17 14:34:09 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=5531d5c9

qfile: allow matching basenames to objects by default

one can now do qfile qfile to find app-portage/portage-utils
updated the manpage somewhat

Signed-off-by: Fabian Groffen  gentoo.org>

 man/include/qfile-01-owners.include | 30 ++-
 man/include/qfile-02-orphans.include| 15 +++---
 man/include/qfile-03-ROOT.include   | 20 
 man/include/qfile-05-collisions.include |  8 +--
 man/include/qfile.desc  | 23 +
 man/include/qfile.optdesc.yaml  |  4 ++
 man/qfile.1 | 88 -
 qfile.c | 35 -
 8 files changed, 140 insertions(+), 83 deletions(-)

diff --git a/man/include/qfile-01-owners.include 
b/man/include/qfile-01-owners.include
index a4bdc76..39b1e03 100644
--- a/man/include/qfile-01-owners.include
+++ b/man/include/qfile-01-owners.include
@@ -1,16 +1,14 @@
 .SH "FINDING FILE OWNERS"
 .PP
-This is the default behavior of \fBqfile\fP.  It will list the packages which
-own the files (or directories, or symlinks, or anything else Portage can 
-install) you are querying.  Query items may be file paths or simple file
-names when the \fB\-b\fP option is used.
-By default, output includes packages names and the complete paths to
-the matching files.  If using \fB\-\-exact\fP, versions of the packages will 
-also be shown.  At the contrary, when using \fB\-\-quiet\fP, only package 
-names are listed, without files paths.  Finally, \fB\-\-verbose\fP is similar
-to \fB\-\-exact\fP, but may add a few warnings.  The return status of 
-\fBqfile\fP will be \fI0\fP as soon as an owning package has been found for 
-one of the query items.
+This is the default behavior of \fBqfile\fP.  It will list the packages
+which own the files (or directories, or symlinks, or anything else
+Portage can install) you are querying.  Query items may be file paths or
+simple file names.  By default, output includes packages names and the
+complete paths to the matching files.  If using \fB\-\-verbose\fP,
+versions of the packages will also be shown.  In contrast, when using
+\fB\-\-quiet\fP, only package names are listed, without files paths.
+The return status of \fBqfile\fP will be \fI0\fP as soon as an owning
+package has been found for one of the query items.
 .PP
 Find names of package(s) owning "/bin/bash":
 .nf\fI
@@ -20,17 +18,17 @@ Find names of package(s) owning "/bin/bash":
 .PP
 Find package(s) owning any file named "bash", and show paths of this files:
 .nf\fI
-   $ qfile -b bash
-   app-shells/bash (/bin/bash)
-   app-shells/bash (/etc/bash)
+   $ qfile -d bash
+   app-shells/bash: /bin/bash
+   app-shells/bash: /etc/bash
 .fi
 .PP
 Find packages(s) owning the file named "bash" in the current directory. Also 
 display their exact version:
 .nf\fI
$ cd /bin
-   $ qfile -e ./bash
-   app-shells/bash-3.1_p17 (/bin/bash)
+   $ qfile -v ./bash
+   app-shells/bash-3.1_p17: /bin/bash
 .fi
 .PP
 Find the package(s) owning the libraries needed by the Bash binary:

diff --git a/man/include/qfile-02-orphans.include 
b/man/include/qfile-02-orphans.include
index ca23796..f6754aa 100644
--- a/man/include/qfile-02-orphans.include
+++ b/man/include/qfile-02-orphans.include
@@ -1,13 +1,12 @@
 .SH "FINDING ORPHAN FILES"
 .PP
-\fBqfile\fP can also, with the \fB\-\-orphans\fP option, find files which are 
-not owned by any package.  This behavior is the opposite of the usual file 
-owner search: the output is the list of query items for which no reference has
-been found in your installed packages database.  The \fB\-\-exact\fP option has
-no effect in this mode, whereas \fB\-\-verbose\fP may add a few warning 
-messages.  As for \fB\-\-quiet\fP, it will completly turn off the output, 
-leaving just a silent test command, which returns \fI0\fP if and only if
-there was no orphan in your query items.
+\fBqfile\fP can also, with the \fB\-\-orphans\fP option, find files
+which are not owned by any package.  This behaviour is the opposite of
+the usual file owner search: the output is the list of query items for
+which no reference has been found in your installed packages database.
+As for \fB\-\-quiet\fP, it will completly turn off the output, leaving
+just a silent test command, which returns \fI0\fP if and only if there
+was no orphan in your query items.
 .PP
 Find the orphan libtool files of your system:
 .nf\fI

diff --git a/man/include/qfile-03-ROOT.include 
b/man/include/qfile-03-ROOT.include
index 61d965d..3bfbe51 100644
--- a/man/include/qfile-03-ROOT.include
+++ b/man/include/qfile-03-ROOT.include
@@ -1,7 +1,7 @@
 .SH "$ROOT HANDLING"
 .PP

[gentoo-commits] proj/portage-utils:master commit in: man/, /, man/include/

2019-04-28 Thread Fabian Groffen
commit: c5aba3a0bd055688120dbabb9c3826ed46ffc795
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sun Apr 28 07:57:05 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sun Apr 28 07:57:05 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=c5aba3a0

qgrep: rewrite using libq/vdb and libq/cache

(re)use the traversion logic from libq instead of re-implementing this.
Additional benefits are less code and usage of metadata when available.

Signed-off-by: Fabian Groffen  gentoo.org>

 applets.h  |   2 +-
 man/include/qgrep.desc |   9 +-
 man/include/qgrep.optdesc.yaml |   5 +-
 man/q.1|   2 +-
 man/qgrep.1|  16 +-
 qgrep.c| 756 ++---
 6 files changed, 429 insertions(+), 361 deletions(-)

diff --git a/applets.h b/applets.h
index 5889de6..4dd5bc2 100644
--- a/applets.h
+++ b/applets.h
@@ -73,7 +73,7 @@ static const struct applet_t {
/*
{"qglsa", qglsa_main, " ", "check GLSAs against 
system"},
*/
-   {"qgrep", qgrep_main, "", "grep in ebuilds"},
+   {"qgrep", qgrep_main, " [pkg ...]", "grep in ebuilds"},
{"qlist", qlist_main, "",   "list files owned by 
pkgname"},
{"qlop",  qlop_main,  "",   "emerge log analyzer"},
{"qmerge",qmerge_main,"",  "fetch and merge 
binary package"},

diff --git a/man/include/qgrep.desc b/man/include/qgrep.desc
index c95d35a..98bcc09 100644
--- a/man/include/qgrep.desc
+++ b/man/include/qgrep.desc
@@ -1,3 +1,6 @@
-\fIqgrep\fR searches for a given pattern in all ebuilds of the current
-portage tree.  Optionally the search is in all eclasses, or just in the
-ebuilds that are currently installed.
+\fIqgrep\fR searches for a given expression in all ebuilds of the
+current portage tree and defined additional overlays.  Optionally the
+search is in all eclasses, or just in the ebuilds that are currently
+installed.  To narrow the search, multiple targets can be given using
+atom syntax.  In particular, the trailing slash (/) syntax can be used
+to match an entire category.  See also \fIqatom\fR(1).

diff --git a/man/include/qgrep.optdesc.yaml b/man/include/qgrep.optdesc.yaml
index 87b174e..ad3874d 100644
--- a/man/include/qgrep.optdesc.yaml
+++ b/man/include/qgrep.optdesc.yaml
@@ -1,5 +1,4 @@
 verbose: |
-Print multiple matches per files.  When this option is given
-multiple times, also linenumber are printed for matches next to file
-names.
+Prefix each matching line with filename (like \fB-H\fR).  When this
+option is given multiple times, also linenumbers are printed.
 quiet: Ignored for compatibility with other qapplets.

diff --git a/man/q.1 b/man/q.1
index b3e985b..afba24a 100644
--- a/man/q.1
+++ b/man/q.1
@@ -41,7 +41,7 @@ Print version and exit.
qcheck: verify integrity of installed packages
  qdepends: show dependency info
 qfile   : list all pkgs owning files
-qgrep  : grep in ebuilds
+qgrep  [pkg ...]: grep in ebuilds
 qlist: list files owned by pkgname
  qlop: emerge log analyzer
qmerge   : fetch and merge binary package

diff --git a/man/qgrep.1 b/man/qgrep.1
index 662122d..048e28e 100644
--- a/man/qgrep.1
+++ b/man/qgrep.1
@@ -4,11 +4,14 @@
 qgrep \- grep in ebuilds
 .SH SYNOPSIS
 .B qgrep
-\fI[opts] \fR
+\fI[opts]  [pkg ...]\fR
 .SH DESCRIPTION
-\fIqgrep\fR searches for a given pattern in all ebuilds of the current
-portage tree.  Optionally the search is in all eclasses, or just in the
-ebuilds that are currently installed.
+\fIqgrep\fR searches for a given expression in all ebuilds of the
+current portage tree and defined additional overlays.  Optionally the
+search is in all eclasses, or just in the ebuilds that are currently
+installed.  To narrow the search, multiple targets can be given using
+atom syntax.  In particular, the trailing slash (/) syntax can be used
+to match an entire category.  See also \fIqatom\fR(1).
 .SH OPTIONS
 .TP
 \fB\-I\fR, \fB\-\-invert\-match\fR
@@ -60,9 +63,8 @@ Print  lines of trailing context.
 Set the ROOT env var.
 .TP
 \fB\-v\fR, \fB\-\-verbose\fR
-Print multiple matches per files.  When this option is given
-multiple times, also linenumber are printed for matches next to file
-names.
+Prefix each matching line with filename (like \fB-H\fR).  When this
+option is given multiple times, also linenumbers are printed.
 .TP
 \fB\-q\fR, \fB\-\-quiet\fR
 Ignored for compatibility with other qapplets.

diff --git a/qgrep.c b/qgrep.c
index 16bb4c1..3950c22 100644
--- a/qgrep.c
+++ b/qgrep.c
@@ -64,35 +64,6 @@ static const char * const qgrep_opts_help[] = {
 };
 #define qgrep_usage(ret) usage(ret, QGREP_FLAGS, qgrep_long_opts, 
qgrep_opts_help, NULL, lookup_applet_idx("qgrep"))
 
-static char
-qgrep_name_match(const char* name, const int argc, depend_atom** a

[gentoo-commits] proj/portage-utils:master commit in: man/, man/include/

2018-04-01 Thread Fabian Groffen
commit: b10334e70c272bb554228acea075011925f260fb
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sun Apr  1 12:44:30 2018 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sun Apr  1 12:44:30 2018 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=b10334e7

man/qlop: regen manpage

commit fe42f2a99297fed36720e71ba2ed77cf7a9da804 changed the generated
file, this commit ensures that future regenerate operations don't lose
the changes

 man/include/qlop.desc |  4 
 man/include/qlop.optdesc.yaml | 15 +++
 man/qlop.1| 26 +++---
 3 files changed, 34 insertions(+), 11 deletions(-)

diff --git a/man/include/qlop.desc b/man/include/qlop.desc
new file mode 100644
index 000..d99cc94
--- /dev/null
+++ b/man/include/qlop.desc
@@ -0,0 +1,4 @@
+.I qlop
+reads from $EMERGE_LOG_DIR/emerge.log and tries to extract
+information about merges, unmerges and syncs.  For packages, it can
+calculate average merge times or just list them.

diff --git a/man/include/qlop.optdesc.yaml b/man/include/qlop.optdesc.yaml
new file mode 100644
index 000..7864d6e
--- /dev/null
+++ b/man/include/qlop.optdesc.yaml
@@ -0,0 +1,15 @@
+gauge: |
+Gauge number of times a package has been merged.  This shows the
+merge time for each individual merge of package.
+time: |
+Calculate merge time for a specific package.  This is the average
+time for all merges of package.
+human: |
+Print seconds in human readable format (needs \fB\-t\fR), using
+minutes, hours and days instead of just seconds.
+current: |
+Show current emerging packages.  This relies on
+.I FEATURES=sandbox
+in order to detect running merges.
+verbose: |
+Print package versions and revisions.

diff --git a/man/qlop.1 b/man/qlop.1
index 70fb411..c138054 100644
--- a/man/qlop.1
+++ b/man/qlop.1
@@ -1,26 +1,28 @@
-.TH qlop "1" "Mar 2018" "Gentoo Foundation" "qlop"
+.\" generated by mkman.py, please do NOT edit!
+.TH qlop "1" "Apr 2018" "Gentoo Foundation" "qlop"
 .SH NAME
 qlop \- emerge log analyzer
 .SH SYNOPSIS
 .B qlop
 \fI[opts] \fR
 .SH DESCRIPTION
-qlop reads from $EMERGE_LOG_DIR/emerge.log and tries to extract
+.I qlop
+reads from $EMERGE_LOG_DIR/emerge.log and tries to extract
 information about merges, unmerges and syncs.  For packages, it can
 calculate average merge times or just list them.
 .SH OPTIONS
 .TP
 \fB\-g\fR, \fB\-\-gauge\fR
-Gauge number of times a package has been merged.  This shows the merge
-time for each individual merge of package.
+Gauge number of times a package has been merged.  This shows the
+merge time for each individual merge of package.
 .TP
 \fB\-t\fR, \fB\-\-time\fR
-Calculate merge time for a specific package.  This is the average time
-for all merges of package.
+Calculate merge time for a specific package.  This is the average
+time for all merges of package.
 .TP
 \fB\-H\fR, \fB\-\-human\fR
-Print seconds in human readable format (needs -t), using minutes, hours
-and days instead of just seconds.
+Print seconds in human readable format (needs \fB\-t\fR), using
+minutes, hours and days instead of just seconds.
 .TP
 \fB\-l\fR, \fB\-\-list\fR
 Show merge history.
@@ -32,8 +34,9 @@ Show unmerge history.
 Show sync history.
 .TP
 \fB\-c\fR, \fB\-\-current\fR
-Show current emerging packages.  This relies on FEATURES=sandbox in
-order to detect running merges.
+Show current emerging packages.  This relies on
+.I FEATURES=sandbox
+in order to detect running merges.
 .TP
 \fB\-d\fR \fI\fR, \fB\-\-date\fR \fI\fR
 Limit selection to this time (1st -d is start, 2nd -d is end).
@@ -62,7 +65,8 @@ Print version and exit.
 .SH "REPORTING BUGS"
 Please report bugs via http://bugs.gentoo.org/
 .br
-Product: Portage Development; Component: Tools
+Product: Portage Development; Component: Tools, Assignee:
+portage-ut...@gentoo.org
 .SH AUTHORS
 .nf
 Ned Ludd 



[gentoo-commits] proj/portage-utils:master commit in: man/, man/include/

2018-04-01 Thread Fabian Groffen
commit: 3b1cb130c9d20ef0d1190d7b7baf25a910765167
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sun Apr  1 13:47:10 2018 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sun Apr  1 13:47:10 2018 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=3b1cb130

man/qdepends: improve manpage

Bug https://bugs.gentoo.org/645554

 man/include/qdepends-05-examples.include | 17 +++
 man/include/qdepends.desc| 10 +++--
 man/include/qdepends.optdesc.yaml| 29 
 man/qdepends.1   | 77 
 4 files changed, 111 insertions(+), 22 deletions(-)

diff --git a/man/include/qdepends-05-examples.include 
b/man/include/qdepends-05-examples.include
index d4779ea..04fb92f 100644
--- a/man/include/qdepends-05-examples.include
+++ b/man/include/qdepends-05-examples.include
@@ -6,3 +6,20 @@ For finding out what a particular package depends on for 
building, you could do:
 .fi
 This tells us that we have \fIapp-editors/nano-2.3.2\fR installed and it 
depends
 on ncurses (among other things).
+
+Searching for packages that actually have nano in their RDEPEND:
+.nf
+   $ \fIqdepends -rQ nano\fR
+   virtual/editor-0
+.fi
+Tells us that \fIvirtual/editor\fR depends on nano.  However, if we
+wanted to know in what way a package specifically depends on another
+package, one can use \fB\-v\fR.
+.nf
+   $ \fIqdepends -vrQ logrotate\fR
+   sys-apps/portage-2.3.18: >=app-admin/logrotate-3.8.0
+.fi
+This way we can see there is a specific dependency expressed here.  If
+the above had used \fI\fR can be
+any key from Portage's VDB, e.g.\ any file from
+var/db/pkg///.
+query: |
+Query reverse deps.  This basically reverses the search to any
+package that references \fI\fR in DEPEND, RDEPEND or PDEPEND.
+This can be useful to find consumers of a given package, e.g.\ to
+search for packages that have \fIlogwatch\fR in their DEPEND.
+name-only: |
+Only show category/package, instead of category/package-version.
+format: |
+Pretty-print DEPEND declaration to be used in an ebuild.  This
+option initiates a very different mode of operation.  Instead of
+printing searching through packages, it constructs a multi-line
+statement in with shell syntax, to be used in an ebuild.  Each
+argument is turned into a separate DEPEND variable declaration.  You
+need to quote dependency strings in order for them to be printed as
+a single dependency declaration.  When used with the \fB\-q\fR
+option, only the pretty-printed dependency declaration is printed,
+e.g.\ the DEPEND= part is skipped.
+verbose: |
+When in reverse dep mode, print the package or packages that matched
+the query from the dependency line being searched.  This includes
+specifiers and versions.
+quiet: Suppress DEPEND= output for \fB\-f\fR.

diff --git a/man/qdepends.1 b/man/qdepends.1
index a0cac5b..c51a02d 100644
--- a/man/qdepends.1
+++ b/man/qdepends.1
@@ -1,64 +1,85 @@
-.TH qdepends "1" "Mar 2016" "Gentoo Foundation" "qdepends"
+.\" generated by mkman.py, please do NOT edit!
+.TH qdepends "1" "Apr 2018" "Gentoo Foundation" "qdepends"
 .SH NAME
 qdepends \- show dependency info
 .SH SYNOPSIS
 .B qdepends
 \fI[opts] \fR
 .SH DESCRIPTION
-The qdepends applet has a couple different modes.  Normally it is geared 
towards
+The
+.I qdepends
+applet has a couple different modes.  Normally it is geared towards
 answering the queries "what does package X depend on" and "what packages depend
 on X".  Both can further be classified into build, run, and post dependencies.
 
 By default, it will tell you the build time dependencies only (DEPEND).
 
-Currently, qdepends will only query installed packages.  There is no support 
for
-querying packages not yet installed (the \fBequery\fR(1) tool can do that).
+Currently,
+.I qdepends
+will only query installed packages.  There is no support for
+querying packages not yet installed (see \fBequery\fR(1) for that).
 
 If there is no answer to your query (i.e. you've asked for a package that is 
not
 installed, or a version that does not match), then you will get back no output.
 .SH OPTIONS
 .TP
 \fB\-d\fR, \fB\-\-depend\fR
-Show DEPEND info (default)
+Show DEPEND info (default).
 .TP
 \fB\-r\fR, \fB\-\-rdepend\fR
-Show RDEPEND info
+Show RDEPEND info.
 .TP
 \fB\-p\fR, \fB\-\-pdepend\fR
-Show PDEPEND info
+Show PDEPEND info.
 .TP
 \fB\-k\fR \fI\fR, \fB\-\-key\fR \fI\fR
-User defined vdb key
+Advanced option to allow querying the VDB.  This option overrides
+\fB\-d\fR, \fB\-r\fR, \fB\-p\fR or \fB\-a\fR.  \fI\fR can be
+any key from Portage's VDB, e.g.\ any file from
+var/db/pkg///.
 .TP
 \fB\-Q\fR \fI\fR, \fB\-\-query\fR \fI\fR
-Query reverse deps
+Query reverse deps.  This basically reverses the search to any
+package that references \fI\fR in DEPEND, RDEPEND or PDEPEND.
+This can be useful to find consumers of a given package, e.g.\ to

[gentoo-commits] proj/portage-utils:master commit in: man/, man/include/

2018-04-02 Thread Fabian Groffen
commit: 9164549006068637d060a23a9a24f657982bfbaf
Author: Fabian Groffen  gentoo  org>
AuthorDate: Mon Apr  2 17:26:35 2018 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Mon Apr  2 17:26:35 2018 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=91645490

qatom: improve manpage

Bug: https://bugs.gentoo.org/645554

 man/include/qatom.desc | 15 +
 man/include/qatom.optdesc.yaml | 43 
 man/qatom.1| 74 --
 3 files changed, 122 insertions(+), 10 deletions(-)

diff --git a/man/include/qatom.desc b/man/include/qatom.desc
new file mode 100644
index 000..10f0c1c
--- /dev/null
+++ b/man/include/qatom.desc
@@ -0,0 +1,15 @@
+\fIqatom\fR parses strings into atoms and optionally compares them.  The
+parsing into atoms results in CATEGORY, PN (package name), PV (package
+version), PR (package revision), SLOT and REPO.  Next to these version
+qualifiers (e.g.\ >, <, or =) and optional * suffix are extracted.  All
+but PN are optional.
+
+Comparison of atoms returns the relationship between two parsed atoms.
+\fIqatom\fR does not allow to test conditions.  It is possible to
+perform multiple comparisons by simply adding more arguments.
+Comparisons are, however, always performed two by two, so there must be
+an even count of arguments to the compare function.
+
+The \fIqatom\fR applet is a direct wrapper around the atom parsing
+functionalities used by various other applets.  As such this applet
+allows easy testing or atom parsing and comparison behaviour.

diff --git a/man/include/qatom.optdesc.yaml b/man/include/qatom.optdesc.yaml
new file mode 100644
index 000..e71dfb7
--- /dev/null
+++ b/man/include/qatom.optdesc.yaml
@@ -0,0 +1,43 @@
+format: |
+Specify a custom  output  format.  The default format is
+.nf
+%{CATEGORY} %{PN} %{PV} %[PR] %[SLOT] %[pfx] %[sfx]
+.fi
+Conversion specifiers start with a \fI%\fR symbol and are followed
+by either \fI{\fR or \fI[\fR.  Next is the name of the field to
+expand, followed by a matching \fI}\fR or \fI]\fR.  The difference
+between \fI{\fR and \fI[\fR is that the latter is only printed if
+the field referred is set, while the former prints \fI\fR in
+that case.
+
+The following fields are supported, which are inline with the
+variables from \fBebuild\fR(5).
+.RS
+.IP CATEGORY
+The category of the package.
+.IP P
+The package name and version without the ebuild revision.
+.IP PN
+The package name.
+.IP PV
+The package version without the ebuild revision.
+.IP PVR
+The package version including ebuild revision, which is also printed
+when zero, unlike for \fIPF\fR.
+.IP PF
+The package name, version and revision when not zero.  Thus, a zero
+revision \fI\-r0\fR is not printed.
+.IP PR
+The ebuild revision, when force printed, outputs \fI\-r0\fR when unset.
+.IP SLOT
+The package slot, when force printed, outputs \fI\-\fR when unset.
+.IP REPO
+The package repository.
+.IP pfx
+The package prefixes, that is version specifiers.
+.IP sfx
+The package suffices, currently that is just the asterisk.
+.RE
+verbose: Force all expansions, basically treat all \fI[\fR like \fI{\fR.
+quiet: Ignored for compatibility with other qapplets.
+nocolor: Ignored for compatibility with other qapplets.

diff --git a/man/qatom.1 b/man/qatom.1
index 4a30343..aeb9629 100644
--- a/man/qatom.1
+++ b/man/qatom.1
@@ -1,41 +1,95 @@
-.TH qatom "1" "Mar 2016" "Gentoo Foundation" "qatom"
+.\" generated by mkman.py, please do NOT edit!
+.TH qatom "1" "Apr 2018" "Gentoo Foundation" "qatom"
 .SH NAME
 qatom \- split atom strings
 .SH SYNOPSIS
 .B qatom
 \fI[opts] \fR
 .SH DESCRIPTION
+\fIqatom\fR parses strings into atoms and optionally compares them.  The
+parsing into atoms results in CATEGORY, PN (package name), PV (package
+version), PR (package revision), SLOT and REPO.  Next to these version
+qualifiers (e.g.\ >, <, or =) and optional * suffix are extracted.  All
+but PN are optional.
 
+Comparison of atoms returns the relationship between two parsed atoms.
+\fIqatom\fR does not allow to test conditions.  It is possible to
+perform multiple comparisons by simply adding more arguments.
+Comparisons are, however, always performed two by two, so there must be
+an even count of arguments to the compare function.
+
+The \fIqatom\fR applet is a direct wrapper around the atom parsing
+functionalities used by various other applets.  As such this applet
+allows easy testing or atom parsing and comparison behaviour.
 .SH OPTIONS
 .TP
 \fB\-F\fR \fI\fR, \fB\-\-format\fR \fI\fR
-Custom output format (default: %{CATEGORY} %{PN} %{PV} %[PR] %[SLOT] %[pfx] 
%[sfx])
+Specify a custom  output  format.  The default format is
+.nf
+%{CATEGORY} %{PN} %{PV} %[PR] %[SLOT] %[pfx] %[sfx]
+.fi
+Conversion specifiers start with a \fI%

[gentoo-commits] proj/portage-utils:master commit in: man/, man/include/, /

2018-04-03 Thread Fabian Groffen
commit: 1def9d468742c0d6d6b24aa1f1d76243be6e24cd
Author: Fabian Groffen  gentoo  org>
AuthorDate: Tue Apr  3 11:49:41 2018 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Tue Apr  3 11:49:41 2018 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=1def9d46

qlist: improve documentation

Bug: https://bugs.gentoo.org/645554

 man/include/qlist.desc |  6 +
 man/include/qlist.optdesc.yaml | 24 ++
 man/qlist.1| 56 +++---
 qlist.c|  2 +-
 4 files changed, 67 insertions(+), 21 deletions(-)

diff --git a/man/include/qlist.desc b/man/include/qlist.desc
new file mode 100644
index 000..e02d971
--- /dev/null
+++ b/man/include/qlist.desc
@@ -0,0 +1,6 @@
+\fIqlist\fR shows the contents, or a subset thereof, of an installed
+package.  Alternatively, lists whether a package is installed,
+optionally with version, USE-flag, SLOT or REPO information.  The
+\fIpkgname\fR to query for does not have to be an exact match, it may be
+part of it, e.g.\ an entire category, or any package with some string in
+its name.

diff --git a/man/include/qlist.optdesc.yaml b/man/include/qlist.optdesc.yaml
new file mode 100644
index 000..a60ef0d
--- /dev/null
+++ b/man/include/qlist.optdesc.yaml
@@ -0,0 +1,24 @@
+installed: |
+Instead of listing the contents of a package, just print the package
+name if the package is currently installed.
+umap: |
+List USE-flags enabled when the package was installed.  This flag
+implies \fB\-I\fR.
+slot: |
+Display installed packages with slots (use twice for subslots).
+This flag implies \fB\-I\fR.
+repo: |
+Display installed packages with repository the ebuild originated from.
+This flag implies \fB\-I\fR.
+columns: |
+Like \fB\-Iv\fR, but package name and version are separated by a
+space for easy consumption by e.g.\ shell scripts which can read
+space-separated columns.
+verbose: |
+When used with \fB\-I\fR, print the package version next to name.
+When listing the package contents, a single \fB\-v\fR displays
+symlinks with an arrow (\->) to their target.  Two or more \fB\-v\fR
+adds colour to the entries and prints like \fB\-I\fR before the
+listing.
+quiet: |
+Suppresses the parenthesis around the USE-flags when used with \fB\-U\fR.

diff --git a/man/qlist.1 b/man/qlist.1
index 05e9326..f7dd847 100644
--- a/man/qlist.1
+++ b/man/qlist.1
@@ -1,68 +1,84 @@
-.TH qlist "1" "Mar 2016" "Gentoo Foundation" "qlist"
+.\" generated by mkman.py, please do NOT edit!
+.TH qlist "1" "Apr 2018" "Gentoo Foundation" "qlist"
 .SH NAME
 qlist \- list files owned by pkgname
 .SH SYNOPSIS
 .B qlist
 \fI[opts] \fR
 .SH DESCRIPTION
-
+\fIqlist\fR shows the contents, or a subset thereof, of an installed
+package.  Alternatively, lists whether a package is installed,
+optionally with version, USE-flag, SLOT or REPO information.  The
+\fIpkgname\fR to query for does not have to be an exact match, it may be
+part of it, e.g.\ an entire category, or any package with some string in
+its name.
 .SH OPTIONS
 .TP
 \fB\-I\fR, \fB\-\-installed\fR
-Just show installed packages
+Instead of listing the contents of a package, just print the package
+name if the package is currently installed.
 .TP
 \fB\-S\fR, \fB\-\-slots\fR
-Display installed packages with slots (use twice for subslots)
+Display installed packages with slots (use twice for subslots).
 .TP
 \fB\-R\fR, \fB\-\-repo\fR
-Display installed packages with repository
+Display installed packages with repository the ebuild originated from.
+This flag implies \fB\-I\fR.
 .TP
 \fB\-U\fR, \fB\-\-umap\fR
-Display installed packages with flags used
+List USE-flags enabled when the package was installed.  This flag
+implies \fB\-I\fR.
 .TP
 \fB\-c\fR, \fB\-\-columns\fR
-Display column view
+Like \fB\-Iv\fR, but package name and version are separated by a
+space for easy consumption by e.g.\ shell scripts which can read
+space-separated columns.
 .TP
 \fB\-\-showdebug\fR
-Show /usr/lib/debug files
+Show /usr/lib/debug and /usr/src/debug files.
 .TP
 \fB\-e\fR, \fB\-\-exact\fR
-Exact match (only CAT/PN or PN without PV)
+Exact match (only CAT/PN or PN without PV).
 .TP
 \fB\-a\fR, \fB\-\-all\fR
-Show every installed package
+Show every installed package.
 .TP
 \fB\-d\fR, \fB\-\-dir\fR
-Only show directories
+Only show directories.
 .TP
 \fB\-o\fR, \fB\-\-obj\fR
-Only show objects
+Only show objects.
 .TP
 \fB\-s\fR, \fB\-\-sym\fR
-Only show symlinks
+Only show symlinks.
 .TP
 \fB\-\-root\fR \fI\fR
-Set the ROOT env var
+Set the ROOT env var.
 .TP
 \fB\-v\fR, \fB\-\-verbose\fR
-Make a lot of noise
+When used with \fB\-I\fR, print the package version next to name.
+When listing the package contents, a single \fB\-v\fR displays
+symlinks with an arrow (\->) to their target.  Two or more \fB\-v\fR
+adds colour to the entries and prints like \fB\-I\fR before the
+list

[gentoo-commits] proj/portage-utils:master commit in: man/, man/include/

2018-04-03 Thread Fabian Groffen
commit: 86085691d6a42e497c1a8902cf7c24212a2dd67d
Author: Fabian Groffen  gentoo  org>
AuthorDate: Tue Apr  3 12:56:17 2018 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Tue Apr  3 12:56:17 2018 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=86085691

qpkg: improve documentation

Bug: https://bugs.gentoo.org/645554

 man/include/qpkg.desc |  4 
 man/include/qpkg.optdesc.yaml |  2 ++
 man/qpkg.1| 31 ++-
 3 files changed, 24 insertions(+), 13 deletions(-)

diff --git a/man/include/qpkg.desc b/man/include/qpkg.desc
new file mode 100644
index 000..2bba24b
--- /dev/null
+++ b/man/include/qpkg.desc
@@ -0,0 +1,4 @@
+\fIqpkg\fR creates or cleans up Gentoo binary packages.  The default
+action is to create a new binpkg for the given package names and store
+them in pkgdir, which can be set explicitly using the \fB\-\-pkgdir\fR
+option.

diff --git a/man/include/qpkg.optdesc.yaml b/man/include/qpkg.optdesc.yaml
new file mode 100644
index 000..2da2810
--- /dev/null
+++ b/man/include/qpkg.optdesc.yaml
@@ -0,0 +1,2 @@
+verbose: Check and report MD5 hash mismatches during install.
+quiet: Ignored for compatability with other qapplets.

diff --git a/man/qpkg.1 b/man/qpkg.1
index 8bb098a..930d15c 100644
--- a/man/qpkg.1
+++ b/man/qpkg.1
@@ -1,47 +1,52 @@
-.TH qpkg "1" "Mar 2016" "Gentoo Foundation" "qpkg"
+.\" generated by mkman.py, please do NOT edit!
+.TH qpkg "1" "Apr 2018" "Gentoo Foundation" "qpkg"
 .SH NAME
 qpkg \- manipulate Gentoo binpkgs
 .SH SYNOPSIS
 .B qpkg
 \fI[opts] \fR
 .SH DESCRIPTION
-
+\fIqpkg\fR creates or cleans up Gentoo binary packages.  The default
+action is to create a new binpkg for the given package names and store
+them in pkgdir, which can be set explicitly using the \fB\-\-pkgdir\fR
+option.
 .SH OPTIONS
 .TP
 \fB\-c\fR, \fB\-\-clean\fR
-clean pkgdir of unused binary files
+clean pkgdir of unused binary files.
 .TP
 \fB\-E\fR, \fB\-\-eclean\fR
-clean pkgdir of files not in the tree anymore (slow)
+clean pkgdir of files not in the tree anymore (slow).
 .TP
 \fB\-p\fR, \fB\-\-pretend\fR
-pretend only
+pretend only.
 .TP
 \fB\-P\fR \fI\fR, \fB\-\-pkgdir\fR \fI\fR
-alternate package directory
+alternate package directory.
 .TP
 \fB\-\-root\fR \fI\fR
-Set the ROOT env var
+Set the ROOT env var.
 .TP
 \fB\-v\fR, \fB\-\-verbose\fR
-Make a lot of noise
+Check and report MD5 hash mismatches during install.
 .TP
 \fB\-q\fR, \fB\-\-quiet\fR
-Tighter output; suppress warnings
+Ignored for compatability with other qapplets.
 .TP
 \fB\-C\fR, \fB\-\-nocolor\fR
-Don't output color
+Don't output color.
 .TP
 \fB\-h\fR, \fB\-\-help\fR
-Print this help and exit
+Print this help and exit.
 .TP
 \fB\-V\fR, \fB\-\-version\fR
-Print version and exit
+Print version and exit.
 
 .SH "REPORTING BUGS"
 Please report bugs via http://bugs.gentoo.org/
 .br
-Product: Portage Development; Component: Tools
+Product: Portage Development; Component: Tools, Assignee:
+portage-ut...@gentoo.org
 .SH AUTHORS
 .nf
 Ned Ludd 



[gentoo-commits] proj/portage-utils:master commit in: man/, man/include/

2018-04-03 Thread Fabian Groffen
commit: f24b626027dceb5890b134837c6683f4593f6ce0
Author: Fabian Groffen  gentoo  org>
AuthorDate: Tue Apr  3 12:15:35 2018 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Tue Apr  3 12:15:35 2018 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=f24b6260

qmerge: improve documentation

Bug: https://bugs.gentoo.org/645554

 man/include/qmerge.desc |  6 ++
 man/qmerge.1| 43 +--
 2 files changed, 31 insertions(+), 18 deletions(-)

diff --git a/man/include/qmerge.desc b/man/include/qmerge.desc
new file mode 100644
index 000..08589ec
--- /dev/null
+++ b/man/include/qmerge.desc
@@ -0,0 +1,6 @@
+\fIqmerge\fR retrieves and installs Gentoo binary packages.  Simple
+dependency checking is performed, after which \fIqmerge\fR just unpacks
+the binpkg onto the filesystem and registers the package in the VDB.
+
+Retrieval of packages from a remote binhost is currently performed using
+\fBwget\fR(1).  More specifically, \fIFETCHCOMMAND\fR is ignored.

diff --git a/man/qmerge.1 b/man/qmerge.1
index f3d80db..f66908e 100644
--- a/man/qmerge.1
+++ b/man/qmerge.1
@@ -1,65 +1,72 @@
-.TH qmerge "1" "Mar 2016" "Gentoo Foundation" "qmerge"
+.\" generated by mkman.py, please do NOT edit!
+.TH qmerge "1" "Apr 2018" "Gentoo Foundation" "qmerge"
 .SH NAME
 qmerge \- fetch and merge binary package
 .SH SYNOPSIS
 .B qmerge
 \fI[opts] \fR
 .SH DESCRIPTION
+\fIqmerge\fR retrieves and installs Gentoo binary packages.  Simple
+dependency checking is performed, after which \fIqmerge\fR just unpacks
+the binpkg onto the filesystem and registers the package in the VDB.
 
+Retrieval of packages from a remote binhost is currently performed using
+\fBwget\fR(1).  More specifically, \fIFETCHCOMMAND\fR is ignored.
 .SH OPTIONS
 .TP
 \fB\-f\fR, \fB\-\-fetch\fR
-Fetch package and newest Packages metadata
+Fetch package and newest Packages metadata.
 .TP
 \fB\-F\fR, \fB\-\-force\fR
-Fetch package (skipping Packages)
+Fetch package (skipping Packages).
 .TP
 \fB\-s\fR, \fB\-\-search\fR
-Search available packages
+Search available packages.
 .TP
 \fB\-K\fR, \fB\-\-install\fR
-Install package
+Install package.
 .TP
 \fB\-U\fR, \fB\-\-unmerge\fR
-Uninstall package
+Uninstall package.
 .TP
 \fB\-p\fR, \fB\-\-pretend\fR
-Pretend only
+Pretend only.
 .TP
 \fB\-u\fR, \fB\-\-update\fR
-Update only
+Update only.
 .TP
 \fB\-y\fR, \fB\-\-yes\fR
-Don't prompt before overwriting
+Don't prompt before overwriting.
 .TP
 \fB\-O\fR, \fB\-\-nodeps\fR
-Don't merge dependencies
+Don't merge dependencies.
 .TP
 \fB\-\-debug\fR
-Run shell funcs with `set -x`
+Run shell funcs with `set -x`.
 .TP
 \fB\-\-root\fR \fI\fR
-Set the ROOT env var
+Set the ROOT env var.
 .TP
 \fB\-v\fR, \fB\-\-verbose\fR
-Make a lot of noise
+Make a lot of noise.
 .TP
 \fB\-q\fR, \fB\-\-quiet\fR
-Tighter output; suppress warnings
+Tighter output; suppress warnings.
 .TP
 \fB\-C\fR, \fB\-\-nocolor\fR
-Don't output color
+Don't output color.
 .TP
 \fB\-h\fR, \fB\-\-help\fR
-Print this help and exit
+Print this help and exit.
 .TP
 \fB\-V\fR, \fB\-\-version\fR
-Print version and exit
+Print version and exit.
 
 .SH "REPORTING BUGS"
 Please report bugs via http://bugs.gentoo.org/
 .br
-Product: Portage Development; Component: Tools
+Product: Portage Development; Component: Tools, Assignee:
+portage-ut...@gentoo.org
 .SH AUTHORS
 .nf
 Ned Ludd 



[gentoo-commits] proj/portage-utils:master commit in: man/, man/include/

2018-04-03 Thread Fabian Groffen
commit: 23b810c84c02a29f3b2766cf0fd005c53e668816
Author: Fabian Groffen  gentoo  org>
AuthorDate: Tue Apr  3 13:51:42 2018 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Tue Apr  3 13:51:42 2018 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=23b810c8

qtbz2: improve documentation

Bug: https://bugs.gentoo.org/645554

 man/include/qsize.desc |  3 +++
 man/include/qsize.optdesc.yaml |  5 +
 man/include/qtbz2.desc |  2 ++
 man/include/qtbz2.optdesc.yaml |  2 ++
 man/qtbz2.1| 33 ++---
 5 files changed, 30 insertions(+), 15 deletions(-)

diff --git a/man/include/qsize.desc b/man/include/qsize.desc
new file mode 100644
index 000..e4edce0
--- /dev/null
+++ b/man/include/qsize.desc
@@ -0,0 +1,3 @@
+\fIqsize\fR calculates the storage size taken by an installed package.
+The reported sizes can be the recorded exact sizes of all files, or the
+storage space they consume given the underlying filesystem.

diff --git a/man/include/qsize.optdesc.yaml b/man/include/qsize.optdesc.yaml
new file mode 100644
index 000..8dd58e4
--- /dev/null
+++ b/man/include/qsize.optdesc.yaml
@@ -0,0 +1,5 @@
+ignore: |
+Filter out entries matching \fI\fR, which is a regular
+expression, before calculating size.
+verbose: Ignored for compatibility with other qapplets.
+quiet: Ignored for compatibility with other qapplets.

diff --git a/man/include/qtbz2.desc b/man/include/qtbz2.desc
new file mode 100644
index 000..2ba37db
--- /dev/null
+++ b/man/include/qtbz2.desc
@@ -0,0 +1,2 @@
+\fIqtbz2\fR joins and splits combined xpak+tarbz2 files.  Gentoo binary
+packages are such combined files.

diff --git a/man/include/qtbz2.optdesc.yaml b/man/include/qtbz2.optdesc.yaml
new file mode 100644
index 000..c1ebcd1
--- /dev/null
+++ b/man/include/qtbz2.optdesc.yaml
@@ -0,0 +1,2 @@
+verbose: Print some files and sizes while joining and splitting.
+quiet: Ignored for compatibility with other qapplets.

diff --git a/man/qtbz2.1 b/man/qtbz2.1
index b22c70c..94db0d8 100644
--- a/man/qtbz2.1
+++ b/man/qtbz2.1
@@ -1,53 +1,56 @@
-.TH qtbz2 "1" "Mar 2016" "Gentoo Foundation" "qtbz2"
+.\" generated by mkman.py, please do NOT edit!
+.TH qtbz2 "1" "Apr 2018" "Gentoo Foundation" "qtbz2"
 .SH NAME
 qtbz2 \- manipulate tbz2 packages
 .SH SYNOPSIS
 .B qtbz2
 \fI[opts] \fR
 .SH DESCRIPTION
-
+\fIqtbz2\fR joins and splits combined xpak+tarbz2 files.  Gentoo binary
+packages are such combined files.
 .SH OPTIONS
 .TP
 \fB\-d\fR \fI\fR, \fB\-\-dir\fR \fI\fR
-Change to specified directory
+Change to specified directory.
 .TP
 \fB\-j\fR, \fB\-\-join\fR
-Join:   
+Join:   .
 .TP
 \fB\-s\fR, \fB\-\-split\fR
-Split a tbz2 into a tar.bz2 + xpak
+Split a tbz2 into a tar.bz2 + xpak.
 .TP
 \fB\-t\fR, \fB\-\-tarbz2\fR
-Just split the tar.bz2
+Just split the tar.bz2.
 .TP
 \fB\-x\fR, \fB\-\-xpak\fR
-Just split the xpak
+Just split the xpak.
 .TP
 \fB\-O\fR, \fB\-\-stdout\fR
-Write files to stdout
+Write files to stdout.
 .TP
 \fB\-\-root\fR \fI\fR
-Set the ROOT env var
+Set the ROOT env var.
 .TP
 \fB\-v\fR, \fB\-\-verbose\fR
-Make a lot of noise
+Print some files and sizes while joining and splitting.
 .TP
 \fB\-q\fR, \fB\-\-quiet\fR
-Tighter output; suppress warnings
+Ignored for compatibility with other qapplets.
 .TP
 \fB\-C\fR, \fB\-\-nocolor\fR
-Don't output color
+Don't output color.
 .TP
 \fB\-h\fR, \fB\-\-help\fR
-Print this help and exit
+Print this help and exit.
 .TP
 \fB\-V\fR, \fB\-\-version\fR
-Print version and exit
+Print version and exit.
 
 .SH "REPORTING BUGS"
 Please report bugs via http://bugs.gentoo.org/
 .br
-Product: Portage Development; Component: Tools
+Product: Portage Development; Component: Tools, Assignee:
+portage-ut...@gentoo.org
 .SH AUTHORS
 .nf
 Ned Ludd 



[gentoo-commits] proj/portage-utils:master commit in: man/, man/include/, /

2018-04-12 Thread Fabian Groffen
commit: 33d4e18b26cd37691a81584da0efd929097a22b3
Author: Fabian Groffen  gentoo  org>
AuthorDate: Thu Apr 12 19:14:19 2018 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Thu Apr 12 19:14:19 2018 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=33d4e18b

qlop: don't rely on %F for data parsing for portability

While at it document the date formats in the man-page.

 man/include/qlop.optdesc.yaml | 16 
 man/qlop.1| 16 +++-
 qlop.c|  6 +++---
 3 files changed, 34 insertions(+), 4 deletions(-)

diff --git a/man/include/qlop.optdesc.yaml b/man/include/qlop.optdesc.yaml
index 7864d6e..fad1670 100644
--- a/man/include/qlop.optdesc.yaml
+++ b/man/include/qlop.optdesc.yaml
@@ -1,3 +1,19 @@
+date: |
+Limit the selection of packages to the date given, or to the range
+of dates if this argument is given twice.  The \fB--date\fR option
+can take a few forms.
+.RS
+.IP "NUMBER [s] [ago]"
+Relative time, specifying \fINUMBER\fR \fIdays\fR, \fIweeks\fR,
+\fImonths\fR or \fIyears\fR, for example \fI3 days ago\fR.
+.IP -MM-DD
+Big-endian date, with components separated by hyphens, starting with
+year, followed by month and day of month.
+.IP S
+Seconds since 1970-01-01 00:00:00 + (UTC), the UNIX epoch.
+.IP FORMAT|DATE
+Use \fIFORMAT\fR as input for \fBstrptime\fR(3) to parse \fIDATE\fR.
+.RE
 gauge: |
 Gauge number of times a package has been merged.  This shows the
 merge time for each individual merge of package.

diff --git a/man/qlop.1 b/man/qlop.1
index c138054..9c449a9 100644
--- a/man/qlop.1
+++ b/man/qlop.1
@@ -39,7 +39,21 @@ Show current emerging packages.  This relies on
 in order to detect running merges.
 .TP
 \fB\-d\fR \fI\fR, \fB\-\-date\fR \fI\fR
-Limit selection to this time (1st -d is start, 2nd -d is end).
+Limit the selection of packages to the date given, or to the range
+of dates if this argument is given twice.  The \fB--date\fR option
+can take a few forms.
+.RS
+.IP "NUMBER [s] [ago]"
+Relative time, specifying \fINUMBER\fR \fIdays\fR, \fIweeks\fR,
+\fImonths\fR or \fIyears\fR, for example \fI3 days ago\fR.
+.IP -MM-DD
+Big-endian date, with components separated by hyphens, starting with
+year, followed by month and day of month.
+.IP S
+Seconds since 1970-01-01 00:00:00 + (UTC), the UNIX epoch.
+.IP FORMAT|DATE
+Use \fIFORMAT\fR as input for \fBstrptime\fR(3) to parse \fIDATE\fR.
+.RE
 .TP
 \fB\-f\fR \fI\fR, \fB\-\-logfile\fR \fI\fR
 Read emerge logfile instead of $EMERGE_LOG_DIR/emerge.log.

diff --git a/qlop.c b/qlop.c
index 67669ef..1d4e0d9 100644
--- a/qlop.c
+++ b/qlop.c
@@ -39,7 +39,7 @@ static const char qlop_desc[] =
"The --date option can take a few forms:\n"
"  -d '# [s] [ago]'  (e.g. '3 days ago')\n"
"Or using strptime(3) formats:\n"
-   "  -d '2015-12-25'   (detected as %F)\n"
+   "  -d '2015-12-25'   (detected as %Y-%m-%d)\n"
"  -d '1459101740'   (detected as %s)\n"
"  -d '%d.%m.%Y|25.12.2015'  (format is specified)";
 #define qlop_usage(ret) usage(ret, QLOP_FLAGS, qlop_long_opts, qlop_opts_help, 
qlop_desc, lookup_applet_idx("qlop"))
@@ -733,7 +733,7 @@ parse_date(const char *sdate, time_t *t)
} else {
/* Handle automatic formats:
 * - "12315128"   -> %s
-* - "2015-12-24" -> %F (same as %Y-%m-%d
+* - "2015-12-24" -> %Y-%m-%d
 * - human readable format (see below)
 */
size_t len = strspn(sdate, "0123456789-");
@@ -742,7 +742,7 @@ parse_date(const char *sdate, time_t *t)
if (strchr(sdate, '-') == NULL)
fmt = "%s";
else
-   fmt = "%F";
+   fmt = "%Y-%m-%d";
 
s = strptime(sdate, fmt, &tm);
if (s == NULL || s[0] != '\0')



[gentoo-commits] proj/portage-utils:master commit in: man/, man/include/, /

2019-02-05 Thread Fabian Groffen
commit: 5674671e9d7e0e1251561d81a1154dd5d92e60ec
Author: Fabian Groffen  gentoo  org>
AuthorDate: Tue Feb  5 13:47:59 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Tue Feb  5 13:50:23 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=5674671e

qdepends: add support for BDEPEND

Bug: https://bugs.gentoo.org/674936
Signed-off-by: Fabian Groffen  gentoo.org>

 man/include/qdepends.optdesc.yaml |  8 
 man/qdepends.1| 13 -
 qdepends.c| 15 ---
 3 files changed, 24 insertions(+), 12 deletions(-)

diff --git a/man/include/qdepends.optdesc.yaml 
b/man/include/qdepends.optdesc.yaml
index 51b1cc7..5d786f3 100644
--- a/man/include/qdepends.optdesc.yaml
+++ b/man/include/qdepends.optdesc.yaml
@@ -1,13 +1,13 @@
 all: |
-Show *DEPEND, alias for \fB\-drp\fR.
+Show *DEPEND, alias for \fB\-drpb\fR.
 key: |
 Advanced option to allow querying the VDB.  This option overrides
-\fB\-d\fR, \fB\-r\fR, \fB\-p\fR or \fB\-a\fR.  \fI\fR can be
-any key from Portage's VDB, e.g.\ any file from
+\fB\-d\fR, \fB\-r\fR, \fB\-p\fR, \fB\-b\fR or \fB\-a\fR.
+\fI\fR can be any key from Portage's VDB, e.g.\ any file from
 var/db/pkg///.
 query: |
 Query reverse deps.  This basically reverses the search to any
-package that references \fI\fR in DEPEND, RDEPEND or PDEPEND.
+package that references \fI\fR in DEPEND, RDEPEND, PDEPEND or BDEPEND.
 This can be useful to find consumers of a given package, e.g.\ to
 search for packages that have \fIlogwatch\fR in their DEPEND.
 name-only: |

diff --git a/man/qdepends.1 b/man/qdepends.1
index 2e1aab2..0273999 100644
--- a/man/qdepends.1
+++ b/man/qdepends.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qdepends "1" "May 2018" "Gentoo Foundation" "qdepends"
+.TH qdepends "1" "Feb 2019" "Gentoo Foundation" "qdepends"
 .SH NAME
 qdepends \- show dependency info
 .SH SYNOPSIS
@@ -32,15 +32,18 @@ Show RDEPEND info.
 \fB\-p\fR, \fB\-\-pdepend\fR
 Show PDEPEND info.
 .TP
+\fB\-b\fR, \fB\-\-bdepend\fR
+Show BDEPEND info.
+.TP
 \fB\-k\fR \fI\fR, \fB\-\-key\fR \fI\fR
 Advanced option to allow querying the VDB.  This option overrides
-\fB\-d\fR, \fB\-r\fR, \fB\-p\fR or \fB\-a\fR.  \fI\fR can be
-any key from Portage's VDB, e.g.\ any file from
+\fB\-d\fR, \fB\-r\fR, \fB\-p\fR, \fB\-b\fR or \fB\-a\fR.
+\fI\fR can be any key from Portage's VDB, e.g.\ any file from
 var/db/pkg///.
 .TP
 \fB\-Q\fR \fI\fR, \fB\-\-query\fR \fI\fR
 Query reverse deps.  This basically reverses the search to any
-package that references \fI\fR in DEPEND, RDEPEND or PDEPEND.
+package that references \fI\fR in DEPEND, RDEPEND, PDEPEND or BDEPEND.
 This can be useful to find consumers of a given package, e.g.\ to
 search for packages that have \fIlogwatch\fR in their DEPEND.
 .TP
@@ -48,7 +51,7 @@ search for packages that have \fIlogwatch\fR in their DEPEND.
 Only show category/package, instead of category/package-version.
 .TP
 \fB\-a\fR, \fB\-\-all\fR
-Show *DEPEND, alias for \fB\-drp\fR.
+Show *DEPEND, alias for \fB\-drpb\fR.
 .TP
 \fB\-f\fR, \fB\-\-format\fR
 Pretty-print DEPEND declaration to be used in an ebuild.  This

diff --git a/qdepends.c b/qdepends.c
index e6b9bcf..92ae57b 100644
--- a/qdepends.c
+++ b/qdepends.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005-2018 Gentoo Authors
+ * Copyright 2005-2019 Gentoo Authors
  * Distributed under the terms of the GNU General Public License v2
  *
  * Copyright 2005-2010 Ned Ludd- 
@@ -9,11 +9,12 @@
 
 #ifdef APPLET_qdepends
 
-#define QDEPENDS_FLAGS "drpafNk:Q:" COMMON_FLAGS
+#define QDEPENDS_FLAGS "drpbafNk:Q:" COMMON_FLAGS
 static struct option const qdepends_long_opts[] = {
{"depend",no_argument, NULL, 'd'},
{"rdepend",   no_argument, NULL, 'r'},
{"pdepend",   no_argument, NULL, 'p'},
+   {"bdepend",   no_argument, NULL, 'b'},
{"key",a_argument, NULL, 'k'},
{"query",  a_argument, NULL, 'Q'},
{"name-only", no_argument, NULL, 'N'},
@@ -25,6 +26,7 @@ static const char * const qdepends_opts_help[] = {
"Show DEPEND info (default)",
"Show RDEPEND info",
"Show PDEPEND info",
+   "Show BDEPEND info",
"User defined vdb key",
"Query reverse deps",
"Only show package name",
@@ -639,7 +641,13 @@ int qdepends_main(int argc, char **argv)
bool do_format = false;
const char *query = NULL;
const char *depend_file;
-   const char *depend_files[] = { "DEPEND", "RDEPEND", "PDEPEND", NULL, 
NULL };
+   const char *depend_files[] = {
+   /* 0 */ "DEPEND",
+   /* 1 */ "RDEPEND",
+   /* 2 */ "PDEPEND",
+   /* 3 */ "BDEPEND",
+   /* 4 */ NULL
+   };
 
depend_file = depend_files[0];
 
@@ -650,6 +658,7 @@ int qdepends_main(int argc, char **argv)
case 'd': depend_file = dep

[gentoo-commits] proj/portage-utils:master commit in: man/, /, man/include/

2019-03-07 Thread Fabian Groffen
commit: 9ae56f85211d2c7c00b77b836e797339fc76f9b8
Author: Fabian Groffen  gentoo  org>
AuthorDate: Thu Mar  7 18:18:47 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Thu Mar  7 18:18:47 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=9ae56f85

qlist: change -U to display disabled flags with -v

reimplement umapstr() to allow printing flags not enabled, this is
slightly related to bug #656550.

Signed-off-by: Fabian Groffen  gentoo.org>

 man/include/qlist.optdesc.yaml |   2 +-
 man/qlist.1|   4 +-
 qlist.c| 183 ++---
 3 files changed, 119 insertions(+), 70 deletions(-)

diff --git a/man/include/qlist.optdesc.yaml b/man/include/qlist.optdesc.yaml
index a60ef0d..2b9299c 100644
--- a/man/include/qlist.optdesc.yaml
+++ b/man/include/qlist.optdesc.yaml
@@ -19,6 +19,6 @@ verbose: |
 When listing the package contents, a single \fB\-v\fR displays
 symlinks with an arrow (\->) to their target.  Two or more \fB\-v\fR
 adds colour to the entries and prints like \fB\-I\fR before the
-listing.
+listing.  Shows disabled USE-flags when used with \fB\-U\fR.
 quiet: |
 Suppresses the parenthesis around the USE-flags when used with \fB\-U\fR.

diff --git a/man/qlist.1 b/man/qlist.1
index c2c585c..4df7dab 100644
--- a/man/qlist.1
+++ b/man/qlist.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qlist "1" "Feb 2019" "Gentoo Foundation" "qlist"
+.TH qlist "1" "Mar 2019" "Gentoo Foundation" "qlist"
 .SH NAME
 qlist \- list files owned by pkgname
 .SH SYNOPSIS
@@ -60,7 +60,7 @@ When used with \fB\-I\fR, print the package version next to 
name.
 When listing the package contents, a single \fB\-v\fR displays
 symlinks with an arrow (\->) to their target.  Two or more \fB\-v\fR
 adds colour to the entries and prints like \fB\-I\fR before the
-listing.
+listing.  Shows disabled USE-flags when used with \fB\-U\fR.
 .TP
 \fB\-q\fR, \fB\-\-quiet\fR
 Suppresses the parenthesis around the USE-flags when used with \fB\-U\fR.

diff --git a/qlist.c b/qlist.c
index 4a3b95a..3ca3f5e 100644
--- a/qlist.c
+++ b/qlist.c
@@ -43,84 +43,124 @@ static const char * const qlist_opts_help[] = {
 };
 #define qlist_usage(ret) usage(ret, QLIST_FLAGS, qlist_long_opts, 
qlist_opts_help, NULL, lookup_applet_idx("qlist"))
 
-static char *
-grab_pkg_umap(q_vdb_pkg_ctx *pkg_ctx)
+static int
+cmpstringp(const void *p1, const void *p2)
+{
+   /* case insensitive comparator */
+   return strcasecmp(*((char * const *)p1), *((char * const *)p2));
+}
+
+/*
+ * ==> /var/db/pkg/mail-mta/exim-4.92/IUSE <==
+ * arc dane dcc +dkim dlfunc dmarc +dnsdb doc dovecot-sasl dsn
+ * elibc_glibc exiscan-acl gnutls idn ipv6 ldap libressl lmtp maildir
+ * mbx mysql nis pam perl pkcs11 postgres +prdr proxy radius redis sasl
+ * selinux spf sqlite srs ssl syslog tcpd +tpda X
+ *
+ * ==> /var/db/pkg/mail-mta/exim-4.92/PKGUSE <==
+ * -X dkim dmarc exiscan-acl ipv6 -ldap lmtp maildir -mbox pam -perl spf
+ * ssl tcpd
+ *
+ * ==> /var/db/pkg/mail-mta/exim-4.92/USE <==
+ * abi_x86_64 amd64 dkim dmarc dnsdb elibc_glibc exiscan-acl ipv6
+ * kernel_linux lmtp maildir pam prdr spf ssl tcpd tpda userland_GNU
+ *
+ * % emerge -pv exim
+ *
+ * These are the packages that would be merged, in order:
+ *
+ * Calculating dependencies... done!
+ * [ebuild   R   ~] mail-mta/exim-4.92::gentoo  USE="dkim dmarc dnsdb
+ * exiscan-acl ipv6 lmtp maildir pam prdr spf ssl tcpd tpda -X -arc
+ * -dane -dcc -dlfunc -doc -dovecot-sasl -dsn -gnutls -idn -ldap
+ * -libressl -mbx -mysql -nis -perl -pkcs11 -postgres -proxy -radius
+ * -redis -sasl (-selinux) -sqlite -srs -syslog" 0 KiB
+ *
+ * % qlist -IUv exim
+ * mail-mta/exim-4.92 (-arc -dane -dcc dkim -dlfunc dmarc dnsdb -doc
+ * -dovecot-sasl -dsn exiscan-acl -gnutls -idn ipv6 -ldap -libressl lmtp
+ * maildir -mbx -mysql -nis pam -perl -pkcs11 -postgres prdr -proxy
+ * -radius -redis -sasl -selinux spf -sqlite -srs ssl -syslog tcpd tpda
+ * -X)
+ */
+static char _umapstr_buf[BUFSIZ];
+static const char *
+umapstr(char display, q_vdb_pkg_ctx *pkg_ctx)
 {
-   static char umap[BUFSIZ];
-   static char *use, *iuse;
-   static size_t use_len, iuse_len;
-   int use_argc = 0, iuse_argc = 0;
-   char **use_argv = NULL, **iuse_argv = NULL;
-   queue *ll = NULL;
-   queue *sets = NULL;
-   int i, u;
+   char *bufp = _umapstr_buf;
+   char *use = NULL;
+   char *iuse = NULL;
+   size_t use_len;
+   size_t iuse_len;
+   int use_argc = 0;
+   int iuse_argc = 0;
+   char **use_argv = NULL;
+   char **iuse_argv = NULL;
+   int i;
+   int u;
+   int d;
+
+   *bufp = '\0';
+   if (!display)
+   return bufp;
 
q_vdb_pkg_eat(pkg_ctx, "USE", &use, &use_len);
if (!use[0])
-   return NULL;
+   return bufp;
q_vdb_pkg_eat(pkg_ctx, "IUSE", &iuse, &iuse_le

[gentoo-commits] proj/portage-utils:master commit in: man/, man/include/, /

2019-02-05 Thread Fabian Groffen
commit: 5674671e9d7e0e1251561d81a1154dd5d92e60ec
Author: Fabian Groffen  gentoo  org>
AuthorDate: Tue Feb  5 13:47:59 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Tue Feb  5 13:50:23 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=5674671e

qdepends: add support for BDEPEND

Bug: https://bugs.gentoo.org/674936
Signed-off-by: Fabian Groffen  gentoo.org>

 man/include/qdepends.optdesc.yaml |  8 
 man/qdepends.1| 13 -
 qdepends.c| 15 ---
 3 files changed, 24 insertions(+), 12 deletions(-)

diff --git a/man/include/qdepends.optdesc.yaml 
b/man/include/qdepends.optdesc.yaml
index 51b1cc7..5d786f3 100644
--- a/man/include/qdepends.optdesc.yaml
+++ b/man/include/qdepends.optdesc.yaml
@@ -1,13 +1,13 @@
 all: |
-Show *DEPEND, alias for \fB\-drp\fR.
+Show *DEPEND, alias for \fB\-drpb\fR.
 key: |
 Advanced option to allow querying the VDB.  This option overrides
-\fB\-d\fR, \fB\-r\fR, \fB\-p\fR or \fB\-a\fR.  \fI\fR can be
-any key from Portage's VDB, e.g.\ any file from
+\fB\-d\fR, \fB\-r\fR, \fB\-p\fR, \fB\-b\fR or \fB\-a\fR.
+\fI\fR can be any key from Portage's VDB, e.g.\ any file from
 var/db/pkg///.
 query: |
 Query reverse deps.  This basically reverses the search to any
-package that references \fI\fR in DEPEND, RDEPEND or PDEPEND.
+package that references \fI\fR in DEPEND, RDEPEND, PDEPEND or BDEPEND.
 This can be useful to find consumers of a given package, e.g.\ to
 search for packages that have \fIlogwatch\fR in their DEPEND.
 name-only: |

diff --git a/man/qdepends.1 b/man/qdepends.1
index 2e1aab2..0273999 100644
--- a/man/qdepends.1
+++ b/man/qdepends.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qdepends "1" "May 2018" "Gentoo Foundation" "qdepends"
+.TH qdepends "1" "Feb 2019" "Gentoo Foundation" "qdepends"
 .SH NAME
 qdepends \- show dependency info
 .SH SYNOPSIS
@@ -32,15 +32,18 @@ Show RDEPEND info.
 \fB\-p\fR, \fB\-\-pdepend\fR
 Show PDEPEND info.
 .TP
+\fB\-b\fR, \fB\-\-bdepend\fR
+Show BDEPEND info.
+.TP
 \fB\-k\fR \fI\fR, \fB\-\-key\fR \fI\fR
 Advanced option to allow querying the VDB.  This option overrides
-\fB\-d\fR, \fB\-r\fR, \fB\-p\fR or \fB\-a\fR.  \fI\fR can be
-any key from Portage's VDB, e.g.\ any file from
+\fB\-d\fR, \fB\-r\fR, \fB\-p\fR, \fB\-b\fR or \fB\-a\fR.
+\fI\fR can be any key from Portage's VDB, e.g.\ any file from
 var/db/pkg///.
 .TP
 \fB\-Q\fR \fI\fR, \fB\-\-query\fR \fI\fR
 Query reverse deps.  This basically reverses the search to any
-package that references \fI\fR in DEPEND, RDEPEND or PDEPEND.
+package that references \fI\fR in DEPEND, RDEPEND, PDEPEND or BDEPEND.
 This can be useful to find consumers of a given package, e.g.\ to
 search for packages that have \fIlogwatch\fR in their DEPEND.
 .TP
@@ -48,7 +51,7 @@ search for packages that have \fIlogwatch\fR in their DEPEND.
 Only show category/package, instead of category/package-version.
 .TP
 \fB\-a\fR, \fB\-\-all\fR
-Show *DEPEND, alias for \fB\-drp\fR.
+Show *DEPEND, alias for \fB\-drpb\fR.
 .TP
 \fB\-f\fR, \fB\-\-format\fR
 Pretty-print DEPEND declaration to be used in an ebuild.  This

diff --git a/qdepends.c b/qdepends.c
index e6b9bcf..92ae57b 100644
--- a/qdepends.c
+++ b/qdepends.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005-2018 Gentoo Authors
+ * Copyright 2005-2019 Gentoo Authors
  * Distributed under the terms of the GNU General Public License v2
  *
  * Copyright 2005-2010 Ned Ludd- 
@@ -9,11 +9,12 @@
 
 #ifdef APPLET_qdepends
 
-#define QDEPENDS_FLAGS "drpafNk:Q:" COMMON_FLAGS
+#define QDEPENDS_FLAGS "drpbafNk:Q:" COMMON_FLAGS
 static struct option const qdepends_long_opts[] = {
{"depend",no_argument, NULL, 'd'},
{"rdepend",   no_argument, NULL, 'r'},
{"pdepend",   no_argument, NULL, 'p'},
+   {"bdepend",   no_argument, NULL, 'b'},
{"key",a_argument, NULL, 'k'},
{"query",  a_argument, NULL, 'Q'},
{"name-only", no_argument, NULL, 'N'},
@@ -25,6 +26,7 @@ static const char * const qdepends_opts_help[] = {
"Show DEPEND info (default)",
"Show RDEPEND info",
"Show PDEPEND info",
+   "Show BDEPEND info",
"User defined vdb key",
"Query reverse deps",
"Only show package name",
@@ -639,7 +641,13 @@ int qdepends_main(int argc, char **argv)
bool do_format = false;
const char *query = NULL;
const char *depend_file;
-   const char *depend_files[] = { "DEPEND", "RDEPEND", "PDEPEND", NULL, 
NULL };
+   const char *depend_files[] = {
+   /* 0 */ "DEPEND",
+   /* 1 */ "RDEPEND",
+   /* 2 */ "PDEPEND",
+   /* 3 */ "BDEPEND",
+   /* 4 */ NULL
+   };
 
depend_file = depend_files[0];
 
@@ -650,6 +658,7 @@ int qdepends_main(int argc, char **argv)
case 'd': depend_file = dep

[gentoo-commits] proj/portage-utils:master commit in: man/, /, man/include/

2019-03-29 Thread Fabian Groffen
commit: c701892114d5b3eea773ff13f013f4d3a71fa571
Author: Fabian Groffen  gentoo  org>
AuthorDate: Fri Mar 29 16:31:50 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Fri Mar 29 16:31:50 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=c7018921

qlop: support standard date output format in parse_date

This allows to cut 'n' paste dates to limit output.

Signed-off-by: Fabian Groffen  gentoo.org>

 man/include/qlop.optdesc.yaml |  3 +++
 man/qlop.1|  5 -
 qlop.c| 14 +-
 3 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/man/include/qlop.optdesc.yaml b/man/include/qlop.optdesc.yaml
index a8fae61..25143b2 100644
--- a/man/include/qlop.optdesc.yaml
+++ b/man/include/qlop.optdesc.yaml
@@ -13,6 +13,9 @@ date: |
 .IP -MM-DD
 Big-endian date, with components separated by hyphens, starting with
 year, followed by month and day of month.
+.IP -MM-DDThh:mm:ss
+As before, but hours, minutes and seconds added.  This is the same
+format qlop prints for timestamps.
 .IP S
 Seconds since 1970-01-01 00:00:00 + (UTC), the UNIX epoch.
 .IP FORMAT|DATE

diff --git a/man/qlop.1 b/man/qlop.1
index 407c9ea..f0ef69a 100644
--- a/man/qlop.1
+++ b/man/qlop.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qlop "1" "Feb 2019" "Gentoo Foundation" "qlop"
+.TH qlop "1" "Mar 2019" "Gentoo Foundation" "qlop"
 .SH NAME
 qlop \- emerge log analyzer
 .SH SYNOPSIS
@@ -89,6 +89,9 @@ Alias for \fI1 day ago\fR.
 .IP -MM-DD
 Big-endian date, with components separated by hyphens, starting with
 year, followed by month and day of month.
+.IP -MM-DDThh:mm:ss
+As before, but hours, minutes and seconds added.  This is the same
+format qlop prints for timestamps.
 .IP S
 Seconds since 1970-01-01 00:00:00 + (UTC), the UNIX epoch.
 .IP FORMAT|DATE

diff --git a/qlop.c b/qlop.c
index b6970d0..a87cc5c 100644
--- a/qlop.c
+++ b/qlop.c
@@ -103,17 +103,21 @@ parse_date(const char *sdate, time_t *t)
return false;
} else {
/* Handle automatic formats:
-* - "12315128"   -> %s
-* - "2015-12-24" -> %Y-%m-%d
+* - "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-");
+   size_t len = strspn(sdate, "0123456789-:T");
if (sdate[len] == '\0') {
const char *fmt;
-   if (strchr(sdate, '-') == NULL)
+   if (strchr(sdate, '-') == NULL) {
fmt = "%s";
-   else
+   } else if ((s = strchr(sdate, 'T')) == NULL) {
fmt = "%Y-%m-%d";
+   } else {
+   fmt = "%Y-%m-%dT%H:%M:%S";
+   }
 
s = strptime(sdate, fmt, &tm);
if (s == NULL || s[0] != '\0')



[gentoo-commits] proj/portage-utils:master commit in: man/, man/include/

2018-04-01 Thread Fabian Groffen
commit: b10334e70c272bb554228acea075011925f260fb
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sun Apr  1 12:44:30 2018 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sun Apr  1 12:44:30 2018 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=b10334e7

man/qlop: regen manpage

commit fe42f2a99297fed36720e71ba2ed77cf7a9da804 changed the generated
file, this commit ensures that future regenerate operations don't lose
the changes

 man/include/qlop.desc |  4 
 man/include/qlop.optdesc.yaml | 15 +++
 man/qlop.1| 26 +++---
 3 files changed, 34 insertions(+), 11 deletions(-)

diff --git a/man/include/qlop.desc b/man/include/qlop.desc
new file mode 100644
index 000..d99cc94
--- /dev/null
+++ b/man/include/qlop.desc
@@ -0,0 +1,4 @@
+.I qlop
+reads from $EMERGE_LOG_DIR/emerge.log and tries to extract
+information about merges, unmerges and syncs.  For packages, it can
+calculate average merge times or just list them.

diff --git a/man/include/qlop.optdesc.yaml b/man/include/qlop.optdesc.yaml
new file mode 100644
index 000..7864d6e
--- /dev/null
+++ b/man/include/qlop.optdesc.yaml
@@ -0,0 +1,15 @@
+gauge: |
+Gauge number of times a package has been merged.  This shows the
+merge time for each individual merge of package.
+time: |
+Calculate merge time for a specific package.  This is the average
+time for all merges of package.
+human: |
+Print seconds in human readable format (needs \fB\-t\fR), using
+minutes, hours and days instead of just seconds.
+current: |
+Show current emerging packages.  This relies on
+.I FEATURES=sandbox
+in order to detect running merges.
+verbose: |
+Print package versions and revisions.

diff --git a/man/qlop.1 b/man/qlop.1
index 70fb411..c138054 100644
--- a/man/qlop.1
+++ b/man/qlop.1
@@ -1,26 +1,28 @@
-.TH qlop "1" "Mar 2018" "Gentoo Foundation" "qlop"
+.\" generated by mkman.py, please do NOT edit!
+.TH qlop "1" "Apr 2018" "Gentoo Foundation" "qlop"
 .SH NAME
 qlop \- emerge log analyzer
 .SH SYNOPSIS
 .B qlop
 \fI[opts] \fR
 .SH DESCRIPTION
-qlop reads from $EMERGE_LOG_DIR/emerge.log and tries to extract
+.I qlop
+reads from $EMERGE_LOG_DIR/emerge.log and tries to extract
 information about merges, unmerges and syncs.  For packages, it can
 calculate average merge times or just list them.
 .SH OPTIONS
 .TP
 \fB\-g\fR, \fB\-\-gauge\fR
-Gauge number of times a package has been merged.  This shows the merge
-time for each individual merge of package.
+Gauge number of times a package has been merged.  This shows the
+merge time for each individual merge of package.
 .TP
 \fB\-t\fR, \fB\-\-time\fR
-Calculate merge time for a specific package.  This is the average time
-for all merges of package.
+Calculate merge time for a specific package.  This is the average
+time for all merges of package.
 .TP
 \fB\-H\fR, \fB\-\-human\fR
-Print seconds in human readable format (needs -t), using minutes, hours
-and days instead of just seconds.
+Print seconds in human readable format (needs \fB\-t\fR), using
+minutes, hours and days instead of just seconds.
 .TP
 \fB\-l\fR, \fB\-\-list\fR
 Show merge history.
@@ -32,8 +34,9 @@ Show unmerge history.
 Show sync history.
 .TP
 \fB\-c\fR, \fB\-\-current\fR
-Show current emerging packages.  This relies on FEATURES=sandbox in
-order to detect running merges.
+Show current emerging packages.  This relies on
+.I FEATURES=sandbox
+in order to detect running merges.
 .TP
 \fB\-d\fR \fI\fR, \fB\-\-date\fR \fI\fR
 Limit selection to this time (1st -d is start, 2nd -d is end).
@@ -62,7 +65,8 @@ Print version and exit.
 .SH "REPORTING BUGS"
 Please report bugs via http://bugs.gentoo.org/
 .br
-Product: Portage Development; Component: Tools
+Product: Portage Development; Component: Tools, Assignee:
+portage-ut...@gentoo.org
 .SH AUTHORS
 .nf
 Ned Ludd 



[gentoo-commits] proj/portage-utils:master commit in: man/, man/include/

2018-04-01 Thread Fabian Groffen
commit: 3b1cb130c9d20ef0d1190d7b7baf25a910765167
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sun Apr  1 13:47:10 2018 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sun Apr  1 13:47:10 2018 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=3b1cb130

man/qdepends: improve manpage

Bug https://bugs.gentoo.org/645554

 man/include/qdepends-05-examples.include | 17 +++
 man/include/qdepends.desc| 10 +++--
 man/include/qdepends.optdesc.yaml| 29 
 man/qdepends.1   | 77 
 4 files changed, 111 insertions(+), 22 deletions(-)

diff --git a/man/include/qdepends-05-examples.include 
b/man/include/qdepends-05-examples.include
index d4779ea..04fb92f 100644
--- a/man/include/qdepends-05-examples.include
+++ b/man/include/qdepends-05-examples.include
@@ -6,3 +6,20 @@ For finding out what a particular package depends on for 
building, you could do:
 .fi
 This tells us that we have \fIapp-editors/nano-2.3.2\fR installed and it 
depends
 on ncurses (among other things).
+
+Searching for packages that actually have nano in their RDEPEND:
+.nf
+   $ \fIqdepends -rQ nano\fR
+   virtual/editor-0
+.fi
+Tells us that \fIvirtual/editor\fR depends on nano.  However, if we
+wanted to know in what way a package specifically depends on another
+package, one can use \fB\-v\fR.
+.nf
+   $ \fIqdepends -vrQ logrotate\fR
+   sys-apps/portage-2.3.18: >=app-admin/logrotate-3.8.0
+.fi
+This way we can see there is a specific dependency expressed here.  If
+the above had used \fI\fR can be
+any key from Portage's VDB, e.g.\ any file from
+var/db/pkg///.
+query: |
+Query reverse deps.  This basically reverses the search to any
+package that references \fI\fR in DEPEND, RDEPEND or PDEPEND.
+This can be useful to find consumers of a given package, e.g.\ to
+search for packages that have \fIlogwatch\fR in their DEPEND.
+name-only: |
+Only show category/package, instead of category/package-version.
+format: |
+Pretty-print DEPEND declaration to be used in an ebuild.  This
+option initiates a very different mode of operation.  Instead of
+printing searching through packages, it constructs a multi-line
+statement in with shell syntax, to be used in an ebuild.  Each
+argument is turned into a separate DEPEND variable declaration.  You
+need to quote dependency strings in order for them to be printed as
+a single dependency declaration.  When used with the \fB\-q\fR
+option, only the pretty-printed dependency declaration is printed,
+e.g.\ the DEPEND= part is skipped.
+verbose: |
+When in reverse dep mode, print the package or packages that matched
+the query from the dependency line being searched.  This includes
+specifiers and versions.
+quiet: Suppress DEPEND= output for \fB\-f\fR.

diff --git a/man/qdepends.1 b/man/qdepends.1
index a0cac5b..c51a02d 100644
--- a/man/qdepends.1
+++ b/man/qdepends.1
@@ -1,64 +1,85 @@
-.TH qdepends "1" "Mar 2016" "Gentoo Foundation" "qdepends"
+.\" generated by mkman.py, please do NOT edit!
+.TH qdepends "1" "Apr 2018" "Gentoo Foundation" "qdepends"
 .SH NAME
 qdepends \- show dependency info
 .SH SYNOPSIS
 .B qdepends
 \fI[opts] \fR
 .SH DESCRIPTION
-The qdepends applet has a couple different modes.  Normally it is geared 
towards
+The
+.I qdepends
+applet has a couple different modes.  Normally it is geared towards
 answering the queries "what does package X depend on" and "what packages depend
 on X".  Both can further be classified into build, run, and post dependencies.
 
 By default, it will tell you the build time dependencies only (DEPEND).
 
-Currently, qdepends will only query installed packages.  There is no support 
for
-querying packages not yet installed (the \fBequery\fR(1) tool can do that).
+Currently,
+.I qdepends
+will only query installed packages.  There is no support for
+querying packages not yet installed (see \fBequery\fR(1) for that).
 
 If there is no answer to your query (i.e. you've asked for a package that is 
not
 installed, or a version that does not match), then you will get back no output.
 .SH OPTIONS
 .TP
 \fB\-d\fR, \fB\-\-depend\fR
-Show DEPEND info (default)
+Show DEPEND info (default).
 .TP
 \fB\-r\fR, \fB\-\-rdepend\fR
-Show RDEPEND info
+Show RDEPEND info.
 .TP
 \fB\-p\fR, \fB\-\-pdepend\fR
-Show PDEPEND info
+Show PDEPEND info.
 .TP
 \fB\-k\fR \fI\fR, \fB\-\-key\fR \fI\fR
-User defined vdb key
+Advanced option to allow querying the VDB.  This option overrides
+\fB\-d\fR, \fB\-r\fR, \fB\-p\fR or \fB\-a\fR.  \fI\fR can be
+any key from Portage's VDB, e.g.\ any file from
+var/db/pkg///.
 .TP
 \fB\-Q\fR \fI\fR, \fB\-\-query\fR \fI\fR
-Query reverse deps
+Query reverse deps.  This basically reverses the search to any
+package that references \fI\fR in DEPEND, RDEPEND or PDEPEND.
+This can be useful to find consumers of a given package, e.g.\ to

[gentoo-commits] proj/portage-utils:master commit in: man/, man/include/

2018-04-02 Thread Fabian Groffen
commit: 9164549006068637d060a23a9a24f657982bfbaf
Author: Fabian Groffen  gentoo  org>
AuthorDate: Mon Apr  2 17:26:35 2018 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Mon Apr  2 17:26:35 2018 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=91645490

qatom: improve manpage

Bug: https://bugs.gentoo.org/645554

 man/include/qatom.desc | 15 +
 man/include/qatom.optdesc.yaml | 43 
 man/qatom.1| 74 --
 3 files changed, 122 insertions(+), 10 deletions(-)

diff --git a/man/include/qatom.desc b/man/include/qatom.desc
new file mode 100644
index 000..10f0c1c
--- /dev/null
+++ b/man/include/qatom.desc
@@ -0,0 +1,15 @@
+\fIqatom\fR parses strings into atoms and optionally compares them.  The
+parsing into atoms results in CATEGORY, PN (package name), PV (package
+version), PR (package revision), SLOT and REPO.  Next to these version
+qualifiers (e.g.\ >, <, or =) and optional * suffix are extracted.  All
+but PN are optional.
+
+Comparison of atoms returns the relationship between two parsed atoms.
+\fIqatom\fR does not allow to test conditions.  It is possible to
+perform multiple comparisons by simply adding more arguments.
+Comparisons are, however, always performed two by two, so there must be
+an even count of arguments to the compare function.
+
+The \fIqatom\fR applet is a direct wrapper around the atom parsing
+functionalities used by various other applets.  As such this applet
+allows easy testing or atom parsing and comparison behaviour.

diff --git a/man/include/qatom.optdesc.yaml b/man/include/qatom.optdesc.yaml
new file mode 100644
index 000..e71dfb7
--- /dev/null
+++ b/man/include/qatom.optdesc.yaml
@@ -0,0 +1,43 @@
+format: |
+Specify a custom  output  format.  The default format is
+.nf
+%{CATEGORY} %{PN} %{PV} %[PR] %[SLOT] %[pfx] %[sfx]
+.fi
+Conversion specifiers start with a \fI%\fR symbol and are followed
+by either \fI{\fR or \fI[\fR.  Next is the name of the field to
+expand, followed by a matching \fI}\fR or \fI]\fR.  The difference
+between \fI{\fR and \fI[\fR is that the latter is only printed if
+the field referred is set, while the former prints \fI\fR in
+that case.
+
+The following fields are supported, which are inline with the
+variables from \fBebuild\fR(5).
+.RS
+.IP CATEGORY
+The category of the package.
+.IP P
+The package name and version without the ebuild revision.
+.IP PN
+The package name.
+.IP PV
+The package version without the ebuild revision.
+.IP PVR
+The package version including ebuild revision, which is also printed
+when zero, unlike for \fIPF\fR.
+.IP PF
+The package name, version and revision when not zero.  Thus, a zero
+revision \fI\-r0\fR is not printed.
+.IP PR
+The ebuild revision, when force printed, outputs \fI\-r0\fR when unset.
+.IP SLOT
+The package slot, when force printed, outputs \fI\-\fR when unset.
+.IP REPO
+The package repository.
+.IP pfx
+The package prefixes, that is version specifiers.
+.IP sfx
+The package suffices, currently that is just the asterisk.
+.RE
+verbose: Force all expansions, basically treat all \fI[\fR like \fI{\fR.
+quiet: Ignored for compatibility with other qapplets.
+nocolor: Ignored for compatibility with other qapplets.

diff --git a/man/qatom.1 b/man/qatom.1
index 4a30343..aeb9629 100644
--- a/man/qatom.1
+++ b/man/qatom.1
@@ -1,41 +1,95 @@
-.TH qatom "1" "Mar 2016" "Gentoo Foundation" "qatom"
+.\" generated by mkman.py, please do NOT edit!
+.TH qatom "1" "Apr 2018" "Gentoo Foundation" "qatom"
 .SH NAME
 qatom \- split atom strings
 .SH SYNOPSIS
 .B qatom
 \fI[opts] \fR
 .SH DESCRIPTION
+\fIqatom\fR parses strings into atoms and optionally compares them.  The
+parsing into atoms results in CATEGORY, PN (package name), PV (package
+version), PR (package revision), SLOT and REPO.  Next to these version
+qualifiers (e.g.\ >, <, or =) and optional * suffix are extracted.  All
+but PN are optional.
 
+Comparison of atoms returns the relationship between two parsed atoms.
+\fIqatom\fR does not allow to test conditions.  It is possible to
+perform multiple comparisons by simply adding more arguments.
+Comparisons are, however, always performed two by two, so there must be
+an even count of arguments to the compare function.
+
+The \fIqatom\fR applet is a direct wrapper around the atom parsing
+functionalities used by various other applets.  As such this applet
+allows easy testing or atom parsing and comparison behaviour.
 .SH OPTIONS
 .TP
 \fB\-F\fR \fI\fR, \fB\-\-format\fR \fI\fR
-Custom output format (default: %{CATEGORY} %{PN} %{PV} %[PR] %[SLOT] %[pfx] 
%[sfx])
+Specify a custom  output  format.  The default format is
+.nf
+%{CATEGORY} %{PN} %{PV} %[PR] %[SLOT] %[pfx] %[sfx]
+.fi
+Conversion specifiers start with a \fI%

[gentoo-commits] proj/portage-utils:master commit in: man/, man/include/, /

2018-04-03 Thread Fabian Groffen
commit: 1def9d468742c0d6d6b24aa1f1d76243be6e24cd
Author: Fabian Groffen  gentoo  org>
AuthorDate: Tue Apr  3 11:49:41 2018 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Tue Apr  3 11:49:41 2018 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=1def9d46

qlist: improve documentation

Bug: https://bugs.gentoo.org/645554

 man/include/qlist.desc |  6 +
 man/include/qlist.optdesc.yaml | 24 ++
 man/qlist.1| 56 +++---
 qlist.c|  2 +-
 4 files changed, 67 insertions(+), 21 deletions(-)

diff --git a/man/include/qlist.desc b/man/include/qlist.desc
new file mode 100644
index 000..e02d971
--- /dev/null
+++ b/man/include/qlist.desc
@@ -0,0 +1,6 @@
+\fIqlist\fR shows the contents, or a subset thereof, of an installed
+package.  Alternatively, lists whether a package is installed,
+optionally with version, USE-flag, SLOT or REPO information.  The
+\fIpkgname\fR to query for does not have to be an exact match, it may be
+part of it, e.g.\ an entire category, or any package with some string in
+its name.

diff --git a/man/include/qlist.optdesc.yaml b/man/include/qlist.optdesc.yaml
new file mode 100644
index 000..a60ef0d
--- /dev/null
+++ b/man/include/qlist.optdesc.yaml
@@ -0,0 +1,24 @@
+installed: |
+Instead of listing the contents of a package, just print the package
+name if the package is currently installed.
+umap: |
+List USE-flags enabled when the package was installed.  This flag
+implies \fB\-I\fR.
+slot: |
+Display installed packages with slots (use twice for subslots).
+This flag implies \fB\-I\fR.
+repo: |
+Display installed packages with repository the ebuild originated from.
+This flag implies \fB\-I\fR.
+columns: |
+Like \fB\-Iv\fR, but package name and version are separated by a
+space for easy consumption by e.g.\ shell scripts which can read
+space-separated columns.
+verbose: |
+When used with \fB\-I\fR, print the package version next to name.
+When listing the package contents, a single \fB\-v\fR displays
+symlinks with an arrow (\->) to their target.  Two or more \fB\-v\fR
+adds colour to the entries and prints like \fB\-I\fR before the
+listing.
+quiet: |
+Suppresses the parenthesis around the USE-flags when used with \fB\-U\fR.

diff --git a/man/qlist.1 b/man/qlist.1
index 05e9326..f7dd847 100644
--- a/man/qlist.1
+++ b/man/qlist.1
@@ -1,68 +1,84 @@
-.TH qlist "1" "Mar 2016" "Gentoo Foundation" "qlist"
+.\" generated by mkman.py, please do NOT edit!
+.TH qlist "1" "Apr 2018" "Gentoo Foundation" "qlist"
 .SH NAME
 qlist \- list files owned by pkgname
 .SH SYNOPSIS
 .B qlist
 \fI[opts] \fR
 .SH DESCRIPTION
-
+\fIqlist\fR shows the contents, or a subset thereof, of an installed
+package.  Alternatively, lists whether a package is installed,
+optionally with version, USE-flag, SLOT or REPO information.  The
+\fIpkgname\fR to query for does not have to be an exact match, it may be
+part of it, e.g.\ an entire category, or any package with some string in
+its name.
 .SH OPTIONS
 .TP
 \fB\-I\fR, \fB\-\-installed\fR
-Just show installed packages
+Instead of listing the contents of a package, just print the package
+name if the package is currently installed.
 .TP
 \fB\-S\fR, \fB\-\-slots\fR
-Display installed packages with slots (use twice for subslots)
+Display installed packages with slots (use twice for subslots).
 .TP
 \fB\-R\fR, \fB\-\-repo\fR
-Display installed packages with repository
+Display installed packages with repository the ebuild originated from.
+This flag implies \fB\-I\fR.
 .TP
 \fB\-U\fR, \fB\-\-umap\fR
-Display installed packages with flags used
+List USE-flags enabled when the package was installed.  This flag
+implies \fB\-I\fR.
 .TP
 \fB\-c\fR, \fB\-\-columns\fR
-Display column view
+Like \fB\-Iv\fR, but package name and version are separated by a
+space for easy consumption by e.g.\ shell scripts which can read
+space-separated columns.
 .TP
 \fB\-\-showdebug\fR
-Show /usr/lib/debug files
+Show /usr/lib/debug and /usr/src/debug files.
 .TP
 \fB\-e\fR, \fB\-\-exact\fR
-Exact match (only CAT/PN or PN without PV)
+Exact match (only CAT/PN or PN without PV).
 .TP
 \fB\-a\fR, \fB\-\-all\fR
-Show every installed package
+Show every installed package.
 .TP
 \fB\-d\fR, \fB\-\-dir\fR
-Only show directories
+Only show directories.
 .TP
 \fB\-o\fR, \fB\-\-obj\fR
-Only show objects
+Only show objects.
 .TP
 \fB\-s\fR, \fB\-\-sym\fR
-Only show symlinks
+Only show symlinks.
 .TP
 \fB\-\-root\fR \fI\fR
-Set the ROOT env var
+Set the ROOT env var.
 .TP
 \fB\-v\fR, \fB\-\-verbose\fR
-Make a lot of noise
+When used with \fB\-I\fR, print the package version next to name.
+When listing the package contents, a single \fB\-v\fR displays
+symlinks with an arrow (\->) to their target.  Two or more \fB\-v\fR
+adds colour to the entries and prints like \fB\-I\fR before the
+list

[gentoo-commits] proj/portage-utils:master commit in: man/, man/include/

2018-04-03 Thread Fabian Groffen
commit: 86085691d6a42e497c1a8902cf7c24212a2dd67d
Author: Fabian Groffen  gentoo  org>
AuthorDate: Tue Apr  3 12:56:17 2018 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Tue Apr  3 12:56:17 2018 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=86085691

qpkg: improve documentation

Bug: https://bugs.gentoo.org/645554

 man/include/qpkg.desc |  4 
 man/include/qpkg.optdesc.yaml |  2 ++
 man/qpkg.1| 31 ++-
 3 files changed, 24 insertions(+), 13 deletions(-)

diff --git a/man/include/qpkg.desc b/man/include/qpkg.desc
new file mode 100644
index 000..2bba24b
--- /dev/null
+++ b/man/include/qpkg.desc
@@ -0,0 +1,4 @@
+\fIqpkg\fR creates or cleans up Gentoo binary packages.  The default
+action is to create a new binpkg for the given package names and store
+them in pkgdir, which can be set explicitly using the \fB\-\-pkgdir\fR
+option.

diff --git a/man/include/qpkg.optdesc.yaml b/man/include/qpkg.optdesc.yaml
new file mode 100644
index 000..2da2810
--- /dev/null
+++ b/man/include/qpkg.optdesc.yaml
@@ -0,0 +1,2 @@
+verbose: Check and report MD5 hash mismatches during install.
+quiet: Ignored for compatability with other qapplets.

diff --git a/man/qpkg.1 b/man/qpkg.1
index 8bb098a..930d15c 100644
--- a/man/qpkg.1
+++ b/man/qpkg.1
@@ -1,47 +1,52 @@
-.TH qpkg "1" "Mar 2016" "Gentoo Foundation" "qpkg"
+.\" generated by mkman.py, please do NOT edit!
+.TH qpkg "1" "Apr 2018" "Gentoo Foundation" "qpkg"
 .SH NAME
 qpkg \- manipulate Gentoo binpkgs
 .SH SYNOPSIS
 .B qpkg
 \fI[opts] \fR
 .SH DESCRIPTION
-
+\fIqpkg\fR creates or cleans up Gentoo binary packages.  The default
+action is to create a new binpkg for the given package names and store
+them in pkgdir, which can be set explicitly using the \fB\-\-pkgdir\fR
+option.
 .SH OPTIONS
 .TP
 \fB\-c\fR, \fB\-\-clean\fR
-clean pkgdir of unused binary files
+clean pkgdir of unused binary files.
 .TP
 \fB\-E\fR, \fB\-\-eclean\fR
-clean pkgdir of files not in the tree anymore (slow)
+clean pkgdir of files not in the tree anymore (slow).
 .TP
 \fB\-p\fR, \fB\-\-pretend\fR
-pretend only
+pretend only.
 .TP
 \fB\-P\fR \fI\fR, \fB\-\-pkgdir\fR \fI\fR
-alternate package directory
+alternate package directory.
 .TP
 \fB\-\-root\fR \fI\fR
-Set the ROOT env var
+Set the ROOT env var.
 .TP
 \fB\-v\fR, \fB\-\-verbose\fR
-Make a lot of noise
+Check and report MD5 hash mismatches during install.
 .TP
 \fB\-q\fR, \fB\-\-quiet\fR
-Tighter output; suppress warnings
+Ignored for compatability with other qapplets.
 .TP
 \fB\-C\fR, \fB\-\-nocolor\fR
-Don't output color
+Don't output color.
 .TP
 \fB\-h\fR, \fB\-\-help\fR
-Print this help and exit
+Print this help and exit.
 .TP
 \fB\-V\fR, \fB\-\-version\fR
-Print version and exit
+Print version and exit.
 
 .SH "REPORTING BUGS"
 Please report bugs via http://bugs.gentoo.org/
 .br
-Product: Portage Development; Component: Tools
+Product: Portage Development; Component: Tools, Assignee:
+portage-ut...@gentoo.org
 .SH AUTHORS
 .nf
 Ned Ludd 



[gentoo-commits] proj/portage-utils:master commit in: man/, man/include/

2018-04-03 Thread Fabian Groffen
commit: f24b626027dceb5890b134837c6683f4593f6ce0
Author: Fabian Groffen  gentoo  org>
AuthorDate: Tue Apr  3 12:15:35 2018 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Tue Apr  3 12:15:35 2018 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=f24b6260

qmerge: improve documentation

Bug: https://bugs.gentoo.org/645554

 man/include/qmerge.desc |  6 ++
 man/qmerge.1| 43 +--
 2 files changed, 31 insertions(+), 18 deletions(-)

diff --git a/man/include/qmerge.desc b/man/include/qmerge.desc
new file mode 100644
index 000..08589ec
--- /dev/null
+++ b/man/include/qmerge.desc
@@ -0,0 +1,6 @@
+\fIqmerge\fR retrieves and installs Gentoo binary packages.  Simple
+dependency checking is performed, after which \fIqmerge\fR just unpacks
+the binpkg onto the filesystem and registers the package in the VDB.
+
+Retrieval of packages from a remote binhost is currently performed using
+\fBwget\fR(1).  More specifically, \fIFETCHCOMMAND\fR is ignored.

diff --git a/man/qmerge.1 b/man/qmerge.1
index f3d80db..f66908e 100644
--- a/man/qmerge.1
+++ b/man/qmerge.1
@@ -1,65 +1,72 @@
-.TH qmerge "1" "Mar 2016" "Gentoo Foundation" "qmerge"
+.\" generated by mkman.py, please do NOT edit!
+.TH qmerge "1" "Apr 2018" "Gentoo Foundation" "qmerge"
 .SH NAME
 qmerge \- fetch and merge binary package
 .SH SYNOPSIS
 .B qmerge
 \fI[opts] \fR
 .SH DESCRIPTION
+\fIqmerge\fR retrieves and installs Gentoo binary packages.  Simple
+dependency checking is performed, after which \fIqmerge\fR just unpacks
+the binpkg onto the filesystem and registers the package in the VDB.
 
+Retrieval of packages from a remote binhost is currently performed using
+\fBwget\fR(1).  More specifically, \fIFETCHCOMMAND\fR is ignored.
 .SH OPTIONS
 .TP
 \fB\-f\fR, \fB\-\-fetch\fR
-Fetch package and newest Packages metadata
+Fetch package and newest Packages metadata.
 .TP
 \fB\-F\fR, \fB\-\-force\fR
-Fetch package (skipping Packages)
+Fetch package (skipping Packages).
 .TP
 \fB\-s\fR, \fB\-\-search\fR
-Search available packages
+Search available packages.
 .TP
 \fB\-K\fR, \fB\-\-install\fR
-Install package
+Install package.
 .TP
 \fB\-U\fR, \fB\-\-unmerge\fR
-Uninstall package
+Uninstall package.
 .TP
 \fB\-p\fR, \fB\-\-pretend\fR
-Pretend only
+Pretend only.
 .TP
 \fB\-u\fR, \fB\-\-update\fR
-Update only
+Update only.
 .TP
 \fB\-y\fR, \fB\-\-yes\fR
-Don't prompt before overwriting
+Don't prompt before overwriting.
 .TP
 \fB\-O\fR, \fB\-\-nodeps\fR
-Don't merge dependencies
+Don't merge dependencies.
 .TP
 \fB\-\-debug\fR
-Run shell funcs with `set -x`
+Run shell funcs with `set -x`.
 .TP
 \fB\-\-root\fR \fI\fR
-Set the ROOT env var
+Set the ROOT env var.
 .TP
 \fB\-v\fR, \fB\-\-verbose\fR
-Make a lot of noise
+Make a lot of noise.
 .TP
 \fB\-q\fR, \fB\-\-quiet\fR
-Tighter output; suppress warnings
+Tighter output; suppress warnings.
 .TP
 \fB\-C\fR, \fB\-\-nocolor\fR
-Don't output color
+Don't output color.
 .TP
 \fB\-h\fR, \fB\-\-help\fR
-Print this help and exit
+Print this help and exit.
 .TP
 \fB\-V\fR, \fB\-\-version\fR
-Print version and exit
+Print version and exit.
 
 .SH "REPORTING BUGS"
 Please report bugs via http://bugs.gentoo.org/
 .br
-Product: Portage Development; Component: Tools
+Product: Portage Development; Component: Tools, Assignee:
+portage-ut...@gentoo.org
 .SH AUTHORS
 .nf
 Ned Ludd 



[gentoo-commits] proj/portage-utils:master commit in: man/, man/include/

2018-04-03 Thread Fabian Groffen
commit: 23b810c84c02a29f3b2766cf0fd005c53e668816
Author: Fabian Groffen  gentoo  org>
AuthorDate: Tue Apr  3 13:51:42 2018 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Tue Apr  3 13:51:42 2018 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=23b810c8

qtbz2: improve documentation

Bug: https://bugs.gentoo.org/645554

 man/include/qsize.desc |  3 +++
 man/include/qsize.optdesc.yaml |  5 +
 man/include/qtbz2.desc |  2 ++
 man/include/qtbz2.optdesc.yaml |  2 ++
 man/qtbz2.1| 33 ++---
 5 files changed, 30 insertions(+), 15 deletions(-)

diff --git a/man/include/qsize.desc b/man/include/qsize.desc
new file mode 100644
index 000..e4edce0
--- /dev/null
+++ b/man/include/qsize.desc
@@ -0,0 +1,3 @@
+\fIqsize\fR calculates the storage size taken by an installed package.
+The reported sizes can be the recorded exact sizes of all files, or the
+storage space they consume given the underlying filesystem.

diff --git a/man/include/qsize.optdesc.yaml b/man/include/qsize.optdesc.yaml
new file mode 100644
index 000..8dd58e4
--- /dev/null
+++ b/man/include/qsize.optdesc.yaml
@@ -0,0 +1,5 @@
+ignore: |
+Filter out entries matching \fI\fR, which is a regular
+expression, before calculating size.
+verbose: Ignored for compatibility with other qapplets.
+quiet: Ignored for compatibility with other qapplets.

diff --git a/man/include/qtbz2.desc b/man/include/qtbz2.desc
new file mode 100644
index 000..2ba37db
--- /dev/null
+++ b/man/include/qtbz2.desc
@@ -0,0 +1,2 @@
+\fIqtbz2\fR joins and splits combined xpak+tarbz2 files.  Gentoo binary
+packages are such combined files.

diff --git a/man/include/qtbz2.optdesc.yaml b/man/include/qtbz2.optdesc.yaml
new file mode 100644
index 000..c1ebcd1
--- /dev/null
+++ b/man/include/qtbz2.optdesc.yaml
@@ -0,0 +1,2 @@
+verbose: Print some files and sizes while joining and splitting.
+quiet: Ignored for compatibility with other qapplets.

diff --git a/man/qtbz2.1 b/man/qtbz2.1
index b22c70c..94db0d8 100644
--- a/man/qtbz2.1
+++ b/man/qtbz2.1
@@ -1,53 +1,56 @@
-.TH qtbz2 "1" "Mar 2016" "Gentoo Foundation" "qtbz2"
+.\" generated by mkman.py, please do NOT edit!
+.TH qtbz2 "1" "Apr 2018" "Gentoo Foundation" "qtbz2"
 .SH NAME
 qtbz2 \- manipulate tbz2 packages
 .SH SYNOPSIS
 .B qtbz2
 \fI[opts] \fR
 .SH DESCRIPTION
-
+\fIqtbz2\fR joins and splits combined xpak+tarbz2 files.  Gentoo binary
+packages are such combined files.
 .SH OPTIONS
 .TP
 \fB\-d\fR \fI\fR, \fB\-\-dir\fR \fI\fR
-Change to specified directory
+Change to specified directory.
 .TP
 \fB\-j\fR, \fB\-\-join\fR
-Join:   
+Join:   .
 .TP
 \fB\-s\fR, \fB\-\-split\fR
-Split a tbz2 into a tar.bz2 + xpak
+Split a tbz2 into a tar.bz2 + xpak.
 .TP
 \fB\-t\fR, \fB\-\-tarbz2\fR
-Just split the tar.bz2
+Just split the tar.bz2.
 .TP
 \fB\-x\fR, \fB\-\-xpak\fR
-Just split the xpak
+Just split the xpak.
 .TP
 \fB\-O\fR, \fB\-\-stdout\fR
-Write files to stdout
+Write files to stdout.
 .TP
 \fB\-\-root\fR \fI\fR
-Set the ROOT env var
+Set the ROOT env var.
 .TP
 \fB\-v\fR, \fB\-\-verbose\fR
-Make a lot of noise
+Print some files and sizes while joining and splitting.
 .TP
 \fB\-q\fR, \fB\-\-quiet\fR
-Tighter output; suppress warnings
+Ignored for compatibility with other qapplets.
 .TP
 \fB\-C\fR, \fB\-\-nocolor\fR
-Don't output color
+Don't output color.
 .TP
 \fB\-h\fR, \fB\-\-help\fR
-Print this help and exit
+Print this help and exit.
 .TP
 \fB\-V\fR, \fB\-\-version\fR
-Print version and exit
+Print version and exit.
 
 .SH "REPORTING BUGS"
 Please report bugs via http://bugs.gentoo.org/
 .br
-Product: Portage Development; Component: Tools
+Product: Portage Development; Component: Tools, Assignee:
+portage-ut...@gentoo.org
 .SH AUTHORS
 .nf
 Ned Ludd 



[gentoo-commits] proj/portage-utils:master commit in: man/, man/include/, /

2018-04-12 Thread Fabian Groffen
commit: 33d4e18b26cd37691a81584da0efd929097a22b3
Author: Fabian Groffen  gentoo  org>
AuthorDate: Thu Apr 12 19:14:19 2018 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Thu Apr 12 19:14:19 2018 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=33d4e18b

qlop: don't rely on %F for data parsing for portability

While at it document the date formats in the man-page.

 man/include/qlop.optdesc.yaml | 16 
 man/qlop.1| 16 +++-
 qlop.c|  6 +++---
 3 files changed, 34 insertions(+), 4 deletions(-)

diff --git a/man/include/qlop.optdesc.yaml b/man/include/qlop.optdesc.yaml
index 7864d6e..fad1670 100644
--- a/man/include/qlop.optdesc.yaml
+++ b/man/include/qlop.optdesc.yaml
@@ -1,3 +1,19 @@
+date: |
+Limit the selection of packages to the date given, or to the range
+of dates if this argument is given twice.  The \fB--date\fR option
+can take a few forms.
+.RS
+.IP "NUMBER [s] [ago]"
+Relative time, specifying \fINUMBER\fR \fIdays\fR, \fIweeks\fR,
+\fImonths\fR or \fIyears\fR, for example \fI3 days ago\fR.
+.IP -MM-DD
+Big-endian date, with components separated by hyphens, starting with
+year, followed by month and day of month.
+.IP S
+Seconds since 1970-01-01 00:00:00 + (UTC), the UNIX epoch.
+.IP FORMAT|DATE
+Use \fIFORMAT\fR as input for \fBstrptime\fR(3) to parse \fIDATE\fR.
+.RE
 gauge: |
 Gauge number of times a package has been merged.  This shows the
 merge time for each individual merge of package.

diff --git a/man/qlop.1 b/man/qlop.1
index c138054..9c449a9 100644
--- a/man/qlop.1
+++ b/man/qlop.1
@@ -39,7 +39,21 @@ Show current emerging packages.  This relies on
 in order to detect running merges.
 .TP
 \fB\-d\fR \fI\fR, \fB\-\-date\fR \fI\fR
-Limit selection to this time (1st -d is start, 2nd -d is end).
+Limit the selection of packages to the date given, or to the range
+of dates if this argument is given twice.  The \fB--date\fR option
+can take a few forms.
+.RS
+.IP "NUMBER [s] [ago]"
+Relative time, specifying \fINUMBER\fR \fIdays\fR, \fIweeks\fR,
+\fImonths\fR or \fIyears\fR, for example \fI3 days ago\fR.
+.IP -MM-DD
+Big-endian date, with components separated by hyphens, starting with
+year, followed by month and day of month.
+.IP S
+Seconds since 1970-01-01 00:00:00 + (UTC), the UNIX epoch.
+.IP FORMAT|DATE
+Use \fIFORMAT\fR as input for \fBstrptime\fR(3) to parse \fIDATE\fR.
+.RE
 .TP
 \fB\-f\fR \fI\fR, \fB\-\-logfile\fR \fI\fR
 Read emerge logfile instead of $EMERGE_LOG_DIR/emerge.log.

diff --git a/qlop.c b/qlop.c
index 67669ef..1d4e0d9 100644
--- a/qlop.c
+++ b/qlop.c
@@ -39,7 +39,7 @@ static const char qlop_desc[] =
"The --date option can take a few forms:\n"
"  -d '# [s] [ago]'  (e.g. '3 days ago')\n"
"Or using strptime(3) formats:\n"
-   "  -d '2015-12-25'   (detected as %F)\n"
+   "  -d '2015-12-25'   (detected as %Y-%m-%d)\n"
"  -d '1459101740'   (detected as %s)\n"
"  -d '%d.%m.%Y|25.12.2015'  (format is specified)";
 #define qlop_usage(ret) usage(ret, QLOP_FLAGS, qlop_long_opts, qlop_opts_help, 
qlop_desc, lookup_applet_idx("qlop"))
@@ -733,7 +733,7 @@ parse_date(const char *sdate, time_t *t)
} else {
/* Handle automatic formats:
 * - "12315128"   -> %s
-* - "2015-12-24" -> %F (same as %Y-%m-%d
+* - "2015-12-24" -> %Y-%m-%d
 * - human readable format (see below)
 */
size_t len = strspn(sdate, "0123456789-");
@@ -742,7 +742,7 @@ parse_date(const char *sdate, time_t *t)
if (strchr(sdate, '-') == NULL)
fmt = "%s";
else
-   fmt = "%F";
+   fmt = "%Y-%m-%d";
 
s = strptime(sdate, fmt, &tm);
if (s == NULL || s[0] != '\0')



[gentoo-commits] proj/portage-utils:master commit in: man/, man/include/, /

2019-07-14 Thread Fabian Groffen
commit: 26b9374ee23d16b3957b6ebc0cd80f53b22a4d16
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sun Jul 14 13:30:06 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sun Jul 14 13:30:06 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=26b9374e

quse: add -F argument, move some -v functionality to -D

-v now controls default atom formatting, as with other applets, the
ability to list USE-flags, their state and description per package now
is enabled by the -D (describe) flag, which incidentally also makes more
sense.

Signed-off-by: Fabian Groffen  gentoo.org>

 man/include/quse.optdesc.yaml | 11 +++---
 man/quse.1| 14 ---
 quse.c| 85 ---
 3 files changed, 62 insertions(+), 48 deletions(-)

diff --git a/man/include/quse.optdesc.yaml b/man/include/quse.optdesc.yaml
index 693aade..71fcd2d 100644
--- a/man/include/quse.optdesc.yaml
+++ b/man/include/quse.optdesc.yaml
@@ -1,10 +1,11 @@
 exact: Search for exact string, e.g.\ do not use regular expression matching.
 verbose: |
-Show descriptions for USE-flags for packages that match the search.
+Show versions for packages that match the search.
 Also shows problems encountered during parsing.  These are mostly
 diagnostic and indicate possible incorrectness in the results.
 quiet: Ignored for compatibility with other qapplets.
-installed: |
-Only search installed packages.  Together with \fB-v\fR this shows
-USE-flags and their descriptions, and currently enabled flags
-prefixed with an asterisk (\fI*\fR).
+describe: |
+Describe the USE flag, when no USE-flag given and combined with
+\fB-p\fR, lists all USE-flags with their descriptions (and enabled
+state prefixed with an asterisk when used with \fB-I\fR) per
+package.

diff --git a/man/quse.1 b/man/quse.1
index a30e189..8306ca5 100644
--- a/man/quse.1
+++ b/man/quse.1
@@ -20,12 +20,13 @@ List all ebuilds, don't match anything.
 Use the LICENSE vs IUSE.
 .TP
 \fB\-D\fR, \fB\-\-describe\fR
-Describe the USE flag.
+Describe the USE flag, when no USE-flag given and combined with
+\fB-p\fR, lists all USE-flags with their descriptions (and enabled
+state prefixed with an asterisk when used with \fB-I\fR) per
+package.
 .TP
 \fB\-I\fR, \fB\-\-installed\fR
-Only search installed packages.  Together with \fB-v\fR this shows
-USE-flags and their descriptions, and currently enabled flags
-prefixed with an asterisk (\fI*\fR).
+Only search installed packages.
 .TP
 \fB\-p\fR \fI\fR, \fB\-\-package\fR \fI\fR
 Restrict matching to package or category.
@@ -33,11 +34,14 @@ Restrict matching to package or category.
 \fB\-R\fR, \fB\-\-repo\fR
 Show repository the ebuild originates from.
 .TP
+\fB\-F\fR \fI\fR, \fB\-\-format\fR \fI\fR
+Print matched atom using given format string.
+.TP
 \fB\-\-root\fR \fI\fR
 Set the ROOT env var.
 .TP
 \fB\-v\fR, \fB\-\-verbose\fR
-Show descriptions for USE-flags for packages that match the search.
+Show versions for packages that match the search.
 Also shows problems encountered during parsing.  These are mostly
 diagnostic and indicate possible incorrectness in the results.
 .TP

diff --git a/quse.c b/quse.c
index bc99c3b..df8626e 100644
--- a/quse.c
+++ b/quse.c
@@ -27,7 +27,7 @@
 #include "xarray.h"
 #include "xregex.h"
 
-#define QUSE_FLAGS "eaLDIp:R" COMMON_FLAGS
+#define QUSE_FLAGS "eaLDIp:RF:" COMMON_FLAGS
 static struct option const quse_long_opts[] = {
{"exact", no_argument, NULL, 'e'},
{"all",   no_argument, NULL, 'a'},
@@ -36,6 +36,7 @@ static struct option const quse_long_opts[] = {
{"installed", no_argument, NULL, 'I'},
{"package",a_argument, NULL, 'p'},
{"repo",  no_argument, NULL, 'R'},
+   {"format", a_argument, NULL, 'F'},
COMMON_LONG_OPTS
 };
 static const char * const quse_opts_help[] = {
@@ -46,6 +47,7 @@ static const char * const quse_opts_help[] = {
"Only search installed packages",
"Restrict matching to package or category",
"Show repository the ebuild originates from",
+   "Print matched atom using given format string",
COMMON_OPTS_HELP
 };
 #define quse_usage(ret) usage(ret, QUSE_FLAGS, quse_long_opts, quse_opts_help, 
NULL, lookup_applet_idx("quse"))
@@ -61,9 +63,10 @@ struct quse_state {
bool do_licence:1;
bool do_installed:1;
bool do_list:1;
-   bool do_repo:1;
+   bool need_full_atom:1;
depend_atom *match;
regex_t *pregv;
+   const char *fmt;
 };
 
 static char *_quse_getline_buf = NULL;
@@ -142,9 +145,8 @@ quse_search_use_local_desc(int portdirfd, struct quse_state 
*state)
if (state->do_list) {
state->retv[i] = xstrdup(q);
} else {
-   printf("%s%s/%s%s%s[%s%s%s] %s\n",
- 

  1   2   >