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

2021-02-20 Thread Fabian Groffen
commit: 08cdb5f41aa73580067e8668bc02c8e4be431a65
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sat Feb 20 12:23:26 2021 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sat Feb 20 12:23:26 2021 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=08cdb5f4

man: regen with new qwhich manpage

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

 applets.h   |  2 +-
 man/include/qwhich.desc | 15 +++
 man/q.1 |  4 +++-
 man/qatom.1 |  3 ++-
 man/qcheck.1|  3 ++-
 man/qdepends.1  |  3 ++-
 man/qfile.1 |  3 ++-
 man/qgrep.1 |  3 ++-
 man/qkeyword.1  |  3 ++-
 man/qlist.1 |  3 ++-
 man/qlop.1  |  3 ++-
 man/qmanifest.1 |  3 ++-
 man/qmerge.1|  3 ++-
 man/qpkg.1  |  3 ++-
 man/qsearch.1   |  3 ++-
 man/qsize.1 |  3 ++-
 man/qtbz2.1 |  3 ++-
 man/qtegrity.1  |  3 ++-
 man/quse.1  |  3 ++-
 man/qwhich.1| 32 +---
 man/qxpak.1 |  5 +++--
 21 files changed, 83 insertions(+), 23 deletions(-)

diff --git a/applets.h b/applets.h
index f37cb63..956ab67 100644
--- a/applets.h
+++ b/applets.h
@@ -91,7 +91,7 @@ static const struct applet_t {
{"qtegrity",  qtegrity_main,  "", "verify files with 
IMA"},
 #endif
{"quse",  quse_main,  "",   "find pkgs using 
useflags"},
-   {"qwhich",qwhich_main,"",   "find path to pkg"},
+   {"qwhich",qwhich_main,"",   "find path to pkg"},
{"qxpak", qxpak_main, "", "manipulate xpak 
archives"},
 
/* aliases for equery compatibility */

diff --git a/man/include/qwhich.desc b/man/include/qwhich.desc
new file mode 100644
index 000..abef4e2
--- /dev/null
+++ b/man/include/qwhich.desc
@@ -0,0 +1,15 @@
+.I qwhich
+returns the paths to the ebuilds matching the given atoms.  Searching is
+done by default over the main ebuild repository and all configured
+overlays.  When requested, a search can be made over the repository of
+installed packages (VDB) or binpkg repos.
+.P
+The default action is to print the full path to the latest ebuild for
+each package.  This can be changed using \fB-d\fR to print the directory
+the ebuild is in instead.  E.g\. one could \fBcd\fR(1) to this
+directory.  Alternatively, one can request to stop searching after the
+first match using \fB-f\fR, which means at most one match per repo is
+returned.
+.P
+\fIqwhich\fR accepts atoms to search for, which can be any valid atom,
+including e.g\. version specifications to narrow the search.

diff --git a/man/q.1 b/man/q.1
index d98c3c3..2979cab 100644
--- a/man/q.1
+++ b/man/q.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH q "1" "Nov 2020" "Gentoo Foundation" "q"
+.TH q "1" "Feb 2021" "Gentoo Foundation" "q"
 .SH NAME
 q \- invoke a portage utility applet
 .SH SYNOPSIS
@@ -75,6 +75,7 @@ Print version and exit.
  qtbz2  : manipulate tbz2 packages
   qtegrity  : verify files with IMA
   quse: find pkgs using useflags
+qwhich: find path to pkg
  qxpak  : manipulate xpak archives
 .fi
 .SH "REPORTING BUGS"
@@ -104,4 +105,5 @@ Fabian Groffen 
 .BR qtbz2 (1),
 .BR qtegrity (1),
 .BR quse (1),
+.BR qwhich (1),
 .BR qxpak (1)

diff --git a/man/qatom.1 b/man/qatom.1
index d8c7cd6..99bf67a 100644
--- a/man/qatom.1
+++ b/man/qatom.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qatom "1" "Nov 2020" "Gentoo Foundation" "qatom"
+.TH qatom "1" "Feb 2021" "Gentoo Foundation" "qatom"
 .SH NAME
 qatom \- split atom strings
 .SH SYNOPSIS
@@ -157,4 +157,5 @@ Fabian Groffen 
 .BR qtbz2 (1),
 .BR qtegrity (1),
 .BR quse (1),
+.BR qwhich (1),
 .BR qxpak (1)

diff --git a/man/qcheck.1 b/man/qcheck.1
index 2473513..2d98408 100644
--- a/man/qcheck.1
+++ b/man/qcheck.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qcheck "1" "Nov 2020" "Gentoo Foundation" "qcheck"
+.TH qcheck "1" "Feb 2021" "Gentoo Foundation" "qcheck"
 .SH NAME
 qcheck \- verify integrity of installed packages
 .SH SYNOPSIS
@@ -81,4 +81,5 @@ Fabian Groffen 
 .BR qtbz2 (1),
 .BR qtegrity (1),
 .BR quse (1),
+.BR qwhich (1),
 .BR qxpak (1)

diff --git a/man/qdepends.1 b/man/qdepends.1
index 0eb7ba3..0690f16 100644
--- a/man/qdepends.1
+++ b/man/qdepends.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qdepends "1" "Nov 2020" "Gentoo Foundation" "qdepends"
+.TH qdepends "1" "Feb 2021" "Gentoo Foundation" "qdepends"
 .SH NAME
 qdepends \- show dependency info
 .SH SYNOPSIS
@@ -165,4 +165,5 @@ Fabian Groffen 
 .BR qtbz2 (1),
 .BR qtegrity (1),
 .BR quse (1),
+.BR qwhich (1),
 .BR qxpak (1)

diff --git a/man/qfile.1 b/man/qfile.1
index ffe0968..1f261d4 100644
--- a/man/qfile.1
+++ b/man/qfile.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qfile 

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

2021-01-30 Thread Fabian Groffen
commit: 3ef45fa46d5a45a3f19806cf62aba8532b4e401f
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sat Jan 30 10:35:55 2021 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sat Jan 30 10:35:55 2021 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=3ef45fa4

qlop: support -d 0 (or @0)

Allow setting the zero date, to basically have a quick way to list
everything, useful with -E, e.g. -Evd 0 to show the entire emerge
history.

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

 man/include/qlop.desc |  2 +-
 man/include/qlop.optdesc.yaml |  2 +-
 man/qlop.1|  6 +++---
 qlop.c| 25 +
 4 files changed, 22 insertions(+), 13 deletions(-)

diff --git a/man/include/qlop.desc b/man/include/qlop.desc
index e39f689..0f7fa7c 100644
--- a/man/include/qlop.desc
+++ b/man/include/qlop.desc
@@ -19,7 +19,7 @@ in further on specific packages.
 .P
 After version \fB0.74\fR of portage-utils, \fIqlop\fR was changed
 considerably to be more consistent and more advanced.  Most notably,
-this has changed default date output and commmand line flags.  Instead
+this has changed default date output and command line flags.  Instead
 of reporting the time the operation finished, \fIqlop\fR now reports the
 time the operation started.  The behaviour of the old \fB-g\fR flag is
 best matched by the new \fB-t\fR flag.  Similar, the old \fB-t\fR flag

diff --git a/man/include/qlop.optdesc.yaml b/man/include/qlop.optdesc.yaml
index c6e0833..fc268d6 100644
--- a/man/include/qlop.optdesc.yaml
+++ b/man/include/qlop.optdesc.yaml
@@ -16,7 +16,7 @@ date: |
 .IP -MM-DDThh:mm:ss
 As before, but hours, minutes and seconds added.  This is the same
 format qlop prints for timestamps.
-.IP S
+.IP "S or @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.

diff --git a/man/qlop.1 b/man/qlop.1
index 5aafa82..a175332 100644
--- a/man/qlop.1
+++ b/man/qlop.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qlop "1" "Nov 2020" "Gentoo Foundation" "qlop"
+.TH qlop "1" "Jan 2021" "Gentoo Foundation" "qlop"
 .SH NAME
 qlop \- emerge log analyzer
 .SH SYNOPSIS
@@ -27,7 +27,7 @@ in further on specific packages.
 .P
 After version \fB0.74\fR of portage-utils, \fIqlop\fR was changed
 considerably to be more consistent and more advanced.  Most notably,
-this has changed default date output and commmand line flags.  Instead
+this has changed default date output and command line flags.  Instead
 of reporting the time the operation finished, \fIqlop\fR now reports the
 time the operation started.  The behaviour of the old \fB-g\fR flag is
 best matched by the new \fB-t\fR flag.  Similar, the old \fB-t\fR flag
@@ -110,7 +110,7 @@ year, followed by month and day of month.
 .IP -MM-DDThh:mm:ss
 As before, but hours, minutes and seconds added.  This is the same
 format qlop prints for timestamps.
-.IP S
+.IP "S or @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.

diff --git a/qlop.c b/qlop.c
index 5045d17..2d01689 100644
--- a/qlop.c
+++ b/qlop.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005-2020 Gentoo Foundation
+ * Copyright 2005-2021 Gentoo Foundation
  * Distributed under the terms of the GNU General Public License v2
  *
  * Copyright 2005-2010 Ned Ludd- 
@@ -116,14 +116,17 @@ parse_date(const char *sdate, time_t *t)
} else {
/* Handle automatic formats:
 * - "12315128"-> %s
+* - "@12315128"-> %s
 * - "2015-12-24"  -> %Y-%m-%d
 * - "2019-03-28T13:52:31" -> %Y-%m-%dT%H:%M:%s"
 * - human readable format (see below)
 */
-   size_t len = strspn(sdate, "0123456789-:T");
+   size_t len = strspn(sdate, "0123456789-:T@");
if (sdate[len] == '\0') {
const char *fmt;
-   if (strchr(sdate, '-') == NULL) {
+   if (sdate[0] == '@') {
+   fmt = "@%s";
+   } else if (strchr(sdate, '-') == NULL) {
fmt = "%s";
} else if ((s = strchr(sdate, 'T')) == NULL) {
fmt = "%Y-%m-%d";
@@ -1394,8 +1397,8 @@ int qlop_main(int argc, char **argv)
DECLARE_ARRAY(atoms);
int runningmode = 0;
 
-   start_time = 0;
-   end_time = LONG_MAX;
+   start_time = -1;
+   end_time = -1;
m.do_time = 0;
m.do_merge = 0;
m.do_unmerge = 0;
@@ -1435,10 +1438,10 @@ int qlop_main(int argc, char **argv)
case 'l': m.show_lastmerge = 

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

2020-08-14 Thread Fabian Groffen
commit: 72830c415c6c2050ecf7d90e8c739d2764bc9e09
Author: Fabian Groffen  gentoo  org>
AuthorDate: Fri Aug 14 10:05:26 2020 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Fri Aug 14 10:05:26 2020 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=72830c41

qlist: add -t (tree) and -m (masks) arguments

-t allow traversing the configured trees
-m apply masks from profiles

E.g. useful to find the latest available non-masked version of a
package:
% qlist -Itvm mypackage

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

 man/include/qlist.optdesc.yaml |  6 
 man/qlist.1| 10 +-
 qlist.c| 70 +++---
 qmerge.c   |  5 +--
 4 files changed, 77 insertions(+), 14 deletions(-)

diff --git a/man/include/qlist.optdesc.yaml b/man/include/qlist.optdesc.yaml
index 30d8446..1145fa9 100644
--- a/man/include/qlist.optdesc.yaml
+++ b/man/include/qlist.optdesc.yaml
@@ -3,6 +3,8 @@ installed: |
 name if the package is currently installed.
 binpkgs: |
 Operate on binary packages instead of installed packges.
+tree: |
+Used with \fB\-I\fR to list packages available in the tree.
 umap: |
 List USE-flags enabled when the package was installed.  This flag
 implies \fB\-I\fR.
@@ -16,6 +18,10 @@ 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.
+masks: |
+Filter matches for packages that are masked via the profiles.  In
+particular useful in combination with \fB\-Itv\fR to find the latest
+available version of a given package.
 verbose: |
 When used with \fB\-I\fR, print the package version next to name.
 When listing the package contents, \fB\-v\fR displays symlinks with

diff --git a/man/qlist.1 b/man/qlist.1
index 676ee96..db4be0d 100644
--- a/man/qlist.1
+++ b/man/qlist.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qlist "1" "Nov 2019" "Gentoo Foundation" "qlist"
+.TH qlist "1" "Aug 2020" "Gentoo Foundation" "qlist"
 .SH NAME
 qlist \- list files owned by pkgname
 .SH SYNOPSIS
@@ -22,6 +22,9 @@ name if the package is currently installed.
 \fB\-k\fR, \fB\-\-binpkgs\fR
 Operate on binary packages instead of installed packges.
 .TP
+\fB\-t\fR, \fB\-\-tree\fR
+Used with \fB\-I\fR to list packages available in the tree.
+.TP
 \fB\-S\fR, \fB\-\-slots\fR
 Display installed packages with slots (use twice for subslots).
 .TP
@@ -38,6 +41,11 @@ 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\-m\fR, \fB\-\-masks\fR
+Filter matches for packages that are masked via the profiles.  In
+particular useful in combination with \fB\-Itv\fR to find the latest
+available version of a given package.
+.TP
 \fB\-\-showdebug\fR
 Show /usr/lib/debug and /usr/src/debug files.
 .TP

diff --git a/qlist.c b/qlist.c
index cd60083..3652c0a 100644
--- a/qlist.c
+++ b/qlist.c
@@ -22,14 +22,16 @@
 #include "xpak.h"
 #include "xregex.h"
 
-#define QLIST_FLAGS "IkSRUcDedosF:" COMMON_FLAGS
+#define QLIST_FLAGS "IktSRUcmDedosF:" COMMON_FLAGS
 static struct option const qlist_long_opts[] = {
{"installed", no_argument, NULL, 'I'},
{"binpkgs",   no_argument, NULL, 'k'},
+   {"tree",  no_argument, NULL, 't'},
{"slots", no_argument, NULL, 'S'},
{"repo",  no_argument, NULL, 'R'},
{"umap",  no_argument, NULL, 'U'},
{"columns",   no_argument, NULL, 'c'},
+   {"masks", no_argument, NULL, 'm'},
{"showdebug", no_argument, NULL, 128},
{"exact", no_argument, NULL, 'e'},
{"dir",   no_argument, NULL, 'd'},
@@ -42,10 +44,12 @@ static struct option const qlist_long_opts[] = {
 static const char * const qlist_opts_help[] = {
"Just show installed package names",
"Use binpkgs instead of installed packages",
+   "Use available packages in the tree instead of installed",
"Display installed packages with slots (use twice for subslots)",
"Display installed packages with repository",
"Display installed packages with flags used",
"Display column view",
+   "Exclude matches masked by profiles",
"Show /usr/lib/debug and /usr/src/debug files",
"Exact match (only CAT/PN or PN without PV)",
"Only show directories",
@@ -175,13 +179,15 @@ qlist_match(
tree_pkg_ctx *pkg_ctx,
const char *name,
depend_atom **name_atom,
-   bool exact);
+   bool exact,
+   bool applymasks);
 bool
 qlist_match(
tree_pkg_ctx *pkg_ctx,
const char *name,
depend_atom **name_atom,
-   bool exact)
+   bool exact,
+   bool 

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

2020-05-02 Thread Fabian Groffen
commit: f926e13ef6202ec76ba057141933e835ee571787
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sat May  2 09:46:57 2020 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sat May  2 09:58:33 2020 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=f926e13e

qlop: add -v mode to -E that displays emerge invocation

Really complete the --emerge option with --verbose to get:

% qlop -Ev
emerge -uaD @world
  U  sys-kernel/linux-firmware-20200421 [20200316]
Nwww-servers/nginx-1.18.0
Dwww-servers/nginx-1.17.10

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

 man/include/qlop.optdesc.yaml | 13 +++
 qlop.c| 84 ---
 2 files changed, 92 insertions(+), 5 deletions(-)

diff --git a/man/include/qlop.optdesc.yaml b/man/include/qlop.optdesc.yaml
index 463a19d..c6e0833 100644
--- a/man/include/qlop.optdesc.yaml
+++ b/man/include/qlop.optdesc.yaml
@@ -55,3 +55,16 @@ running: |
 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.
+emerge: |
+Immitate \fBemerge\fR(1) output, as if \fBemerge -pv\fR had been
+run.  This produces a list of packages that were installed (N),
+upgraded (U), downgraded (UD), re-installed (R) or unmerged (D).
+The list always includes the version numbers, and for up/downgrades
+the previous version is listed between square brackets after the
+package.  When \fB-v\fR is used, the \fBemerge\fR invocations are
+printed as well, to really show what happened.  When concurrent
+merges are present in the displayed timeframe, the output will be
+hard to read.  This is a limitation of the \fIemerge.log\fR format.
+It is possible to combine this flag with the \fB-d\fR flag, in which
+case the default behaviour of displaying the last merge (\fB-l\fR)
+is disabled.

diff --git a/qlop.c b/qlop.c
index 69133bb..d5ace83 100644
--- a/qlop.c
+++ b/qlop.c
@@ -539,7 +539,82 @@ static int do_emerge_log(
continue;
 
/* are we interested in this line? */
-   if (flags->do_sync && (
+   if (flags->show_emerge && verbose && (
+   strncmp(p, "  *** emerge ", 13) == 0))
+   {
+   char shortopts[8];  /* must hold as many opts converted 
below */
+   int numopts = 0;
+
+   printf("emerge");
+   for (p += 13; (q = strtok(p, " \n")) != NULL; p = NULL) 
{
+   if (strncmp(q, "--", 2) == 0) {
+   /* portage seems to normalise options 
given into
+* their long forms always; I don't 
want to keep a
+* mapping table to short forms here, 
but it's
+* tempting, so I just do a few of the 
often used
+* ones */
+   q += 2;
+   if (strcmp(q, "ask") == 0) {
+   shortopts[numopts++] = 'a';
+   } else if (strcmp(q, "verbose") == 0) {
+   shortopts[numopts++] = 'v';
+   } else if (strcmp(q, "oneshot") == 0) {
+   shortopts[numopts++] = '1';
+   } else if (strcmp(q, "deep") == 0) {
+   shortopts[numopts++] = 'D';
+   } else if (strcmp(q, "update") == 0) {
+   shortopts[numopts++] = 'u';
+   } else if (strcmp(q, "depclean") == 0) {
+   shortopts[numopts++] = 'c';
+   } else if (strcmp(q, "unmerge") == 0) {
+   shortopts[numopts++] = 'C';
+   } else {
+   q = NULL;
+   }
+
+   /* process next token */
+   if (q != NULL)
+   continue;
+   }
+
+   /* if we're here, we've assembled opts whatever 
we could */
+   if (numopts > 0) {
+   printf(" %s-%.*s%s",
+   GREEN, numopts, 
shortopts, NORM);
+   numopts = 0;
+   }
+
+

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

2020-01-19 Thread Fabian Groffen
commit: d99b6860d44ea074840f804dd788b9c3a801ee11
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sat Jan 18 13:48:07 2020 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sat Jan 18 13:48:07 2020 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=d99b6860

man: add missing include file for q options

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

 man/include/q.optdesc.yaml | 14 ++
 1 file changed, 14 insertions(+)

diff --git a/man/include/q.optdesc.yaml b/man/include/q.optdesc.yaml
new file mode 100644
index 000..cde6eed
--- /dev/null
+++ b/man/include/q.optdesc.yaml
@@ -0,0 +1,14 @@
+overlays: |
+Print available overlays (read from repos.conf).  Use \fI-v\fR to
+see the source (file) where the overlay was declared.
+envvar: |
+Print used environment variables and found values.  Use \fI-v\fR to
+see the source (file, environment) where the variable was declared.
+Additional arguments are treated as variable names to print the
+values for.  If just one name is given, only the value is printed if
+matched.  When no arguments or more than one argument is given, the
+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.



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

2019-12-27 Thread Fabian Groffen
commit: 032bd7e9200d1071b79f3a5d33906020fc805048
Author: Fabian Groffen  gentoo  org>
AuthorDate: Fri Dec 27 16:55:58 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Fri Dec 27 16:55:58 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=032bd7e9

main: add masks support

Expose masks via q -m, store masks in preparation for applying masks
when listing available ebuilds.

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

 main.c | 221 +
 main.h |   2 +
 man/include/q.desc |   2 +
 man/q.1|  13 +++-
 q.c|  56 +-
 5 files changed, 209 insertions(+), 85 deletions(-)

diff --git a/main.c b/main.c
index 869bf31..b5404cb 100644
--- a/main.c
+++ b/main.c
@@ -22,6 +22,7 @@
 #include "eat_file.h"
 #include "rmspace.h"
 #include "scandirat.h"
+#include "set.h"
 #include "xasprintf.h"
 
 /* variables to control runtime behavior */
@@ -354,10 +355,12 @@ set_portage_env_var(env_vars *var, const char *value, 
const char *src)
}
 }
 
-/* Helper to read a portage env file (e.g. make.conf), or recursively if
- * it points to a directory */
+/* Helper to read a portage file (e.g. make.conf, package.mask), or
+ * recursively if it points to a directory (we don't care about EAPI for
+ * dirs, basically PMS 5.2.5 EAPI restriction is ignored) */
+enum portage_file_type { ENV_FILE, PMASK_FILE };
 static void
-read_portage_env_file(const char *file, env_vars vars[])
+read_portage_file(const char *file, enum portage_file_type type, void *data)
 {
FILE *fp;
struct dirent **dents;
@@ -368,6 +371,8 @@ read_portage_env_file(const char *file, env_vars vars[])
size_t buflen = 0;
size_t line;
int i;
+   env_vars *vars = data;
+   set *masks = data;
 
if (getenv("DEBUG"))
fprintf(stderr, "profile %s\n", file);
@@ -384,7 +389,7 @@ read_portage_env_file(const char *file, env_vars vars[])
d->d_name[strlen(d->d_name) - 1] == '~')
continue;
snprintf(npath, sizeof(npath), "%s/%s", file, 
d->d_name);
-   read_portage_env_file(npath, vars);
+   read_portage_file(npath, type, data);
}
scandir_free(dents, dentslen);
goto done;
@@ -402,84 +407,107 @@ read_portage_env_file(const char *file, env_vars vars[])
continue;
 
/* Handle "source" keyword */
-   if (strncmp(buf, "source ", 7) == 0) {
-   const char *sfile = buf + 7;
-   char npath[_Q_PATH_MAX * 2];
+   if (type == ENV_FILE) {
+   if (strncmp(buf, "source ", 7) == 0) {
+   const char *sfile = buf + 7;
+   char npath[_Q_PATH_MAX * 2];
 
-   if (sfile[0] != '/') {
-   /* handle relative paths */
-   size_t file_path_len;
+   if (sfile[0] != '/') {
+   /* handle relative paths */
+   size_t file_path_len;
 
-   s = strrchr(file, '/');
-   file_path_len = s - file + 1;
+   s = strrchr(file, '/');
+   file_path_len = s - file + 1;
 
-   snprintf(npath, sizeof(npath), "%.*s/%s",
-   (int)file_path_len, file, 
sfile);
-   sfile = npath;
-   }
-
-   read_portage_env_file(sfile, vars);
-   continue;
-   }
+   snprintf(npath, sizeof(npath), 
"%.*s/%s",
+   (int)file_path_len, 
file, sfile);
+   sfile = npath;
+   }
 
-   /* look for our desired variables and grab their value */
-   for (i = 0; vars[i].name; ++i) {
-   if (buf[vars[i].name_len] != '=' && 
buf[vars[i].name_len] != ' ')
-   continue;
-   if (strncmp(buf, vars[i].name, vars[i].name_len))
+   read_portage_file(sfile, type, data);
continue;
+   }
 
-   /* make sure we handle spaces between the varname, the 
=,
-* and the value:
-* VAR=val   VAR = val   VAR="val"
-*/
-   s = buf + vars[i].name_len;
-   if ((p = strchr(s, '=')) != 

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

2019-11-17 Thread Fabian Groffen
commit: f9eef8946dee223de1115e572633a7ddefa3197c
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sun Nov 17 15:02:30 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sun Nov 17 15:02:30 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=f9eef894

qlist: add -k option to operate on binpkgs

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

 man/include/qlist.desc |  3 ++-
 man/include/qlist.optdesc.yaml |  2 ++
 qlist.c| 22 +++---
 3 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/man/include/qlist.desc b/man/include/qlist.desc
index e02d971..e26d63d 100644
--- a/man/include/qlist.desc
+++ b/man/include/qlist.desc
@@ -3,4 +3,5 @@ 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.
+its name.  When no packages are given to match, \fIqlist\fR lists all
+installed packages.

diff --git a/man/include/qlist.optdesc.yaml b/man/include/qlist.optdesc.yaml
index 5fff904..30d8446 100644
--- a/man/include/qlist.optdesc.yaml
+++ b/man/include/qlist.optdesc.yaml
@@ -1,6 +1,8 @@
 installed: |
 Instead of listing the contents of a package, just print the package
 name if the package is currently installed.
+binpkgs: |
+Operate on binary packages instead of installed packges.
 umap: |
 List USE-flags enabled when the package was installed.  This flag
 implies \fB\-I\fR.

diff --git a/qlist.c b/qlist.c
index a97111d..30c0c6f 100644
--- a/qlist.c
+++ b/qlist.c
@@ -21,16 +21,16 @@
 #include "tree.h"
 #include "xregex.h"
 
-#define QLIST_FLAGS "ISRUcDeadosF:" COMMON_FLAGS
+#define QLIST_FLAGS "IkSRUcDedosF:" COMMON_FLAGS
 static struct option const qlist_long_opts[] = {
{"installed", no_argument, NULL, 'I'},
+   {"binpkgs",   no_argument, NULL, 'k'},
{"slots", no_argument, NULL, 'S'},
{"repo",  no_argument, NULL, 'R'},
{"umap",  no_argument, NULL, 'U'},
{"columns",   no_argument, NULL, 'c'},
{"showdebug", no_argument, NULL, 128},
{"exact", no_argument, NULL, 'e'},
-   {"all",   no_argument, NULL, 'a'},
{"dir",   no_argument, NULL, 'd'},
{"obj",   no_argument, NULL, 'o'},
{"sym",   no_argument, NULL, 's'},
@@ -40,13 +40,13 @@ static struct option const qlist_long_opts[] = {
 };
 static const char * const qlist_opts_help[] = {
"Just show installed package names",
+   "Use binpkgs instead of installed packages",
"Display installed packages with slots (use twice for subslots)",
"Display installed packages with repository",
"Display installed packages with flags used",
"Display column view",
"Show /usr/lib/debug and /usr/src/debug files",
"Exact match (only CAT/PN or PN without PV)",
-   "Show every installed package",
"Only show directories",
"Only show objects",
"Only show symlinks",
@@ -410,6 +410,7 @@ int qlist_main(int argc, char **argv)
int show_slots = 0;
bool show_repo = false;
bool do_columns = false;
+   bool do_binpkgs = false;
char qfmt[128];
struct qlist_opt_state state = {
.argc = argc,
@@ -430,8 +431,8 @@ int qlist_main(int argc, char **argv)
while ((i = GETOPT_LONG(QLIST, qlist, "")) != -1) {
switch (i) {
COMMON_GETOPTS_CASES(qlist)
-   case 'a': state.all = true; /* fall through */
case 'I': state.just_pkgname = true;break;
+   case 'k': do_binpkgs = true;break;
case 'S': state.just_pkgname = true; show_slots++;  break;
case 'R': state.just_pkgname = show_repo = true;break;
case 'U': state.just_pkgname = state.show_umap = true;  break;
@@ -448,8 +449,12 @@ int qlist_main(int argc, char **argv)
/* default to showing syms and objs */
if (!state.show_dir && !state.show_obj && !state.show_sym)
state.show_obj = state.show_sym = true;
-   if (argc == optind && !state.all)
-   qlist_usage(EXIT_FAILURE);
+   if (argc == optind) {
+   if (state.just_pkgname)
+   state.all = true;
+   else
+   qlist_usage(EXIT_FAILURE);
+   }
 
if (state.fmt == NULL) {
const char *l = "%[";
@@ -483,7 +488,10 @@ int qlist_main(int argc, char **argv)
state.buf = xmalloc(state.buflen);
state.atoms = xcalloc(argc - optind, sizeof(*state.atoms));
ret = 1;
-   vdb = tree_open_vdb(portroot, portvdb);
+   if (do_binpkgs)
+   vdb = 

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

2019-06-19 Thread Fabian Groffen
commit: 057ffaead77a168f14861b0cce51c69332ab4ae1
Author: Fabian Groffen  gentoo  org>
AuthorDate: Wed Jun 19 07:30:44 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Wed Jun 19 07:30:44 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=057ffaea

qdepends: make -qq with -Q just print list of packages

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

 man/include/qdepends-05-examples.include | 17 +
 man/include/qdepends.optdesc.yaml|  3 ++-
 man/qdepends.1   | 19 ++-
 qdepends.c   |  6 --
 4 files changed, 41 insertions(+), 4 deletions(-)

diff --git a/man/include/qdepends-05-examples.include 
b/man/include/qdepends-05-examples.include
index d3eac01..98ceb3a 100644
--- a/man/include/qdepends-05-examples.include
+++ b/man/include/qdepends-05-examples.include
@@ -17,3 +17,20 @@ can quickly see what specific dependency is expressed here.  
If
 the above had used \fIhttp://bugs.gentoo.org/
 .br

diff --git a/qdepends.c b/qdepends.c
index f5aa5a5..b5e8993 100644
--- a/qdepends.c
+++ b/qdepends.c
@@ -251,13 +251,15 @@ qdepends_results_cb(tree_pkg_ctx *pkg_ctx, void *priv)
 
if (!firstmatch) {
datom = 
tree_get_atom(pkg_ctx, true);
-   printf("%s:", 
atom_format(state->format, datom));
+   printf("%s%s", 
atom_format(state->format, datom),
+   quiet < 
2 ? ":" : "");
}
firstmatch = true;
 
snprintf(buf, sizeof(buf), 
"%s%s%s",
RED, 
atom_to_string(atom), NORM);
-   add_set_unique(buf, 
state->udeps, NULL);
+   if (quiet < 2)
+   add_set_unique(buf, 
state->udeps, NULL);
} else if (!quiet) {

add_set_unique(atom_to_string(atom),
state->udeps, 
NULL);



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

2019-06-12 Thread Fabian Groffen
commit: 753605792fab143ded32ebabbf85cc840151f0d2
Author: Fabian Groffen  gentoo  org>
AuthorDate: Wed Jun 12 09:11:44 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Wed Jun 12 09:11:44 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=75360579

quse: add mode for querying installed packages (only)

Instead of traversing the tree(s), look in the VDB (= installed
packages).  While doing this, when using -v, we can print the enabled
flags next to the flag and its description, as with `equery uses'.

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

 man/include/quse.optdesc.yaml |  4 +++
 man/quse.1|  7 +++-
 quse.c| 81 +++
 3 files changed, 76 insertions(+), 16 deletions(-)

diff --git a/man/include/quse.optdesc.yaml b/man/include/quse.optdesc.yaml
index 79a98fa..693aade 100644
--- a/man/include/quse.optdesc.yaml
+++ b/man/include/quse.optdesc.yaml
@@ -4,3 +4,7 @@ verbose: |
 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).

diff --git a/man/quse.1 b/man/quse.1
index 7f559fd..0a031ba 100644
--- a/man/quse.1
+++ b/man/quse.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH quse "1" "May 2019" "Gentoo Foundation" "quse"
+.TH quse "1" "Jun 2019" "Gentoo Foundation" "quse"
 .SH NAME
 quse \- find pkgs using useflags
 .SH SYNOPSIS
@@ -22,6 +22,11 @@ Use the LICENSE vs IUSE.
 \fB\-D\fR, \fB\-\-describe\fR
 Describe the USE flag.
 .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).
+.TP
 \fB\-p\fR \fI\fR, \fB\-\-package\fR \fI\fR
 Restrict matching to package or category.
 .TP

diff --git a/quse.c b/quse.c
index c7fbe81..751f767 100644
--- a/quse.c
+++ b/quse.c
@@ -21,17 +21,19 @@
 #include 
 #include 
 
+#include "set.h"
 #include "rmspace.h"
 #include "tree.h"
 #include "xarray.h"
 #include "xregex.h"
 
-#define QUSE_FLAGS "eaLDp:R" COMMON_FLAGS
+#define QUSE_FLAGS "eaLDIp:R" COMMON_FLAGS
 static struct option const quse_long_opts[] = {
{"exact", no_argument, NULL, 'e'},
{"all",   no_argument, NULL, 'a'},
{"license",   no_argument, NULL, 'L'},
{"describe",  no_argument, NULL, 'D'},
+   {"installed", no_argument, NULL, 'I'},
{"package",a_argument, NULL, 'p'},
{"repo",  no_argument, NULL, 'R'},
COMMON_LONG_OPTS
@@ -41,6 +43,7 @@ static const char * const quse_opts_help[] = {
"List all ebuilds, don't match anything",
"Use the LICENSE vs IUSE",
"Describe the USE flag",
+   "Only search installed packages",
"Restrict matching to package or category",
"Show repository the ebuild originates from",
COMMON_OPTS_HELP
@@ -56,6 +59,7 @@ struct quse_state {
bool do_regex:1;
bool do_describe:1;
bool do_licence:1;
+   bool do_installed:1;
bool do_list:1;
bool do_repo:1;
depend_atom *match;
@@ -407,6 +411,7 @@ quse_results_cb(tree_pkg_ctx *pkg_ctx, void *priv)
depend_atom *atom = NULL;  /* pacify compiler */
char buf[8192];
tree_pkg_meta *meta;
+   set *use = NULL;
bool match;
char *p;
char *q;
@@ -432,16 +437,44 @@ quse_results_cb(tree_pkg_ctx *pkg_ctx, void *priv)
}
}
 
-   meta = tree_pkg_read(pkg_ctx);
-   if (meta == NULL)
-   return 0;
+   if (state->overlay != NULL) {
+   meta = tree_pkg_read(pkg_ctx);
+   if (meta == NULL)
+   return 0;
+   if (meta->IUSE == NULL)
+   return 0;
+   } else {
+   size_t dummy;
 
-   if (meta->IUSE == NULL)
-   return 0;
+   meta = xzalloc(sizeof(*meta));
+
+   dummy = 0;
+   if (!tree_pkg_vdb_eat(pkg_ctx, "IUSE", >IUSE, )) {
+   free(meta);
+   return 0;
+   }
+
+   dummy = 0;
+   tree_pkg_vdb_eat(pkg_ctx, "LICENSE", >LICENSE, );
+
+   s = NULL;
+   dummy = 0;
+   tree_pkg_vdb_eat(pkg_ctx, "USE", , );
+   p = s;
+   while ((q = strchr(p, (int)' ')) != NULL) {
+   *q++ = '\0';
+   use = add_set(p, use);
+   p = q;
+   }
+   if (*p != '\0')
+   use = add_set(p, use);
+ 

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

2019-05-17 Thread Fabian Groffen
commit: e7fd910eb6b95031261d4f8878bc97ca7818a9e2
Author: Fabian Groffen  gentoo  org>
AuthorDate: Fri May 17 11:54:55 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Fri May 17 11:54:55 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=e7fd910e

man/q: document -r/-m (cache) opts were removed

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

 man/include/q.desc | 8 
 man/q.1| 9 -
 2 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/man/include/q.desc b/man/include/q.desc
new file mode 100644
index 000..7109c46
--- /dev/null
+++ b/man/include/q.desc
@@ -0,0 +1,8 @@
+.I q
+is a collection of utilities for use with Gentoo systems regarding
+installed and available packages.
+.P
+After version 0.74 of portage-utils, the cache functionality was removed
+in favour of using various trees directly, and optionally the caches
+therein.  As such the \fB-r\fR and \fB-m\fR options were removed.  It is
+no longer necessary to initialise the cache at any time.

diff --git a/man/q.1 b/man/q.1
index cbf2303..92794a2 100644
--- a/man/q.1
+++ b/man/q.1
@@ -6,7 +6,14 @@ q \- invoke a portage utility applet
 .B q
 \fI  \fR
 .SH DESCRIPTION
-
+.I q
+is a collection of utilities for use with Gentoo systems regarding
+installed and available packages.
+.P
+After version 0.74 of portage-utils, the cache functionality was removed
+in favour of using various trees directly, and optionally the caches
+therein.  As such the \fB-r\fR and \fB-m\fR options were removed.  It is
+no longer necessary to initialise the cache at any time.
 .SH OPTIONS
 .TP
 \fB\-i\fR, \fB\-\-install\fR



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

2019-05-14 Thread Fabian Groffen
commit: 659a6f66ea87ba72faab6d24006987c16316cd82
Author: Fabian Groffen  gentoo  org>
AuthorDate: Tue May 14 20:19:17 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Tue May 14 20:19:17 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=659a6f66

qdepends: allow querying ebuild trees

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

 TODO.md   |   2 -
 man/include/qdepends.desc |   4 +-
 man/include/qdepends.optdesc.yaml |   3 +-
 man/qdepends.1|  13 +++--
 qdepends.c| 109 +++---
 5 files changed, 104 insertions(+), 27 deletions(-)

diff --git a/TODO.md b/TODO.md
index ccff6e0..88d232f 100644
--- a/TODO.md
+++ b/TODO.md
@@ -59,9 +59,7 @@
 
 # qdepends
 
-- support querying uninstalled packages (via libq/cache)
 - add -S/-v/-R behavior like qlist #574934
-- support printing full dep content (with -v?) from libq/cache
 - bring back -k?  (but seems solved by using qlist -IF%{SLOT} pkg)
 
 # qpkg

diff --git a/man/include/qdepends.desc b/man/include/qdepends.desc
index b9954c9..19000d0 100644
--- a/man/include/qdepends.desc
+++ b/man/include/qdepends.desc
@@ -12,8 +12,8 @@ option.
 .P
 Currently,
 .I qdepends
-will only query installed packages.  There is no support for
-querying packages not yet installed (see \fBequery\fR(1) for that).
+defaults to query installed packages.  To query packages from ebuild
+trees, use the \fB-t\fR option.
 .P
 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

diff --git a/man/include/qdepends.optdesc.yaml 
b/man/include/qdepends.optdesc.yaml
index f317227..0c8ef6b 100644
--- a/man/include/qdepends.optdesc.yaml
+++ b/man/include/qdepends.optdesc.yaml
@@ -25,6 +25,7 @@ format: |
 verbose: |
 Pretty-print atoms output, per DEPEND-variable.  This is much like
 the \fB-f\fR option, but uses as input the dependency info from the
-matches.
+matches.  When used with \fB-t\fR, the atom highlighting matches
+what is used by the installed package, if available.
 quiet: Suppress DEPEND= output for \fB\-f\fR.  Only print the matching
 atom for \fB\-Q\fR.

diff --git a/man/qdepends.1 b/man/qdepends.1
index bee3bc1..d498680 100644
--- a/man/qdepends.1
+++ b/man/qdepends.1
@@ -20,8 +20,8 @@ option.
 .P
 Currently,
 .I qdepends
-will only query installed packages.  There is no support for
-querying packages not yet installed (see \fBequery\fR(1) for that).
+defaults to query installed packages.  To query packages from ebuild
+trees, use the \fB-t\fR option.
 .P
 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
@@ -58,6 +58,12 @@ 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
+\fB\-i\fR, \fB\-\-installed\fR
+Search installed packages using VDB.
+.TP
+\fB\-t\fR, \fB\-\-tree\fR
+Search available ebuilds in the tree.
+.TP
 \fB\-F\fR \fI\fR, \fB\-\-format\fR \fI\fR
 Pretty-print DEPEND declaration to be used in an ebuild.  This
 option initiates a very different mode of operation.  Instead of
@@ -78,7 +84,8 @@ Set the ROOT env var.
 \fB\-v\fR, \fB\-\-verbose\fR
 Pretty-print atoms output, per DEPEND-variable.  This is much like
 the \fB-f\fR option, but uses as input the dependency info from the
-matches.
+matches.  When used with \fB-t\fR, the atom highlighting matches
+what is used by the installed package, if available.
 .TP
 \fB\-q\fR, \fB\-\-quiet\fR
 Suppress DEPEND= output for \fB\-f\fR.  Only print the matching atom for 
\fB\-Q\fR.

diff --git a/qdepends.c b/qdepends.c
index 15d5253..4e6fd43 100644
--- a/qdepends.c
+++ b/qdepends.c
@@ -22,13 +22,15 @@
 #include "xasprintf.h"
 #include "xregex.h"
 
-#define QDEPENDS_FLAGS "drpbQF:S" COMMON_FLAGS
+#define QDEPENDS_FLAGS "drpbQitF:S" 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'},
{"query", no_argument, NULL, 'Q'},
+   {"installed", no_argument, NULL, 'i'},
+   {"tree",  no_argument, NULL, 't'},
{"format", a_argument, NULL, 'F'},
{"pretty",no_argument, NULL, 'S'},
COMMON_LONG_OPTS
@@ -39,6 +41,8 @@ static const char * const qdepends_opts_help[] = {
"Show PDEPEND info",
"Show BDEPEND info",
"Query reverse deps",
+   "Search installed packages using VDB",
+   "Search available ebuilds in the tree",
"Print matched atom using given format string",
"Pretty format specified depend strings",
COMMON_OPTS_HELP
@@ -54,12 

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

2019-05-05 Thread Fabian Groffen
commit: 73915971f03cabcbb64accab0c65a14d01904dd5
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sun May  5 20:04:40 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sun May  5 20:04:40 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=73915971

qdepends: allow custom formatting

This isn't yet fully useful, since information like SLOT, REPO, etc.
isn't available in the parsed atoms.

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

 TODO.md   |  2 +-
 man/include/qdepends.desc |  4 +++-
 man/qdepends.1| 12 +++-
 qdepends.c| 43 +++
 tests/qdepends/dotest |  2 +-
 5 files changed, 31 insertions(+), 32 deletions(-)

diff --git a/TODO.md b/TODO.md
index e433123..bc4f524 100644
--- a/TODO.md
+++ b/TODO.md
@@ -10,7 +10,7 @@
 
 - standardize/unify/clean up misc handling of colors
   define rules:
-BOLD CATEGORY/ BLUE PKG GREEN ::REPO NORM [ MAGENTA USE NORM ]
+BOLD CATEGORY/ BLUE PKG BKBLUE -VER YELLOW :SLOT GREEN ::REPO NORM [ 
MAGENTA USE NORM ]
 
 - remove odd rmspace for each string in libq/set.c (allows a lot less
   malloc/frees)

diff --git a/man/include/qdepends.desc b/man/include/qdepends.desc
index 070032e..b9954c9 100644
--- a/man/include/qdepends.desc
+++ b/man/include/qdepends.desc
@@ -27,4 +27,6 @@ dependencies for the package are shown.  When colours are 
enabled, the
 matched atom is highlighted in the list.  In addition to just querying
 DEPEND, the default mode changed to query all DEPEND-variables, and
 return the unique atoms found in them.  Automatic regular expression
-match support was removed.
+match support was removed.  The \fB-N\fR option was removed, as the same
+effect can be achieved via the new \fB-F\fR option or \fB-q\fR option.
+The \fB-f\fR option was renamed to \fB-S\fR.

diff --git a/man/qdepends.1 b/man/qdepends.1
index 1020b9a..bee3bc1 100644
--- a/man/qdepends.1
+++ b/man/qdepends.1
@@ -35,7 +35,9 @@ dependencies for the package are shown.  When colours are 
enabled, the
 matched atom is highlighted in the list.  In addition to just querying
 DEPEND, the default mode changed to query all DEPEND-variables, and
 return the unique atoms found in them.  Automatic regular expression
-match support was removed.
+match support was removed.  The \fB-N\fR option was removed, as the same
+effect can be achieved via the new \fB-F\fR option or \fB-q\fR option.
+The \fB-f\fR option was renamed to \fB-S\fR.
 .SH OPTIONS
 .TP
 \fB\-d\fR, \fB\-\-depend\fR
@@ -56,10 +58,7 @@ 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
-\fB\-N\fR, \fB\-\-name\-only\fR
-Only show category/package, instead of category/package-version.
-.TP
-\fB\-f\fR, \fB\-\-format\fR
+\fB\-F\fR \fI\fR, \fB\-\-format\fR \fI\fR
 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
@@ -70,6 +69,9 @@ 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.
 .TP
+\fB\-S\fR, \fB\-\-pretty\fR
+Pretty format specified depend strings.
+.TP
 \fB\-\-root\fR \fI\fR
 Set the ROOT env var.
 .TP

diff --git a/qdepends.c b/qdepends.c
index 09156f6..9cfe095 100644
--- a/qdepends.c
+++ b/qdepends.c
@@ -22,15 +22,15 @@
 #include "xasprintf.h"
 #include "xregex.h"
 
-#define QDEPENDS_FLAGS "drpbfNQu" COMMON_FLAGS
+#define QDEPENDS_FLAGS "drpbQF:S" 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'},
{"query", no_argument, NULL, 'Q'},
-   {"name-only", no_argument, NULL, 'N'},
-   {"format",no_argument, NULL, 'f'},
+   {"format", a_argument, NULL, 'F'},
+   {"pretty",no_argument, NULL, 'S'},
COMMON_LONG_OPTS
 };
 static const char * const qdepends_opts_help[] = {
@@ -39,14 +39,12 @@ static const char * const qdepends_opts_help[] = {
"Show PDEPEND info",
"Show BDEPEND info",
"Query reverse deps",
-   "Only show package name",
+   "Print matched atom using given format string",
"Pretty format specified depend strings",
COMMON_OPTS_HELP
 };
 #define qdepends_usage(ret) usage(ret, QDEPENDS_FLAGS, qdepends_long_opts, 
qdepends_opts_help, NULL, lookup_applet_idx("qdepends"))
 
-static char qdep_name_only = 0;
-
 /* structures / types / etc ... */
 struct qdepends_opt_state {
unsigned char qmode;
@@ -55,6 +53,7 @@ struct qdepends_opt_state {
set *udeps;
char *depend;

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

2019-05-05 Thread Fabian Groffen
commit: f4eb959a8a9f7b52d52c7842f53dccff8bea2699
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sun May  5 08:57:41 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sun May  5 08:57:41 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=f4eb959a

qkeyword: add --matchmaint/-m flag, bug #685052

Add option to match against maintainer email address listed in
package metadata.xml.

Closes: https://bugs.gentoo.org/685052
Signed-off-by: Fabian Groffen  gentoo.org>

 TODO.md   |  7 +++
 man/include/qkeyword.desc | 11 +++
 man/qkeyword.1| 14 ++
 qkeyword.c| 21 -
 4 files changed, 52 insertions(+), 1 deletion(-)

diff --git a/TODO.md b/TODO.md
index 0d05670..e433123 100644
--- a/TODO.md
+++ b/TODO.md
@@ -90,3 +90,10 @@
 # quse
 - make -v only print requested USE-flag when flags given
 - read VDB on -v to print details about current USE-flag status, bug #656550
+
+# qkeyword
+- avoid multiple atom\_explode in path traversal
+  * during qkeyword\_vercmp
+  * during qkeyword\_results\_cb
+  * in libq/cache\_read\_metadata
+- drop -c argument? it can be fully expressed using -p cat/

diff --git a/man/include/qkeyword.desc b/man/include/qkeyword.desc
index 3bbfb43..b7a863c 100644
--- a/man/include/qkeyword.desc
+++ b/man/include/qkeyword.desc
@@ -1,3 +1,14 @@
 \fIqkeyword\fR allows various searches based on KEYWORDS aimed at Gentoo
 developers.  Various modes allow to query which packages would be
 available, or are candidate for keywording.
+.P
+By default, the entire tree is traversed.  Since this process can be
+slow, or result in too many results, the match arguments can be used to
+reduce the set of packages evaluated.  \fB-p\fR and \fB-c\fR match
+package name and category respectively.  They can both be used at the
+same time, but \fB-p\fR accepts regular atom format, including version
+and/or range.  Hence, \fB-p\fR can be used to set both category as well
+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.

diff --git a/man/qkeyword.1 b/man/qkeyword.1
index d32e771..d91bc77 100644
--- a/man/qkeyword.1
+++ b/man/qkeyword.1
@@ -9,6 +9,17 @@ qkeyword \- list packages based on keywords
 \fIqkeyword\fR allows various searches based on KEYWORDS aimed at Gentoo
 developers.  Various modes allow to query which packages would be
 available, or are candidate for keywording.
+.P
+By default, the entire tree is traversed.  Since this process can be
+slow, or result in too many results, the match arguments can be used to
+reduce the set of packages evaluated.  \fB-p\fR and \fB-c\fR match
+package name and category respectively.  They can both be used at the
+same time, but \fB-p\fR accepts regular atom format, including version
+and/or range.  Hence, \fB-p\fR can be used to set both category as well
+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.
 .SH OPTIONS
 .TP
 \fB\-p\fR \fI\fR, \fB\-\-matchpkg\fR \fI\fR
@@ -17,6 +28,9 @@ match pkgname.
 \fB\-c\fR \fI\fR, \fB\-\-matchcat\fR \fI\fR
 match catname.
 .TP
+\fB\-m\fR \fI\fR, \fB\-\-matchmaint\fR \fI\fR
+match maintainer email from metadata.xml (slow).
+.TP
 \fB\-i\fR, \fB\-\-imlate\fR
 list packages that can be marked stable on a given arch.
 .TP

diff --git a/qkeyword.c b/qkeyword.c
index ffcd6ae..e8fb5d6 100644
--- a/qkeyword.c
+++ b/qkeyword.c
@@ -28,10 +28,11 @@
 /* Required portage-utils stuff */
 //
 
-#define QKEYWORD_FLAGS "p:c:idtans" COMMON_FLAGS
+#define QKEYWORD_FLAGS "p:c:m:idtans" COMMON_FLAGS
 static struct option const qkeyword_long_opts[] = {
{"matchpkg", a_argument, NULL, 'p'},
{"matchcat", a_argument, NULL, 'c'},
+   {"matchmaint", a_argument, NULL, 'm'},
{"imlate",  no_argument, NULL, 'i'},
{"dropped", no_argument, NULL, 'd'},
{"testing", no_argument, NULL, 't'},
@@ -43,6 +44,7 @@ static struct option const qkeyword_long_opts[] = {
 static const char * const qkeyword_opts_help[] = {
"match pkgname",
"match catname",
+   "match maintainer email from metadata.xml (slow)",
"list packages that can be marked stable on a given arch",
"list packages that have dropped keywords on a version bump on a given 
arch",
"list packages that have ~arch versions, but no stable versions on a 
given arch",
@@ -56,6 +58,7 @@ static const char * const qkeyword_opts_help[] = {
 typedef struct {
depend_atom *qatom;
   

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

2019-05-04 Thread Fabian Groffen
commit: 3157f0fd47930f8604c6cc668906b3131dcc15d7
Author: Fabian Groffen  gentoo  org>
AuthorDate: Fri May  3 17:20:51 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Fri May  3 17:20:51 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=3157f0fd

qkeyword.1: add description

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

 man/include/qkeyword.desc | 3 +++
 man/qkeyword.1| 4 +++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/man/include/qkeyword.desc b/man/include/qkeyword.desc
new file mode 100644
index 000..3bbfb43
--- /dev/null
+++ b/man/include/qkeyword.desc
@@ -0,0 +1,3 @@
+\fIqkeyword\fR allows various searches based on KEYWORDS aimed at Gentoo
+developers.  Various modes allow to query which packages would be
+available, or are candidate for keywording.

diff --git a/man/qkeyword.1 b/man/qkeyword.1
index a575404..d32e771 100644
--- a/man/qkeyword.1
+++ b/man/qkeyword.1
@@ -6,7 +6,9 @@ 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
+available, or are candidate for keywording.
 .SH OPTIONS
 .TP
 \fB\-p\fR \fI\fR, \fB\-\-matchpkg\fR \fI\fR



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

2019-04-28 Thread Fabian Groffen
commit: 30249c7fa6be35ae2a35fbab6381d2c51b772187
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sun Apr 28 08:00:38 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sun Apr 28 08:00:38 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=30249c7f

man/qgrep: use bold instead of italics for program refs

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

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

diff --git a/man/include/qgrep.desc b/man/include/qgrep.desc
index 98bcc09..e6bcf43 100644
--- a/man/include/qgrep.desc
+++ b/man/include/qgrep.desc
@@ -3,4 +3,4 @@ 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).
+to match an entire category.  See also \fBqatom\fR(1).

diff --git a/man/qgrep.1 b/man/qgrep.1
index 048e28e..347c88c 100644
--- a/man/qgrep.1
+++ b/man/qgrep.1
@@ -11,7 +11,7 @@ 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).
+to match an entire category.  See also \fBqatom\fR(1).
 .SH OPTIONS
 .TP
 \fB\-I\fR, \fB\-\-invert\-match\fR



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

2019-04-12 Thread Fabian Groffen
commit: 26397171ecf098661502d86f9c6cde45ec70d180
Author: Fabian Groffen  gentoo  org>
AuthorDate: Fri Apr 12 18:48:17 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Fri Apr 12 18:48:17 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=26397171

qlist: change behaviour to use colours and no parenthesis

- in list mode, show colours by default (can be disabled in the
  normal way using -C)
- in USE-flag mode, don't output ( ) so the output is compatible with
  e.g. package.use

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

 man/include/qlist.optdesc.yaml |  9 +++--
 man/qlist.1| 11 +--
 qlist.c| 31 ---
 3 files changed, 24 insertions(+), 27 deletions(-)

diff --git a/man/include/qlist.optdesc.yaml b/man/include/qlist.optdesc.yaml
index 2b9299c..5fff904 100644
--- a/man/include/qlist.optdesc.yaml
+++ b/man/include/qlist.optdesc.yaml
@@ -16,9 +16,6 @@ columns: |
 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.  Shows disabled USE-flags when used with \fB\-U\fR.
-quiet: |
-Suppresses the parenthesis around the USE-flags when used with \fB\-U\fR.
+When listing the package contents, \fB\-v\fR displays symlinks with
+an arrow (\->) to their target.  Shows disabled USE-flags when used
+with \fB\-U\fR.

diff --git a/man/qlist.1 b/man/qlist.1
index 4df7dab..0b16318 100644
--- a/man/qlist.1
+++ b/man/qlist.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qlist "1" "Mar 2019" "Gentoo Foundation" "qlist"
+.TH qlist "1" "Apr 2019" "Gentoo Foundation" "qlist"
 .SH NAME
 qlist \- list files owned by pkgname
 .SH SYNOPSIS
@@ -57,13 +57,12 @@ Set the ROOT env var.
 .TP
 \fB\-v\fR, \fB\-\-verbose\fR
 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.  Shows disabled USE-flags when used with \fB\-U\fR.
+When listing the package contents, \fB\-v\fR displays symlinks with
+an arrow (\->) to their target.  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.
+Tighter output; suppress warnings.
 .TP
 \fB\-C\fR, \fB\-\-nocolor\fR
 Don't output color.

diff --git a/qlist.c b/qlist.c
index d46e0a6..313ff56 100644
--- a/qlist.c
+++ b/qlist.c
@@ -88,11 +88,11 @@ cmpstringp(const void *p1, const void *p2)
  * -redis -sasl (-selinux) -sqlite -srs -syslog" 0 KiB
  *
  * % qlist -IUv exim
- * mail-mta/exim-4.92 (-arc -dane -dcc dkim -dlfunc dmarc dnsdb -doc
+ * 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)
+ * -X
  */
 static char _umapstr_buf[BUFSIZ];
 static const char *
@@ -134,8 +134,7 @@ umapstr(char display, q_vdb_pkg_ctx *pkg_ctx)
 
 #define add_to_buf(fmt, Cb, use, Ce) \
bufp += snprintf(bufp, sizeof(_umapstr_buf) - (bufp - _umapstr_buf), \
-   " %s%s" fmt "%s", \
-   bufp == _umapstr_buf && !quiet ? "(" : "", Cb, use, Ce);
+   " %s" fmt "%s", Cb, use, Ce);
 
/* merge join, ensure inputs are sorted (Portage does this, but just
 * to be sure) */
@@ -163,9 +162,6 @@ umapstr(char display, q_vdb_pkg_ctx *pkg_ctx)
}
}
 
-   bufp += snprintf(bufp, sizeof(_umapstr_buf) - (bufp - _umapstr_buf),
-   "%s", bufp == _umapstr_buf || quiet ? "" : ")");
-
freeargv(iuse_argc, iuse_argv);
freeargv(use_argc, use_argv);
free(iuse);
@@ -352,7 +348,8 @@ qlist_cb(q_vdb_pkg_ctx *pkg_ctx, void *priv)
 
/* see if this cat/pkg is requested */
for (i = optind; i < state->argc; ++i)
-   if (qlist_match(pkg_ctx, state->argv[i], >atoms[i - 
optind], state->exact))
+   if (qlist_match(pkg_ctx, state->argv[i],
+   >atoms[i - optind], 
state->exact))
break;
if ((i == state->argc) && (state->argc != optind))
return 0;
@@ -362,7 +359,8 @@ qlist_cb(q_vdb_pkg_ctx *pkg_ctx, void *priv)
atom = (verbose ? NULL : atom_explode(pkgname));
if ((state->all + state->just_pkgname) < 2) {
if (state->show_slots && 

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

2019-04-08 Thread Fabian Groffen
commit: 692759d4e74b958dff78f86a53a3b56f4920a980
Author: Fabian Groffen  gentoo  org>
AuthorDate: Mon Apr  8 08:56:21 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Mon Apr  8 08:56:21 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=692759d4

qdepends: update manpage for rewrite

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

 man/include/qdepends-05-examples.include | 20 +++-
 man/include/qdepends.desc| 33 ++
 man/include/qdepends.optdesc.yaml| 11 +++--
 man/qdepends.1   | 78 
 qdepends.c   |  6 +--
 5 files changed, 79 insertions(+), 69 deletions(-)

diff --git a/man/include/qdepends-05-examples.include 
b/man/include/qdepends-05-examples.include
index 04fb92f..d3eac01 100644
--- a/man/include/qdepends-05-examples.include
+++ b/man/include/qdepends-05-examples.include
@@ -1,25 +1,19 @@
 .SH "EXAMPLES"
 For finding out what a particular package depends on for building, you could 
do:
 .nf
-   $ \fIqdepends nano\fR
+   $ \fIqdepends -d nano\fR
app-editors/nano-2.3.2: >=sys-libs/ncurses-5.9-r1[unicode] 
sys-apps/file ...
 .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:
+.P
+Searching for packages that actually depend on logrotate:
 .nf
-   $ \fIqdepends -rQ nano\fR
-   virtual/editor-0
+   $ \fIqdepends -qQ 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 \fB-q\fR flag suppresses the entire list of dependencies here, so we
+can quickly see what specific dependency is expressed here.  If
 the above had used \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, \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
+\fB\-Q\fR, \fB\-\-query\fR
 Query reverse deps.  This basically reverses the search to any
 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
@@ -50,14 +59,11 @@ search for packages that have \fIlogwatch\fR in their 
DEPEND.
 \fB\-N\fR, \fB\-\-name\-only\fR
 Only show category/package, instead of category/package-version.
 .TP
-\fB\-a\fR, \fB\-\-all\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
 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
+statement 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
@@ -68,12 +74,12 @@ e.g.\ the DEPEND= part is skipped.
 Set the ROOT env var.
 .TP
 \fB\-v\fR, \fB\-\-verbose\fR
-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.
+Pretty-print atoms output, per DEPEND-variable.  This is much like
+the \fB-f\fR option, but uses as input the dependency info from the
+matches.
 .TP
 \fB\-q\fR, \fB\-\-quiet\fR
-Suppress DEPEND= output for \fB\-f\fR.
+Suppress DEPEND= output for \fB\-f\fR.  Only print the matching atom for 
\fB\-Q\fR.
 .TP
 \fB\-C\fR, \fB\-\-nocolor\fR
 Don't output color.
@@ -86,25 +92,19 @@ Print version and exit.
 .SH "EXAMPLES"
 For finding out what a particular package depends on for building, you could 
do:
 .nf
-   $ \fIqdepends nano\fR
+   $ \fIqdepends -d nano\fR
app-editors/nano-2.3.2: >=sys-libs/ncurses-5.9-r1[unicode] 
sys-apps/file ...
 .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.
+.P
+Searching for packages that actually depend on logrotate:
 .nf
-   $ \fIqdepends -vrQ logrotate\fR
-   sys-apps/portage-2.3.18: >=app-admin/logrotate-3.8.0
+   $ \fIqdepends -qQ logrotate\fR
+   sys-apps/portage-2.3.18: !PN : pkgname, NORM,
-   quiet ? 
"" : ":");
+   

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

2018-05-18 Thread Fabian Groffen
commit: 04b4c6834fd83bf0329198c56894bd7dad6f7a6a
Author: Fabian Groffen  gentoo  org>
AuthorDate: Fri May 18 10:12:40 2018 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Fri May 18 10:12:40 2018 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=04b4c683

qtegrity: new applet by Sam Besselink for use with IMA, bug #619988

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

 applets.h  |   7 +-
 man/include/qtegrity-70-relevant-files.include |   9 +
 man/include/qtegrity-authors.include   |   1 +
 man/include/qtegrity.desc  |   8 +
 man/qtegrity.1 |  81 
 qtegrity.c | 509 +
 6 files changed, 614 insertions(+), 1 deletion(-)

diff --git a/applets.h b/applets.h
index 93146c6..daf7047 100644
--- a/applets.h
+++ b/applets.h
@@ -31,6 +31,7 @@ DECLARE_APPLET(qatom)
 DECLARE_APPLET(qmerge)
 DECLARE_APPLET(qcache)
 DECLARE_APPLET(qglsa) /* disable */
+DECLARE_APPLET(qtegrity)
 #undef DECLARE_APPLET
 
 #define DEFINE_APPLET_STUB(applet) \
@@ -62,8 +63,9 @@ static const struct applet_t {
{"qtbz2", qtbz2_main, "", "manipulate tbz2 
packages"},
{"quse",  quse_main,  "",   "find pkgs using 
useflags"},
{"qxpak", qxpak_main, "", "manipulate xpak 
archives"},
+   {"qtegrity",  qtegrity_main,  "", "verify files with 
IMA"},
 
-   /* aliases for equery capatability */
+   /* aliases for equery compatibility */
{"belongs",   qfile_main, NULL, NULL},
/*"changes"*/
{"check", qcheck_main,NULL, NULL},
@@ -82,6 +84,9 @@ static const struct applet_t {
{"uickpkg",   qpkg_main,  NULL, NULL},
/* {"glsa",  qglsa_main, NULL, NULL}, */
 
+   /* alias for qtegrity */
+   {"integrity", qtegrity_main,  NULL, NULL},
+
{NULL, NULL, NULL, NULL}
 };
 

diff --git a/man/include/qtegrity-70-relevant-files.include 
b/man/include/qtegrity-70-relevant-files.include
new file mode 100644
index 000..742658f
--- /dev/null
+++ b/man/include/qtegrity-70-relevant-files.include
@@ -0,0 +1,9 @@
+.SH RELEVANT FILES
+.PP
+Central list of known good digests
+.nf\fI
+   /var/db/QTEGRITY\fi
+.PP
+Linux kernel's recorded digests
+.nf\fI
+   /sys/kernel/security/ima/ascii_runtime_measurements\fi

diff --git a/man/include/qtegrity-authors.include 
b/man/include/qtegrity-authors.include
new file mode 100644
index 000..160ea6a
--- /dev/null
+++ b/man/include/qtegrity-authors.include
@@ -0,0 +1 @@
+Sam Besselink

diff --git a/man/include/qtegrity.desc b/man/include/qtegrity.desc
new file mode 100644
index 000..5f9029b
--- /dev/null
+++ b/man/include/qtegrity.desc
@@ -0,0 +1,8 @@
+The default behavior of \fBqtegrity\fP is to verify digests of performed
+executables to a list of known good digests. This requires an IMA-enabled
+linux kernel, which records digests of performed executables and exports them
+through securityfs. Using \fB\-\-ignore-non-existent\fP suppresses messages
+about recorded files that can't be accessed (assuming they got removed).
+By using \fB\-\-add\fP, the program behaves differently. No verification is
+performed, instead a digest is made of the provided file and appended to
+the list of known good digests.

diff --git a/man/qtegrity.1 b/man/qtegrity.1
new file mode 100644
index 000..76ed731
--- /dev/null
+++ b/man/qtegrity.1
@@ -0,0 +1,81 @@
+.\" generated by mkman.py, please do NOT edit!
+.TH qtegrity "1" "May 2018" "Gentoo Foundation" "qtegrity"
+.SH NAME
+qtegrity \- verify files with IMA
+.SH SYNOPSIS
+.B qtegrity
+\fI[opts] \fR
+.SH DESCRIPTION
+The default behavior of \fBqtegrity\fP is to verify digests of performed
+executables to a list of known good digests. This requires an IMA-enabled
+linux kernel, which records digests of performed executables and exports them
+through securityfs. Using \fB\-\-ignore-non-existent\fP suppresses messages
+about recorded files that can't be accessed (assuming they got removed).
+By using \fB\-\-add\fP, the program behaves differently. No verification is
+performed, instead a digest is made of the provided file and appended to
+the list of known good digests.
+.SH OPTIONS
+.TP
+\fB\-a\fR \fI\fR, \fB\-\-add\fR \fI\fR
+Add file to store of known-good digests.
+.TP
+\fB\-i\fR, \fB\-\-ignore\-non\-existent\fR
+Be silent if recorded file no longer exists.
+.TP
+\fB\-s\fR, \fB\-\-show\-matches\fR
+Show recorded digests that match with known-good digests.
+.TP
+\fB\-\-root\fR \fI\fR
+Set the ROOT env var.
+.TP
+\fB\-v\fR, \fB\-\-verbose\fR
+Make a lot of noise.
+.TP
+\fB\-q\fR, \fB\-\-quiet\fR
+Tighter output; suppress warnings.
+.TP
+\fB\-C\fR, \fB\-\-nocolor\fR
+Don't output color.
+.TP
+\fB\-h\fR, \fB\-\-help\fR
+Print this help and exit.
+.TP
+\fB\-V\fR, \fB\-\-version\fR
+Print version and exit.
+.SH RELEVANT FILES
+.PP
+Central list of 

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

2018-05-18 Thread Fabian Groffen
commit: 213b183db62d05fc918f323098b19ac260fc2a3c
Author: Fabian Groffen  gentoo  org>
AuthorDate: Fri May 18 10:08:12 2018 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Fri May 18 10:08:12 2018 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=213b183d

mkman.py: add additional authors to main authors section

 man/include/qfile-99-authors.include | 4 
 man/include/qfile-authors.include| 1 +
 man/mkman.py | 5 -
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/man/include/qfile-99-authors.include 
b/man/include/qfile-99-authors.include
deleted file mode 100644
index df3dc39..000
--- a/man/include/qfile-99-authors.include
+++ /dev/null
@@ -1,4 +0,0 @@
-.SH "ADDITIONAL CONTRIBUTORS"
-.nf
-TGL degrenier[at]easyconnect.fr
-.fi

diff --git a/man/include/qfile-authors.include 
b/man/include/qfile-authors.include
new file mode 100644
index 000..d90fe2a
--- /dev/null
+++ b/man/include/qfile-authors.include
@@ -0,0 +1 @@
+TGL 

diff --git a/man/mkman.py b/man/mkman.py
index 8444311..7089320 100755
--- a/man/mkman.py
+++ b/man/mkman.py
@@ -139,7 +139,10 @@ def MkMan(applets, applet, output):
 # Handle any fragments this applet has available
 for frag in sorted(glob.glob(os.path.join(FRAGS_DIR, '%s-*.include' % 
applet))):
 with open(frag) as f:
-extra_sections += [x.rstrip() for x in f.readlines()]
+if "-authors." in frag:
+authors += [x.rstrip() for x in f.readlines()]
+else:
+extra_sections += [x.rstrip() for x in f.readlines()]
 
 data = {
 'applet': applet,



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

2018-04-15 Thread Fabian Groffen
commit: 23c09a20dfcc044343b16bfe4b5873f663a46286
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sun Apr 15 12:03:14 2018 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sun Apr 15 12:03:14 2018 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=23c09a20

qfile: fix matching of files

A bit overenthusiastic check for files in the current directory caused
weird directory prefixes to be ignored.

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

 man/include/qfile-01-owners.include |  9 ++--
 qfile.c | 94 ++---
 2 files changed, 60 insertions(+), 43 deletions(-)

diff --git a/man/include/qfile-01-owners.include 
b/man/include/qfile-01-owners.include
index c9ce378..a4bdc76 100644
--- a/man/include/qfile-01-owners.include
+++ b/man/include/qfile-01-owners.include
@@ -1,13 +1,14 @@
-.SH "FINDING FILES OWNERS"
+.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.
+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 adds a few warnings.  The return status of 
+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.
 .PP
@@ -19,7 +20,7 @@ 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 bash
+   $ qfile -b bash
app-shells/bash (/bin/bash)
app-shells/bash (/etc/bash)
 .fi

diff --git a/qfile.c b/qfile.c
index 08ba642..285277b 100644
--- a/qfile.c
+++ b/qfile.c
@@ -118,66 +118,73 @@ static int qfile_cb(q_vdb_pkg_ctx *pkg_ctx, void *priv)
goto qlist_done;
 
while (getline(>buf, >buflen, fp) != -1) {
+   size_t dirname_len;
contents_entry *e;
+
e = contents_parse_line(state->buf);
if (!e)
continue;
 
-   /* assume sane basename() -- doesnt modify argument */
-   if ((base = basename(e->name)) == NULL)
+   /* basename(3) possibly modifies e->name (if it has trailing
+* slashes) but this is not likely since it comes from VDB which
+* has normalised everything, so effectively e->name isn't
+* touched, however, it /can/ return a pointer to a private
+* allocation */
+   base = basename(e->name);
+   if (base < e->name || base > (e->name + strlen(e->name)))
continue;
 
+   /* basename(/usr) = usr, dirname(/usr) = /
+* basename(/usr/bin) = bin, dirname(/usr/bin) = /usr */
+   if ((dirname_len = (base - e->name - 1)) == 0)
+   dirname_len = 1;
+
for (i = 0; i < args->length; i++) {
if (base_names[i] == NULL)
continue;
if (non_orphans && non_orphans[i])
continue;
 
-   /* For optimization of qfile(), we also give it an 
array of the first char
-* of each basename.  This way we avoid numerous 
strcmp() calls.
-   */
-   if (base[0] != base_names[i][0] || strcmp(base, 
base_names[i]))
+   /* For optimization of qfile(), we also give it an 
array of
+* the first char of each basename.  This way we avoid
+* numerous strcmp() calls. */
+   if (base[0] != base_names[i][0] || strcmp(base, 
base_names[i]) != 0)
continue;
 
path_ok = false;
 
-   /* check the full filepath ... */
-   size_t dirname_len = (base - e->name - 1);
-   /* basename(/usr) = usr, dirname(/usr) = /
-* basename(/usr/bin) = bin, dirname(/usr/bin) = /usr
-*/
-   if (dirname_len == 0)
-   dirname_len = 1;
-
if (dir_names[i] &&
strncmp(e->name, dir_names[i], dirname_len) == 0 &&
-   dir_names[i][dirname_len] == '\0') {
+   

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

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

qlop: accept "today" and "yesterday" for parse_date

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

 man/include/qlop.optdesc.yaml |  4 
 man/qlop.1|  4 
 qlop.c| 13 +++--
 3 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/man/include/qlop.optdesc.yaml b/man/include/qlop.optdesc.yaml
index fad1670..3ff62c3 100644
--- a/man/include/qlop.optdesc.yaml
+++ b/man/include/qlop.optdesc.yaml
@@ -6,6 +6,10 @@ date: |
 .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 today
+Alias for \fI0 days ago\fR.
+.IP yesterday
+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.

diff --git a/man/qlop.1 b/man/qlop.1
index 9c449a9..18c05fb 100644
--- a/man/qlop.1
+++ b/man/qlop.1
@@ -46,6 +46,10 @@ can take a few forms.
 .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 today
+Alias for \fI0 days ago\fR.
+.IP yesterday
+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.

diff --git a/qlop.c b/qlop.c
index 1d4e0d9..7bac8c2 100644
--- a/qlop.c
+++ b/qlop.c
@@ -758,8 +758,17 @@ parse_date(const char *sdate, time_t *t)
char ago[len];
int ret = sscanf(sdate, "%lu %s %s", , dur, ago);
 
-   if (ret < 2)
-   return false;
+   if (ret < 2) {
+   if (strcmp(sdate, "today") == 0) {
+   num = 0;
+   snprintf(dur, len, "%s", "day");
+   } else if (strcmp(sdate, "yesterday") == 0) {
+   num = 1;
+   snprintf(dur, len, "%s", "day");
+   } else {
+   return false;
+   }
+   }
if (ret == 3 && strcmp(ago, "ago") != 0)
return false;
 



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

2018-04-03 Thread Fabian Groffen
commit: 2921191511917e039e6cbca77b7b4977fc8a9eb4
Author: Fabian Groffen  gentoo  org>
AuthorDate: Tue Apr  3 15:29:46 2018 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Tue Apr  3 15:29:46 2018 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=29211915

qxpak: improve documentation

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

 man/include/qxpak.desc |  1 +
 man/qxpak.1| 30 --
 2 files changed, 17 insertions(+), 14 deletions(-)

diff --git a/man/include/qxpak.desc b/man/include/qxpak.desc
new file mode 100644
index 000..13b9591
--- /dev/null
+++ b/man/include/qxpak.desc
@@ -0,0 +1 @@
+\fIqxpak\fR is like ar and tar for xpak archives.

diff --git a/man/qxpak.1 b/man/qxpak.1
index dbf36f6..710df44 100644
--- a/man/qxpak.1
+++ b/man/qxpak.1
@@ -1,50 +1,52 @@
-.TH qxpak "1" "Mar 2016" "Gentoo Foundation" "qxpak"
+.\" generated by mkman.py, please do NOT edit!
+.TH qxpak "1" "Apr 2018" "Gentoo Foundation" "qxpak"
 .SH NAME
 qxpak \- manipulate xpak archives
 .SH SYNOPSIS
 .B qxpak
 \fI[opts] \fR
 .SH DESCRIPTION
-
+\fIqxpak\fR is like ar and tar for xpak archives.
 .SH OPTIONS
 .TP
 \fB\-l\fR, \fB\-\-list\fR
-List the contents of an archive
+List the contents of an archive.
 .TP
 \fB\-x\fR, \fB\-\-extract\fR
-Extract the contents of an archive
+Extract the contents of an archive.
 .TP
 \fB\-c\fR, \fB\-\-create\fR
-Create an archive of a directory/files
+Create an archive of a directory/files.
 .TP
 \fB\-d\fR \fI\fR, \fB\-\-dir\fR \fI\fR
-Change to specified directory
+Change to specified directory.
 .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
+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/include/, /, man/

2018-04-03 Thread Fabian Groffen
commit: 454020200171d3d921b0f7e2229d4e527e1e6b2a
Author: Fabian Groffen  gentoo  org>
AuthorDate: Tue Apr  3 15:19:43 2018 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Tue Apr  3 15:19:43 2018 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=45402020

quse: improve documentation

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

 man/include/quse.desc |  2 ++
 man/include/quse.optdesc.yaml | 11 +++
 man/quse.1| 40 
 quse.c|  4 ++--
 4 files changed, 39 insertions(+), 18 deletions(-)

diff --git a/man/include/quse.desc b/man/include/quse.desc
new file mode 100644
index 000..7492774
--- /dev/null
+++ b/man/include/quse.desc
@@ -0,0 +1,2 @@
+\fIquse\fR searches in ebuilds for a match in IUSE, KEYWORDS or LICENSE.
+It can also search for USE-flags and show their descriptions.

diff --git a/man/include/quse.optdesc.yaml b/man/include/quse.optdesc.yaml
new file mode 100644
index 000..2a3675d
--- /dev/null
+++ b/man/include/quse.optdesc.yaml
@@ -0,0 +1,11 @@
+exact: Search for exact string, e.g.\ do not use regular expression matching.
+format: |
+Advanced option to manually override the variable searched for in
+ebuilds.  By default, the search is \fIIUSE=\fR, the \fB\-K\fR and
+\fB\-L\fR override that to \fIKEYWORDS=\fR and \fILICENSE=\fR
+respectively.  This option, sets the search to any variable.  Note
+that the equals sign is part of the search, and needs to be set.
+verbose: |
+Show problems encountered during parsing.  These are mostly
+diagnostic and indicate possible incorrectness in the results.
+quiet: Ignored for compatibility with other qapplets.

diff --git a/man/quse.1 b/man/quse.1
index e1e6db9..9b632b7 100644
--- a/man/quse.1
+++ b/man/quse.1
@@ -1,56 +1,64 @@
-.TH quse "1" "Mar 2016" "Gentoo Foundation" "quse"
+.\" generated by mkman.py, please do NOT edit!
+.TH quse "1" "Apr 2018" "Gentoo Foundation" "quse"
 .SH NAME
 quse \- find pkgs using useflags
 .SH SYNOPSIS
 .B quse
 \fI[opts] \fR
 .SH DESCRIPTION
-
+\fIquse\fR searches in ebuilds for a match in IUSE, KEYWORDS or LICENSE.
+It can also search for USE-flags and show their descriptions.
 .SH OPTIONS
 .TP
 \fB\-e\fR, \fB\-\-exact\fR
-Show exact non regexp matching using strcmp
+Search for exact string, e.g.\ do not use regular expression matching.
 .TP
 \fB\-a\fR, \fB\-\-all\fR
-Show annoying things in IUSE
+List all ebuilds, don't match anything.
 .TP
 \fB\-K\fR, \fB\-\-keywords\fR
-Use the KEYWORDS vs IUSE
+Use the KEYWORDS vs IUSE.
 .TP
 \fB\-L\fR, \fB\-\-license\fR
-Use the LICENSE vs IUSE
+Use the LICENSE vs IUSE.
 .TP
 \fB\-D\fR, \fB\-\-describe\fR
-Describe the USE flag
+Describe the USE flag.
 .TP
 \fB\-F\fR \fI\fR, \fB\-\-format\fR \fI\fR
-Use your own variable formats. -F NAME=
+Advanced option to manually override the variable searched for in
+ebuilds.  By default, the search is \fIIUSE=\fR, the \fB\-K\fR and
+\fB\-L\fR override that to \fIKEYWORDS=\fR and \fILICENSE=\fR
+respectively.  This option, sets the search to any variable.  Note
+that the equals sign is part of the search, and needs to be set.
 .TP
 \fB\-N\fR, \fB\-\-name\-only\fR
-Only show package name
+Only show package name.
 .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
+Show problems encountered during parsing.  These are mostly
+diagnostic and indicate possible incorrectness in the results.
 .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 

diff --git a/quse.c b/quse.c
index ea8a326..05ba2f4 100644
--- a/quse.c
+++ b/quse.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005-2014 Gentoo Foundation
+ * Copyright 2005-2018 Gentoo Foundation
  * Distributed under the terms of the GNU General Public License v2
  *
  * Copyright 2005-2010 Ned Ludd- 
@@ -26,7 +26,7 @@ static struct option const quse_long_opts[] = {
 };
 static const char * const quse_opts_help[] = {
"Show exact non regexp matching using strcmp",
-   "Show annoying things in IUSE",
+   "List all ebuilds, don't match anything",
"Use the KEYWORDS vs IUSE",
"Use the LICENSE vs IUSE",
"Describe the USE flag",



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

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

qsize: improve documentation

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

 man/include/qpkg.optdesc.yaml |  2 +-
 man/qsize.1   | 37 +
 qsize.c   |  6 +++---
 3 files changed, 25 insertions(+), 20 deletions(-)

diff --git a/man/include/qpkg.optdesc.yaml b/man/include/qpkg.optdesc.yaml
index 2da2810..62c0b52 100644
--- a/man/include/qpkg.optdesc.yaml
+++ b/man/include/qpkg.optdesc.yaml
@@ -1,2 +1,2 @@
 verbose: Check and report MD5 hash mismatches during install.
-quiet: Ignored for compatability with other qapplets.
+quiet: Ignored for compatibility with other qapplets.

diff --git a/man/qsize.1 b/man/qsize.1
index aa613f8..a734afd 100644
--- a/man/qsize.1
+++ b/man/qsize.1
@@ -1,56 +1,61 @@
-.TH qsize "1" "Mar 2016" "Gentoo Foundation" "qsize"
+.\" generated by mkman.py, please do NOT edit!
+.TH qsize "1" "Apr 2018" "Gentoo Foundation" "qsize"
 .SH NAME
 qsize \- calculate size usage
 .SH SYNOPSIS
 .B qsize
 \fI[opts] \fR
 .SH DESCRIPTION
-
+\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.
 .SH OPTIONS
 .TP
 \fB\-f\fR, \fB\-\-filesystem\fR
-Show size used on disk
+Show size used on disk.
 .TP
 \fB\-s\fR, \fB\-\-sum\fR
-Include a summary
+Include a summary.
 .TP
 \fB\-S\fR, \fB\-\-sum\-only\fR
-Show just the summary
+Show just the summary.
 .TP
 \fB\-m\fR, \fB\-\-megabytes\fR
-Display size in megabytes
+Display all sizes in megabytes.
 .TP
 \fB\-k\fR, \fB\-\-kilobytes\fR
-Display size in kilobytes
+Display all sizes in kilobytes.
 .TP
 \fB\-b\fR, \fB\-\-bytes\fR
-Display size in bytes
+Display all sizes in bytes.
 .TP
 \fB\-i\fR \fI\fR, \fB\-\-ignore\fR \fI\fR
-Ignore regexp string
+Filter out entries matching \fI\fR, which is a regular
+expression, before calculating size.
 .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
+Ignored for compatibility with other qapplets.
 .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 

diff --git a/qsize.c b/qsize.c
index c485aa6..78b8f88 100644
--- a/qsize.c
+++ b/qsize.c
@@ -23,9 +23,9 @@ static const char * const qsize_opts_help[] = {
"Show size used on disk",
"Include a summary",
"Show just the summary",
-   "Display size in megabytes",
-   "Display size in kilobytes",
-   "Display size in bytes",
+   "Display all sizes in megabytes",
+   "Display all sizes in kilobytes",
+   "Display all sizes in bytes",
"Ignore regexp string",
COMMON_OPTS_HELP
 };



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

2018-04-03 Thread Fabian Groffen
commit: 81df4a8cfbd2998e43842440bb2d57d620b6ff7d
Author: Fabian Groffen  gentoo  org>
AuthorDate: Tue Apr  3 13:13:21 2018 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Tue Apr  3 13:13:21 2018 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=81df4a8c

qsearch: improve documentation

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

 man/include/qsearch.desc |  3 +++
 man/include/qsearch.optdesc.yaml |  2 ++
 man/qsearch.1| 36 
 qsearch.c|  6 +++---
 4 files changed, 28 insertions(+), 19 deletions(-)

diff --git a/man/include/qsearch.desc b/man/include/qsearch.desc
new file mode 100644
index 000..281c5a3
--- /dev/null
+++ b/man/include/qsearch.desc
@@ -0,0 +1,3 @@
+\fIqsearch\fR performs a search over the name and/or description of
+packages.  By default, a search over all package names is performed over
+all ebuilds in the tree.

diff --git a/man/include/qsearch.optdesc.yaml b/man/include/qsearch.optdesc.yaml
new file mode 100644
index 000..9bbaeaa
--- /dev/null
+++ b/man/include/qsearch.optdesc.yaml
@@ -0,0 +1,2 @@
+verbose: Ignored for compatibility with other qapplets.
+quiet: Ignored for compatibility with other qapplets.

diff --git a/man/qsearch.1 b/man/qsearch.1
index 5f888ba..3c6032d 100644
--- a/man/qsearch.1
+++ b/man/qsearch.1
@@ -1,56 +1,60 @@
-.TH qsearch "1" "Mar 2016" "Gentoo Foundation" "qsearch"
+.\" generated by mkman.py, please do NOT edit!
+.TH qsearch "1" "Apr 2018" "Gentoo Foundation" "qsearch"
 .SH NAME
 qsearch \- search pkgname/desc
 .SH SYNOPSIS
 .B qsearch
 \fI[opts] \fR
 .SH DESCRIPTION
-
+\fIqsearch\fR performs a search over the name and/or description of
+packages.  By default, a search over all package names is performed over
+all ebuilds in the tree.
 .SH OPTIONS
 .TP
 \fB\-a\fR, \fB\-\-all\fR
-List the descriptions of every package in the cache
+List the descriptions of every package in the cache.
 .TP
 \fB\-c\fR, \fB\-\-cache\fR
-Use the portage cache (default)
+Use the portage cache.
 .TP
 \fB\-e\fR, \fB\-\-ebuilds\fR
-Use the portage ebuild tree
+Use the portage ebuild tree (default).
 .TP
 \fB\-s\fR, \fB\-\-search\fR
-Regex search package basenames
+Regex search package basenames.
 .TP
 \fB\-S\fR \fI\fR, \fB\-\-desc\fR \fI\fR
-Regex search package descriptions
+Regex search package descriptions.
 .TP
 \fB\-N\fR, \fB\-\-name\-only\fR
-Only show package name
+Only show package name.
 .TP
 \fB\-H\fR, \fB\-\-homepage\fR
-Show homepage info
+Show homepage info.
 .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
+Ignored for compatibility with other qapplets.
 .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 

diff --git a/qsearch.c b/qsearch.c
index a620f95..4fce4de 100644
--- a/qsearch.c
+++ b/qsearch.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005-2014 Gentoo Foundation
+ * Copyright 2005-2018 Gentoo Foundation
  * Distributed under the terms of the GNU General Public License v2
  *
  * Copyright 2005-2010 Ned Ludd- 
@@ -21,8 +21,8 @@ static struct option const qsearch_long_opts[] = {
 };
 static const char * const qsearch_opts_help[] = {
"List the descriptions of every package in the cache",
-   "Use the portage cache (default)",
-   "Use the portage ebuild tree",
+   "Use the portage cache",
+   "Use the portage ebuild tree (default)",
"Regex search package basenames",
"Regex search package descriptions",
"Only show package name",



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

2018-04-02 Thread Fabian Groffen
commit: 7de177d7ac1dff248f91e45bfdc3163629dae79e
Author: Fabian Groffen  gentoo  org>
AuthorDate: Mon Apr  2 18:59:02 2018 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Mon Apr  2 18:59:02 2018 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=7de177d7

qgrep: improve documentation

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

 man/include/qgrep.desc |  3 +++
 man/include/qgrep.optdesc.yaml |  5 
 man/qgrep.1| 54 +++---
 3 files changed, 38 insertions(+), 24 deletions(-)

diff --git a/man/include/qgrep.desc b/man/include/qgrep.desc
new file mode 100644
index 000..c95d35a
--- /dev/null
+++ b/man/include/qgrep.desc
@@ -0,0 +1,3 @@
+\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.

diff --git a/man/include/qgrep.optdesc.yaml b/man/include/qgrep.optdesc.yaml
new file mode 100644
index 000..87b174e
--- /dev/null
+++ b/man/include/qgrep.optdesc.yaml
@@ -0,0 +1,5 @@
+verbose: |
+Print multiple matches per files.  When this option is given
+multiple times, also linenumber are printed for matches next to file
+names.
+quiet: Ignored for compatibility with other qapplets.

diff --git a/man/qgrep.1 b/man/qgrep.1
index e31e45a..bd140b3 100644
--- a/man/qgrep.1
+++ b/man/qgrep.1
@@ -1,80 +1,86 @@
-.TH qgrep "1" "Mar 2016" "Gentoo Foundation" "qgrep"
+.\" generated by mkman.py, please do NOT edit!
+.TH qgrep "1" "Apr 2018" "Gentoo Foundation" "qgrep"
 .SH NAME
 qgrep \- grep in ebuilds
 .SH SYNOPSIS
 .B qgrep
 \fI[opts] \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.
 .SH OPTIONS
 .TP
 \fB\-I\fR, \fB\-\-invert\-match\fR
-Select non-matching lines
+Select non-matching lines.
 .TP
 \fB\-i\fR, \fB\-\-ignore\-case\fR
-Ignore case distinctions
+Ignore case distinctions.
 .TP
 \fB\-H\fR, \fB\-\-with\-filename\fR
-Print the filename for each match
+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 package or eclass name for each match.
 .TP
 \fB\-c\fR, \fB\-\-count\fR
-Only print a count of matching lines per FILE
+Only print a count of matching lines per FILE.
 .TP
 \fB\-l\fR, \fB\-\-list\fR
-Only print FILE names containing matches
+Only print FILE names containing matches.
 .TP
 \fB\-L\fR, \fB\-\-invert\-list\fR
-Only print FILE names containing no match
+Only print FILE names containing no match.
 .TP
 \fB\-e\fR, \fB\-\-regexp\fR
-Use PATTERN as a regular expression
+Use PATTERN as a regular expression.
 .TP
 \fB\-x\fR, \fB\-\-extended\fR
-Use PATTERN as an extended regular expression
+Use PATTERN as an extended regular expression.
 .TP
 \fB\-J\fR, \fB\-\-installed\fR
-Search in installed ebuilds instead of the tree
+Search in installed ebuilds instead of the tree.
 .TP
 \fB\-E\fR, \fB\-\-eclass\fR
-Search in eclasses instead of ebuilds
+Search in eclasses instead of ebuilds.
 .TP
 \fB\-s\fR, \fB\-\-skip\-comments\fR
-Skip comments lines
+Skip comments lines.
 .TP
 \fB\-S\fR \fI\fR, \fB\-\-skip\fR \fI\fR
-Skip lines matching 
+Skip lines matching .
 .TP
 \fB\-B\fR \fI\fR, \fB\-\-before\fR \fI\fR
-Print  lines of leading context
+Print  lines of leading context.
 .TP
 \fB\-A\fR \fI\fR, \fB\-\-after\fR \fI\fR
-Print  lines of trailing context
+Print  lines of trailing context.
 .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 multiple matches per files.  When this option is given
+multiple times, also linenumber are printed for matches next to file
+names.
 .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/include/

2018-04-02 Thread Fabian Groffen
commit: b7e95e98e237fed7ae4a78698cec0c42adf22f30
Author: Fabian Groffen  gentoo  org>
AuthorDate: Mon Apr  2 17:39:01 2018 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Mon Apr  2 17:39:01 2018 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=b7e95e98

typo

 man/include/qfile-05-collisions.include | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/man/include/qfile-05-collisions.include 
b/man/include/qfile-05-collisions.include
index dcf0e49..1b8672d 100644
--- a/man/include/qfile-05-collisions.include
+++ b/man/include/qfile-05-collisions.include
@@ -9,7 +9,7 @@ takes one argument, which can be a package name (\fBbash\fP or
 packages (ie., comparing the contents of one package with the contents of all 
 the others).
 .PP
-For example, the following script will search collisions beetween all your 
+For example, the following script will search collisions between all your
 installed packages. Be careful, this will takes time:
 .nf\fI
#!/bin/bash



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

2018-04-02 Thread Fabian Groffen
commit: ec9c281b4fd5d4b36927c2b004bbcd0fe11f2d76
Author: Fabian Groffen  gentoo  org>
AuthorDate: Mon Apr  2 17:52:20 2018 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Mon Apr  2 17:52:20 2018 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=ec9c281b

qfile: update manpage

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

 man/include/qfile.desc |  4 
 man/include/qfile.optdesc.yaml |  7 +++
 man/qfile.1| 40 
 3 files changed, 35 insertions(+), 16 deletions(-)

diff --git a/man/include/qfile.desc b/man/include/qfile.desc
new file mode 100644
index 000..08d4bb3
--- /dev/null
+++ b/man/include/qfile.desc
@@ -0,0 +1,4 @@
+\fIqfile\fR searches packages for files they provide.  The searched
+packages must be installed, thus the search is for any file on the
+filesystem, to what package that file belongs.  It allows to identify
+which package installed a certain file.

diff --git a/man/include/qfile.optdesc.yaml b/man/include/qfile.optdesc.yaml
new file mode 100644
index 000..cb1cd7a
--- /dev/null
+++ b/man/include/qfile.optdesc.yaml
@@ -0,0 +1,7 @@
+verbose: |
+Print package versions to 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 5bd58c7..ff92897 100644
--- a/man/qfile.1
+++ b/man/qfile.1
@@ -1,48 +1,55 @@
-.TH qfile "1" "Jun 2016" "Gentoo Foundation" "qfile"
+.\" generated by mkman.py, please do NOT edit!
+.TH qfile "1" "Apr 2018" "Gentoo Foundation" "qfile"
 .SH NAME
 qfile \- list all pkgs owning files
 .SH SYNOPSIS
 .B qfile
 \fI[opts] \fR
 .SH DESCRIPTION
-
+\fIqfile\fR searches packages for files they provide.  The searched
+packages must be installed, thus the search is for any file on the
+filesystem, to what package that file belongs.  It allows to identify
+which package installed a certain file.
 .SH OPTIONS
 .TP
 \fB\-S\fR, \fB\-\-slots\fR
-Display installed packages with slots
+Display installed packages with slots.
 .TP
 \fB\-R\fR, \fB\-\-root\-prefix\fR
-Assume arguments are already prefixed by $ROOT
+Assume arguments are already prefixed by $ROOT.
 .TP
 \fB\-b\fR, \fB\-\-basename\fR
-Match any component of the path
+Match any component of the path.
 .TP
 \fB\-o\fR, \fB\-\-orphans\fR
-List orphan files
+List orphan files.
 .TP
 \fB\-x\fR \fI\fR, \fB\-\-exclude\fR \fI\fR
-Don't look in package  (used with --orphans)
+Don't look in package  (used with --orphans).
 .TP
 \fB\-e\fR, \fB\-\-exact\fR
-Exact match (used with --exclude)
+Exact match (used with --exclude).
 .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 package versions to matches, warn about problems with
+resolving symlinks or positioning packages under an alternative
+root.
 .TP
 \fB\-q\fR, \fB\-\-quiet\fR
-Tighter output; suppress warnings
+Don't print matching file for matches, just the package.  Don't
+report about orphan files.
 .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 "FINDING FILES OWNERS"
 .PP
 This is the default behavior of \fBqfile\fP.  It will list the packages which
@@ -159,7 +166,7 @@ takes one argument, which can be a package name (\fBbash\fP 
or
 packages (ie., comparing the contents of one package with the contents of all
 the others).
 .PP
-For example, the following script will search collisions beetween all your
+For example, the following script will search collisions between all your
 installed packages. Be careful, this will takes time:
 .nf\fI
#!/bin/bash
@@ -202,7 +209,8 @@ TGL degrenier[at]easyconnect.fr
 .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/include/

2016-06-14 Thread Mike Frysinger
commit: 3fb265e0863689e3e352fc6abcedc77a262323f2
Author: Mike Frysinger  gentoo  org>
AuthorDate: Wed Jun 15 04:55:06 2016 +
Commit: Mike Frysinger  gentoo  org>
CommitDate: Wed Jun 15 04:55:06 2016 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=3fb265e0

man: drop qfile --from docs

URL: https://bugs.gentoo.org/573574
Reported-by: Rick Farina  gentoo.org>

 man/include/qfile-04-from.include | 61 ---
 1 file changed, 61 deletions(-)

diff --git a/man/include/qfile-04-from.include 
b/man/include/qfile-04-from.include
deleted file mode 100644
index 47652bb..000
--- a/man/include/qfile-04-from.include
+++ /dev/null
@@ -1,61 +0,0 @@
-.SH "READING ARGUMENTS FROM A FILE/STDIN"
-.PP
-When you try to launch \fBqfile\fP with a large number of arguments, you may
-hit the following shell error:
-.nf\fI
-   $ qfile -o $(find /usr/lib)
-   bash: ./qfile: Argument list too long
-.fi
-.PP
-To avoid that, you must use the \fB\-\-from\fP (\fB\-f\fP) option, which
-allows reading your arguments list in a file:
-.nf\fI
-   $ find /usr/lib > ~/usr-lib.list
-   $ qfile -o -f ~/usr-lib.list
-   /usr/lib/libMagick-5.5.7-Q16.so.0.0.0
-   /usr/lib/libGL.so
-   ...
-.fi
-.PP
-Your arguments list must be formatted with one file per line, and without any
-kind of garbage (no leading or trailing space, no empty line, etc.).  The 
-default \fBfind\fP output format is just fine in general.
-.PP
-You can also read the arguments list from standard input with the "\fB\-\fP" 
-pseudo filename, which is useful with shell pipes:
-.nf\fI
-   $ find /usr/lib | qfile -o -f -
-   /usr/lib/libMagick-5.5.7-Q16.so.0.0.0
-   /usr/lib/libGL.so
-   ...
-.fi
-.PP
-Here is an other example of use.  This script lists some files which may be
-orphan config files left behind by Portage after uninstallation or upgrade of 
-some packages:
-.nf\fI
-   #!/bin/bash
-   SEARCH_PATHS="$(portageq envvar CONFIG_PROTECT)"
-   SEARCH_MASK="$(portageq envvar CONFIG_PROTECT_MASK) \\
-   /etc/runlevels /etc/portage \\
-   /etc/ssl/certs /etc/ssh \\
-   /etc/bash_completion.d /etc/cups"
-   for path in ${SEARCH_MASK} ; do
-   EXCLUDE="${EXCLUDE} -not -path ${path}/*"
-   done
-   set -f
-   find ${SEARCH_PATHS} ${EXCLUDE} | qfile -o -f -
-.fi
-.PP
-\fBIMPORTANT:\fP this script is just a quick example.  Do not blindly delete 
the
-files it will list!
-.PP
-When reading arguments from a file or from stdin, \fBqfile\fP will, for
-performances reasons, treat then by groups of 5000 (search owners of the
-5000 first files, then of the 5000 following ones, etc.).  This magic value
-should be fine in most cases, but you can change it if you really want, using
-the \fB\-\-max\-args\fP option (\fB\-m\fP).  Using a greater value will eat a
-bit more memory, but may be a bit faster for really big queries.  Be careful
-though, using some stupidly high or low value can completly kill the
-performances.  In short, you probably don't want to touch this option.
-.PP