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

2019-09-10 Thread Fabian Groffen
commit: 3dc607a8a6cfd3bafbc2f10d9a7c3aae90c3a757
Author: Fabian Groffen  gentoo  org>
AuthorDate: Tue Sep 10 18:21:51 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Tue Sep 10 18:21:51 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=3dc607a8

qlop: add mode to print last run in a similar way like emerge(1) does

For example, the output could be like this, showing upgrade information:

% ./qlop -E -t
  U  app-shells/bash-5.0_p11 [5.0_p9-r0]: 2′38″
  U  app-admin/eselect-1.4.15 [1.4.14-r0]: 19s
  U  sys-libs/talloc-2.3.0 [2.2.0-r0]: 1′56″
  U  app-portage/prefix-toolkit-5 [4-r0]: 10s
  U  dev-python/cryptography-2.7 [2.6.1-r0]: 1′59″
  U  net-dns/bind-tools-9.14.5 [9.14.4-r0]: 4′17″
 R   dev-python/sphinxcontrib-applehelp-1.0.1: 28s
 R   dev-python/sphinxcontrib-devhelp-1.0.1: 27s
 R   dev-python/sphinxcontrib-jsmath-1.0.1: 25s
 R   dev-python/sphinxcontrib-htmlhelp-1.0.2: 28s
 R   dev-python/sphinxcontrib-serializinghtml-1.1.3: 28s
 R   dev-python/sphinxcontrib-qthelp-1.0.2: 28s
  U  dev-python/sphinx-2.0.1 [1.7.5-r1]: 1′13″
  U  net-mail/notmuch-0.29.1-r1 [0.28.4-r0]: 1′00″

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

 man/qlop.1 |  5 -
 qlop.c | 49 -
 2 files changed, 52 insertions(+), 2 deletions(-)

diff --git a/man/qlop.1 b/man/qlop.1
index baa5bf5..de1e525 100644
--- a/man/qlop.1
+++ b/man/qlop.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qlop "1" "Jul 2019" "Gentoo Foundation" "qlop"
+.TH qlop "1" "Sep 2019" "Gentoo Foundation" "qlop"
 .SH NAME
 qlop \- emerge log analyzer
 .SH SYNOPSIS
@@ -65,6 +65,9 @@ Show autoclean unmerge history.
 \fB\-s\fR, \fB\-\-sync\fR
 Show sync history.
 .TP
+\fB\-E\fR, \fB\-\-emerge\fR
+Show last merge like how emerge(1) -v would show it.
+.TP
 \fB\-e\fR, \fB\-\-endtime\fR
 Report time at which the operation finished (iso started).
 .TP

diff --git a/qlop.c b/qlop.c
index 243c8b6..3cc3367 100644
--- a/qlop.c
+++ b/qlop.c
@@ -24,7 +24,7 @@
 
 #define QLOP_DEFAULT_LOGFILE "emerge.log"
 
-#define QLOP_FLAGS "ctaHMmuUslerd:f:w:F:" COMMON_FLAGS
+#define QLOP_FLAGS "ctaHMmuUsElerd:f:w:F:" COMMON_FLAGS
 static struct option const qlop_long_opts[] = {
{"summary",   no_argument, NULL, 'c'},
{"time",  no_argument, NULL, 't'},
@@ -35,6 +35,7 @@ static struct option const qlop_long_opts[] = {
{"unmerge",   no_argument, NULL, 'u'},
{"autoclean", no_argument, NULL, 'U'},
{"sync",  no_argument, NULL, 's'},
+   {"emerge",no_argument, NULL, 'E'},
{"endtime",   no_argument, NULL, 'e'},
{"running",   no_argument, NULL, 'r'},
{"date",   a_argument, NULL, 'd'},
@@ -54,6 +55,7 @@ static const char * const qlop_opts_help[] = {
"Show unmerge history",
"Show autoclean unmerge history",
"Show sync history",
+   "Show last merge like how emerge(1) -v would show it",
"Report time at which the operation finished (iso started)",
"Show current emerging packages",
"Limit selection to this time (1st -d is start, 2nd -d is end)",
@@ -85,6 +87,7 @@ struct qlop_mode {
char do_machine:1;
char do_endtime:1;
char show_lastmerge:1;
+   char show_emerge:1;
const char *fmt;
 };
 
@@ -334,6 +337,7 @@ static int do_emerge_log(
time_t elapsed;
depend_atom *atom;
depend_atom *atomw;
+   depend_atom *upgrade_atom = NULL;
DECLARE_ARRAY(merge_matches);
DECLARE_ARRAY(merge_averages);
DECLARE_ARRAY(unmerge_matches);
@@ -638,6 +642,34 @@ static int do_emerge_log(
flags->do_time 
? ": " : "",
flags->do_time ?

fmt_elapsedtime(flags, elapsed) : "");
+   } else if (flags->show_emerge) {
+   int state = NOT_EQUAL;
+   if (upgrade_atom != NULL)
+   state = 
atom_compare(pkgw->atom, upgrade_atom);
+   switch (state) {
+   /* "NRUD " */
+   case EQUAL:
+   printf(" %sR%s  
 ", YELLOW, NORM);
+   break;
+   case NOT_EQUAL:
+   printf("%sN%s   
 ", GREEN, NORM);
+   break;
+   case NEWER:
+   

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

2019-11-09 Thread Fabian Groffen
commit: 57e49de5c210c8def6f4957a6f94a62c60f98e52
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sat Nov  9 10:11:04 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sat Nov  9 10:11:04 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=57e49de5

q: add option to print envvars, much like portageq envvar

Option -e to q will dump the env variables used by portage-utils.

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

 main.c  | 86 +++--
 main.h  | 23 +++---
 man/q.1 |  7 --
 q.c | 59 +++-
 4 files changed, 118 insertions(+), 57 deletions(-)

diff --git a/main.c b/main.c
index 0b827fc..f8ba7af 100644
--- a/main.c
+++ b/main.c
@@ -393,19 +393,6 @@ strincr_var(const char *name, const char *s, char **value, 
size_t *value_len)
/* we should sort here */
 }
 
-typedef enum { _Q_BOOL, _Q_STR, _Q_ISTR } var_types;
-typedef struct {
-   const char *name;
-   const size_t name_len;
-   const var_types type;
-   union {
-   char **s;
-   bool *b;
-   } value;
-   size_t value_len;
-   const char *default_value;
-} env_vars;
-
 static env_vars *
 get_portage_env_var(env_vars *vars, const char *name)
 {
@@ -619,49 +606,48 @@ read_portage_profile(const char *configroot, const char 
*profile, env_vars vars[
free(profile_file);
 }
 
-static void
-initialize_portage_env(void)
-{
-   size_t i;
-   const char *s;
-
-   bool nocolor = 0;
-
-   env_vars *var;
-   env_vars vars_to_read[] = {
+static bool nocolor = 0;
+env_vars vars_to_read[] = {
 #define _Q_EV(t, V, set, lset, d) \
-   { \
-   .name = #V, \
-   .name_len = strlen(#V), \
-   .type = _Q_##t, \
-   set, \
-   lset, \
-   .default_value = d, \
-   },
+{ \
+   .name = #V, \
+   .name_len = strlen(#V), \
+   .type = _Q_##t, \
+   set, \
+   lset, \
+   .default_value = d, \
+},
 #define _Q_EVS(t, V, v, d) _Q_EV(t, V, .value.s = &v, .value_len = strlen(d), 
d)
 #define _Q_EVB(t, V, v, d) _Q_EV(t, V, .value.b = &v, .value_len = 0, d)
 
-   _Q_EVS(STR,  ROOT,portroot,"/")
-   _Q_EVS(STR,  ACCEPT_LICENSE,  accept_license,  "")
-   _Q_EVS(ISTR, INSTALL_MASK,install_mask,"")
-   _Q_EVS(ISTR, PKG_INSTALL_MASK,pkg_install_mask,"")
-   _Q_EVS(STR,  ARCH,portarch,"")
-   _Q_EVS(ISTR, CONFIG_PROTECT,  config_protect,  "/etc")
-   _Q_EVS(ISTR, CONFIG_PROTECT_MASK, config_protect_mask, "")
-   _Q_EVB(BOOL, NOCOLOR, nocolor, 0)
-   _Q_EVS(ISTR, FEATURES,features,"")
-   _Q_EVS(STR,  EPREFIX, eprefix, 
CONFIG_EPREFIX)
-   _Q_EVS(STR,  EMERGE_LOG_DIR,  portlogdir,  
CONFIG_EPREFIX "var/log")
-   _Q_EVS(STR,  PORTDIR, main_overlay,
CONFIG_EPREFIX "var/db/repos/gentoo")
-   _Q_EVS(STR,  PORTAGE_BINHOST, binhost, 
DEFAULT_PORTAGE_BINHOST)
-   _Q_EVS(STR,  PORTAGE_TMPDIR,  port_tmpdir, 
CONFIG_EPREFIX "var/tmp/portage/")
-   _Q_EVS(STR,  PKGDIR,  pkgdir,  
CONFIG_EPREFIX "var/cache/binpkgs/")
-   _Q_EVS(STR,  Q_VDB,   portvdb, 
CONFIG_EPREFIX "var/db/pkg")
-   _Q_EVS(STR,  Q_EDB,   portedb, 
CONFIG_EPREFIX "var/cache/edb")
-   { NULL, 0, _Q_BOOL, { NULL }, 0, NULL, }
+   _Q_EVS(STR,  ROOT,portroot,"/")
+   _Q_EVS(STR,  ACCEPT_LICENSE,  accept_license,  "")
+   _Q_EVS(ISTR, INSTALL_MASK,install_mask,"")
+   _Q_EVS(ISTR, PKG_INSTALL_MASK,pkg_install_mask,"")
+   _Q_EVS(STR,  ARCH,portarch,"")
+   _Q_EVS(ISTR, CONFIG_PROTECT,  config_protect,  "/etc")
+   _Q_EVS(ISTR, CONFIG_PROTECT_MASK, config_protect_mask, "")
+   _Q_EVB(BOOL, NOCOLOR, nocolor, 0)
+   _Q_EVS(ISTR, FEATURES,features,"")
+   _Q_EVS(STR,  EPREFIX, eprefix, CONFIG_EPREFIX)
+   _Q_EVS(STR,  EMERGE_LOG_DIR,  portlogdir,  CONFIG_EPREFIX 
"var/log")
+   _Q_EVS(STR,  PORTDIR, main_overlay,CONFIG_EPREFIX 
"var/db/repos/gentoo")
+   _Q_EVS(STR,  PORTAGE_BINHOST, binhost, 
DEFAULT_PORTAGE_BINHOST)
+   _Q_EVS(STR,  PORTAGE_TMPDIR,  port_tmpdir, CONFIG_EPREFIX 
"var/tmp/portage/")
+   _Q_EVS(STR,  PKGDIR,  pkgdir,  CONFIG_EPREFIX 
"var/cache/binpkgs/")
+   _Q_E

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

2019-12-14 Thread Fabian Groffen
commit: e5ff6caad2f4b848f77e6de82c866fa42aba30ae
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sat Dec 14 16:56:39 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sat Dec 14 16:56:39 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=e5ff6caa

qkeyword: add modes to list just list latest stable/testing

This functionality combined with -F allows usage with e.g. Puppet
providers.

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

 man/qkeyword.1 | 23 +++-
 qkeyword.c | 84 +-
 2 files changed, 81 insertions(+), 26 deletions(-)

diff --git a/man/qkeyword.1 b/man/qkeyword.1
index c43fa61..34beb18 100644
--- a/man/qkeyword.1
+++ b/man/qkeyword.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qkeyword "1" "Nov 2019" "Gentoo Foundation" "qkeyword"
+.TH qkeyword "1" "Dec 2019" "Gentoo Foundation" "qkeyword"
 .SH NAME
 qkeyword \- list packages based on keywords
 .SH SYNOPSIS
@@ -32,22 +32,31 @@ match catname.
 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.
+list packages that can be marked stable for .
 .TP
 \fB\-d\fR, \fB\-\-dropped\fR
-list packages that have dropped keywords on a version bump on a given arch.
+list packages that have dropped keywords for .
 .TP
-\fB\-t\fR, \fB\-\-testing\fR
-list packages that have ~arch versions, but no stable versions on a given arch.
+\fB\-t\fR, \fB\-\-needsstable\fR
+list packages that have ~arch versions, but no stable versions for .
 .TP
 \fB\-s\fR, \fB\-\-stats\fR
 display statistics about the portage tree.
 .TP
 \fB\-a\fR, \fB\-\-all\fR
-list packages that have at least one version keyworded for on a given arch.
+list packages that have at least one version keyworded for .
 .TP
 \fB\-n\fR, \fB\-\-not\fR
-list packages that aren't keyworded on a given arch.
+list packages that aren't keyworded for .
+.TP
+\fB\-S\fR, \fB\-\-stable\fR
+list latest stable version per package for .
+.TP
+\fB\-T\fR, \fB\-\-testing\fR
+list latest testing version per package for .
+.TP
+\fB\-F\fR \fI\fR, \fB\-\-format\fR \fI\fR
+Print latest atom using given format string.
 .TP
 \fB\-\-root\fR \fI\fR
 Set the ROOT env var.

diff --git a/qkeyword.c b/qkeyword.c
index 4c6c759..4a55b6a 100644
--- a/qkeyword.c
+++ b/qkeyword.c
@@ -28,29 +28,35 @@
 /* Required portage-utils stuff */
 //
 
-#define QKEYWORD_FLAGS "p:c:m:idtans" COMMON_FLAGS
+#define QKEYWORD_FLAGS "p:c:m:idtsanSTF:" 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'},
-   {"stats",   no_argument, NULL, 's'},
-   {"all", no_argument, NULL, 'a'},
-   {"not", no_argument, NULL, 'n'},
+   {"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'},
+   {"needsstable", no_argument, NULL, 't'},
+   {"stats",   no_argument, NULL, 's'},
+   {"all", no_argument, NULL, 'a'},
+   {"not", no_argument, NULL, 'n'},
+   {"stable",  no_argument, NULL, 'S'},
+   {"testing", no_argument, NULL, 'T'},
+   {"format",   a_argument, NULL, 'F'},
COMMON_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",
+   "list packages that can be marked stable for ",
+   "list packages that have dropped keywords for ",
+   "list packages that have ~arch versions, but no stable versions for 
",
"display statistics about the portage tree",
-   "list packages that have at least one version keyworded for on a given 
arch",
-   "list packages that aren't keyworded on a given arch.",
+   "list packages that have at least one version keyworded for ",
+   "list packages that aren't keyworded for ",
+   "list latest stable version per package for ",
+   "list latest testing version per package for ",
+   "Print latest atom using given format string",
COMMON_OPTS_HELP
 };
 #define qkeyword_usage(ret) usage(ret, QKEYWORD_FLAGS, qkeyword_long_opts, 
qkeyword_opts_help, NULL, lookup_ap

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

2021-02-17 Thread Fabian Groffen
commit: 307939315330f631f9f526f8560a2ce09605fc9c
Author: Fabian Groffen  gentoo  org>
AuthorDate: Wed Feb 17 20:19:58 2021 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Wed Feb 17 20:19:58 2021 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=30793931

qwhich: add applet to show paths to packages

e.g. to find the ebuild dir of bash in thw tree:
% qwhich -dt bash

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

 Makefile.am  |   3 +
 man/qwhich.1 |  79 +
 qwhich.c | 190 +++
 3 files changed, 272 insertions(+)

diff --git a/Makefile.am b/Makefile.am
index ceded24..cf578f4 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -23,6 +23,7 @@ APPLETS = \
qsize \
qtbz2 \
quse \
+   qwhich \
qxpak \
$(NULL)
 
@@ -42,6 +43,7 @@ dist_man_MANS = \
man/qsize.1 \
man/qtbz2.1 \
man/quse.1 \
+   man/qwhich.1 \
man/qxpak.1 \
$(NULL)
 
@@ -63,6 +65,7 @@ q_SOURCES = \
qsize.c \
qtbz2.c \
quse.c \
+   qwhich.c \
qxpak.c \
$(NULL)
 q_CPPFLAGS = \

diff --git a/man/qwhich.1 b/man/qwhich.1
new file mode 100644
index 000..dce52c2
--- /dev/null
+++ b/man/qwhich.1
@@ -0,0 +1,79 @@
+.\" generated by mkman.py, please do NOT edit!
+.TH qwhich "1" "Feb 2021" "Gentoo Foundation" "qwhich"
+.SH NAME
+qwhich \- find path to pkg
+.SH SYNOPSIS
+.B qwhich
+\fI[opts] \fR
+.SH DESCRIPTION
+
+.SH OPTIONS
+.TP
+\fB\-I\fR, \fB\-\-vdb\fR
+Look in VDB (installed packages).
+.TP
+\fB\-b\fR, \fB\-\-binpkg\fR
+Look at binary packages.
+.TP
+\fB\-t\fR, \fB\-\-tree\fR
+Look in main tree and overlays.
+.TP
+\fB\-p\fR, \fB\-\-pretty\fR
+Print (pretty) atom instead of path for use with -F.
+.TP
+\fB\-d\fR, \fB\-\-dir\fR
+Print directory instead of path.
+.TP
+\fB\-f\fR, \fB\-\-first\fR
+Stop searching after first match.
+.TP
+\fB\-F\fR \fI\fR, \fB\-\-format\fR \fI\fR
+Print matched using given format string.
+.TP
+\fB\-\-root\fR \fI\fR
+Set the ROOT env var.
+.TP
+\fB\-v\fR, \fB\-\-verbose\fR
+Report full package versions, emit more elaborate output.
+.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 "REPORTING BUGS"
+Please report bugs via http://bugs.gentoo.org/
+.br
+Product: Portage Development; Component: Tools
+.SH AUTHORS
+.nf
+Ned Ludd 
+Mike Frysinger 
+Fabian Groffen 
+.fi
+.SH "SEE ALSO"
+.BR q (1),
+.BR qatom (1),
+.BR qcheck (1),
+.BR qdepends (1),
+.BR qfile (1),
+.BR qgrep (1),
+.BR qkeyword (1),
+.BR qlist (1),
+.BR qlop (1),
+.BR qmanifest (1),
+.BR qmerge (1),
+.BR qpkg (1),
+.BR qsearch (1),
+.BR qsize (1),
+.BR qtbz2 (1),
+.BR qtegrity (1),
+.BR quse (1),
+.BR qxpak (1)

diff --git a/qwhich.c b/qwhich.c
new file mode 100644
index 000..3a0c791
--- /dev/null
+++ b/qwhich.c
@@ -0,0 +1,190 @@
+/*
+ * Copyright 2021 Gentoo Foundation
+ * Distributed under the terms of the GNU General Public License v2
+ *
+ * Copyright 2021- Fabian Groffen  - 
+ */
+
+#include "main.h"
+#include "applets.h"
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "atom.h"
+#include "tree.h"
+
+#define QWHICH_FLAGS "IbtpdfF:" COMMON_FLAGS
+static struct option const qwhich_long_opts[] = {
+   {"vdb",  no_argument, NULL, 'I'},
+   {"binpkg",   no_argument, NULL, 'b'},
+   {"tree", no_argument, NULL, 't'},
+   {"pretty",   no_argument, NULL, 'p'},
+   {"dir",  no_argument, NULL, 'd'},
+   {"first",no_argument, NULL, 'f'},
+   {"format",a_argument, NULL, 'F'},
+   COMMON_LONG_OPTS
+};
+static const char * const qwhich_opts_help[] = {
+   "Look in VDB (installed packages)",
+   "Look at binary packages",
+   "Look in main tree and overlays",
+   "Print (pretty) atom instead of path for use with -F",
+   "Print directory instead of path",
+   "Stop searching after first match",
+   "Print matched using given format string",
+   COMMON_OPTS_HELP
+};
+static const char qwhich_desc[] = "";
+#define qwhich_usage(ret) \
+   usage(ret, QWHICH_FLAGS, qwhich_long_opts, qwhich_opts_help, 
qwhich_desc, lookup_applet_idx("qwhich"))
+
+struct qwhich_mode {
+   char do_vdb:1;
+   char do_binpkg:1;
+   char do_tree:1;
+   char print_atom:1;
+   char print_path:1;
+   char match_first:1;
+   const char *fmt;
+};
+
+int qwhich_main(int argc, char **argv)
+{
+   depend_atom *atom;
+   DECLARE_ARRAY(atoms);
+   DECLARE_ARRAY(trees);
+   struct qwhich_mode m;
+   struct tree_match_ctx *tmc;
+   struct tree_match_ctx *tmcw;
+   size_t i;
+   size_t j;
+   char *overlay;
+   size_t n;
+   int ret;
+   tree_ctx *t;
+   int repol

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

2020-05-16 Thread Fabian Groffen
commit: ae5f28c57d2552786d813f44608cc74baf5fbf6d
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sat May 16 13:05:54 2020 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sat May 16 13:05:54 2020 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=ae5f28c5

qatom: add -s switch to strictly emulate a call to atom_compare

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

 man/qatom.1 |  5 -
 qatom.c | 29 -
 2 files changed, 24 insertions(+), 10 deletions(-)

diff --git a/man/qatom.1 b/man/qatom.1
index 4f6ccf2..9ebb9a0 100644
--- a/man/qatom.1
+++ b/man/qatom.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qatom "1" "Jan 2020" "Gentoo Foundation" "qatom"
+.TH qatom "1" "May 2020" "Gentoo Foundation" "qatom"
 .SH NAME
 qatom \- split atom strings
 .SH SYNOPSIS
@@ -67,6 +67,9 @@ The package suffices, currently that is just the asterisk.
 \fB\-c\fR, \fB\-\-compare\fR
 Compare two atoms.
 .TP
+\fB\-s\fR, \fB\-\-scompare\fR
+Compare two atoms in the given order data, query.
+.TP
 \fB\-p\fR, \fB\-\-print\fR
 Print reconstructed atom.
 .TP

diff --git a/qatom.c b/qatom.c
index 59f7392..1c1c50e 100644
--- a/qatom.c
+++ b/qatom.c
@@ -15,10 +15,11 @@
 
 #define QATOM_FORMAT "%{CATEGORY} %{PN} %{PV} %[PR] %[SLOT] %[pfx] %[sfx]"
 
-#define QATOM_FLAGS "F:cpl" COMMON_FLAGS
+#define QATOM_FLAGS "F:cspl" COMMON_FLAGS
 static struct option const qatom_long_opts[] = {
{"format", a_argument, NULL, 'F'},
{"compare",   no_argument, NULL, 'c'},
+   {"scompare",  no_argument, NULL, 's'},
{"print", no_argument, NULL, 'p'},
{"lookup",no_argument, NULL, 'l'},
COMMON_LONG_OPTS
@@ -26,6 +27,7 @@ static struct option const qatom_long_opts[] = {
 static const char * const qatom_opts_help[] = {
"Custom output format (default: " QATOM_FORMAT ")",
"Compare two atoms",
+   "Compare two atoms in the given order data, query",
"Print reconstructed atom",
"Lookup atom in tree",
COMMON_OPTS_HELP
@@ -34,7 +36,13 @@ static const char * const qatom_opts_help[] = {
 
 int qatom_main(int argc, char **argv)
 {
-   enum qatom_atom { _EXPLODE=0, _COMPARE, _PRINT, _LOOKUP } action = 
_EXPLODE;
+   enum qatom_atom {
+   _EXPLODE = 0,
+   _COMPARE,
+   _SCOMPARE,
+   _PRINT,
+   _LOOKUP
+   } action = _EXPLODE;
const char *format = QATOM_FORMAT;
depend_atom *atom;
depend_atom *atomc;
@@ -43,10 +51,11 @@ int qatom_main(int argc, char **argv)
 
while ((i = GETOPT_LONG(QATOM, qatom, "")) != -1) {
switch (i) {
-   case 'F': format = optarg;   break;
-   case 'c': action = _COMPARE; break;
-   case 'p': action = _PRINT;   break;
-   case 'l': action = _LOOKUP;  break;
+   case 'F': format = optarg;break;
+   case 'c': action = _COMPARE;  break;
+   case 's': action = _SCOMPARE; break;
+   case 'p': action = _PRINT;break;
+   case 'l': action = _LOOKUP;   break;
COMMON_GETOPTS_CASES(qatom)
}
}
@@ -54,7 +63,7 @@ int qatom_main(int argc, char **argv)
if (argc == optind)
qatom_usage(EXIT_FAILURE);
 
-   if (action == _COMPARE && (argc - optind) % 2)
+   if ((action == _COMPARE || action == _SCOMPARE) && (argc - optind) % 2)
err("compare needs even number of arguments");
 
if (action == _LOOKUP) {
@@ -71,7 +80,8 @@ int qatom_main(int argc, char **argv)
}
 
switch (action) {
-   case _COMPARE: {
+   case _COMPARE:
+   case _SCOMPARE: {
int r;
 
i++;
@@ -81,7 +91,8 @@ int qatom_main(int argc, char **argv)
break;
}
 
-   if (atomc->blocker != ATOM_BL_NONE ||
+   if (action == _SCOMPARE ||
+   atomc->blocker != ATOM_BL_NONE ||
atomc->pfx_op != ATOM_OP_NONE ||
atomc->sfx_op != ATOM_OP_NONE ||
(atomc->CATEGORY == NULL &&



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

2019-07-14 Thread Fabian Groffen
commit: ccfa1c152556ee6080731e2d1d51d92e5cd0b278
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sun Jul 14 10:17:20 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sun Jul 14 10:17:20 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=ccfa1c15

qlop: add -F argument

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

 man/qlop.1 |  3 +++
 qlop.c | 43 ++-
 2 files changed, 29 insertions(+), 17 deletions(-)

diff --git a/man/qlop.1 b/man/qlop.1
index 3fb9c7a..10eaa27 100644
--- a/man/qlop.1
+++ b/man/qlop.1
@@ -109,6 +109,9 @@ Read emerge logfile instead of $EMERGE_LOG_DIR/emerge.log.
 \fB\-w\fR \fI\fR, \fB\-\-atoms\fR \fI\fR
 Read package atoms to report from file.
 .TP
+\fB\-F\fR \fI\fR, \fB\-\-format\fR \fI\fR
+Print matched atom using given format string.
+.TP
 \fB\-\-root\fR \fI\fR
 Set the ROOT env var.
 .TP

diff --git a/qlop.c b/qlop.c
index bd16018..e20c97b 100644
--- a/qlop.c
+++ b/qlop.c
@@ -24,7 +24,7 @@
 
 #define QLOP_DEFAULT_LOGFILE "emerge.log"
 
-#define QLOP_FLAGS "ctaHMmuUslerd:f:w:" COMMON_FLAGS
+#define QLOP_FLAGS "ctaHMmuUslerd:f:w:F:" COMMON_FLAGS
 static struct option const qlop_long_opts[] = {
{"summary",   no_argument, NULL, 'c'},
{"time",  no_argument, NULL, 't'},
@@ -41,6 +41,7 @@ static struct option const qlop_long_opts[] = {
{"lastmerge", no_argument, NULL, 'l'},
{"logfile",a_argument, NULL, 'f'},
{"atoms",  a_argument, NULL, 'w'},
+   {"format", a_argument, NULL, 'F'},
COMMON_LONG_OPTS
 };
 static const char * const qlop_opts_help[] = {
@@ -59,6 +60,7 @@ static const char * const qlop_opts_help[] = {
"Limit selection to last Portage emerge action",
"Read emerge logfile instead of $EMERGE_LOG_DIR/" QLOP_DEFAULT_LOGFILE,
"Read package atoms to report from file",
+   "Print matched atom using given format string",
COMMON_OPTS_HELP
 };
 static const char qlop_desc[] =
@@ -83,6 +85,7 @@ struct qlop_mode {
char do_machine:1;
char do_endtime:1;
char show_lastmerge:1;
+   const char *fmt;
 };
 
 static bool
@@ -347,10 +350,6 @@ static int do_emerge_log(
};
struct pkg_match *pkg;
struct pkg_match *pkgw;
-   const char *afmt = "%[CATEGORY]%[PN]";
-
-   if (verbose)
-   afmt = "%[CATEGORY]%[PF]";
 
if ((fp = fopen(log, "r")) == NULL) {
warnp("Could not open logfile '%s'", log);
@@ -621,19 +620,19 @@ static int do_emerge_log(
}
if (quiet && !flags->do_average) {
printf("%s%s%s\n",
-   
atom_format(afmt, pkgw->atom),
+   
atom_format(flags->fmt, pkgw->atom),
flags->do_time 
? ": " : "",
flags->do_time ?

fmt_elapsedtime(flags, elapsed) : "");
} else if (flags->do_time) {
printf("%s >>> %s: %s\n",
fmt_date(flags, 
pkgw->tbegin, tstart),
-   
atom_format(afmt, pkgw->atom),
+   
atom_format(flags->fmt, pkgw->atom),

fmt_elapsedtime(flags, elapsed));
} else if (!flags->do_average) {
printf("%s >>> %s\n",
fmt_date(flags, 
pkgw->tbegin, tstart),
-   
atom_format(afmt, pkgw->atom));
+   
atom_format(flags->fmt, pkgw->atom));
}
atom_implode(pkgw->atom);
xarraydelete(merge_matches, i);
@@ -726,19 +725,19 @@ static int do_emerge_log(
}
if (quiet && !flags->do_average) {
printf("%s%s%s\n",
-   
atom_format(afmt, pkgw->atom),
+   
atom_format(flags->fmt, pkgw->atom),
flags->do_time 
? ": " : "",
  

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

2019-07-14 Thread Fabian Groffen
commit: ee8c746db135320fe41c1dc830bda1617216b916
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sun Jul 14 10:14:39 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sun Jul 14 10:14:39 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=ee8c746d

main: nicely format/wrap help arguments in -h output

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

 main.c   | 51 +++
 man/mkman.py |  8 
 2 files changed, 43 insertions(+), 16 deletions(-)

diff --git a/main.c b/main.c
index bdbb2a7..5d4c4cd 100644
--- a/main.c
+++ b/main.c
@@ -92,14 +92,18 @@ usage(int status, const char *flags, struct option const 
opts[],
const char opt_arg[] = "[arg]";
const char a_arg[] = "";
size_t a_arg_len = strlen(a_arg) + 1;
-   size_t i, optlen;
+   size_t i;
+   size_t optlen;
+   size_t l;
+   size_t prefixlen;
+   const char *hstr;
FILE *fp = status == EXIT_SUCCESS ? stdout : warnout;
 
if (blabber == 0) {
-   fprintf(fp, "%sUsage:%s %sq%s %s %s  : %s"
+   fprintf(fp, "%susage:%s %sq%s %s %s  : %s"
"invoke a portage utility applet\n\n", GREEN,
NORM, YELLOW, NORM, DKBLUE, RED, NORM);
-   fprintf(fp, "%sCurrently defined applets:%s\n", GREEN, NORM);
+   fprintf(fp, "%scurrently defined applets:%s\n", GREEN, NORM);
for (i = 0; applets[i].desc; ++i)
if (applets[i].func)
fprintf(fp, " %s%8s%s %s%-16s%s%s:%s %s\n",
@@ -107,7 +111,7 @@ usage(int status, const char *flags, struct option const 
opts[],
DKBLUE, applets[i].opts, NORM,
RED, NORM, _(applets[i].desc));
} else if (blabber > 0) {
-   fprintf(fp, "%sUsage:%s %s%s%s [opts] %s%s%s %s:%s %s\n",
+   fprintf(fp, "%susage:%s %s%s%s [opts] %s%s%s %s:%s %s\n",
GREEN, NORM,
YELLOW, applets[blabber].name, NORM,
DKBLUE, applets[blabber].opts, NORM,
@@ -116,19 +120,19 @@ usage(int status, const char *flags, struct option const 
opts[],
fprintf(fp, "\n%s\n", desc);
}
if (module_name != NULL)
-   fprintf(fp, "%sLoaded module:%s\n%s%8s%s %s%s\n",
+   fprintf(fp, "%sloaded module:%s\n%s%8s%s %s%s\n",
GREEN, NORM, YELLOW, module_name, NORM, DKBLUE, NORM);
 
/* Prescan the --long opt length to auto-align. */
optlen = 0;
for (i = 0; opts[i].name; ++i) {
-   size_t l = strlen(opts[i].name);
+   l = strlen(opts[i].name);
if (opts[i].has_arg != no_argument)
l += a_arg_len;
optlen = MAX(l, optlen);
}
 
-   fprintf(fp, "\n%sOptions:%s -[%s]\n", GREEN, NORM, flags);
+   fprintf(fp, "\n%soptions:%s -[%s]\n", GREEN, NORM, flags);
for (i = 0; opts[i].name; ++i) {
/* this assert is a life saver when adding new applets. */
assert(help[i] != NULL);
@@ -139,16 +143,39 @@ usage(int status, const char *flags, struct option const 
opts[],
else
fprintf(fp, "  -%c, ", opts[i].val);
 
-   /* then the long flag + help text */
+   /* then the long flag */
if (opts[i].has_arg == no_argument)
-   fprintf(fp, "--%-*s %s*%s %s\n", (int)optlen, 
opts[i].name,
-   RED, NORM, _(help[i]));
+   fprintf(fp, "--%-*s %s*%s ", (int)optlen, opts[i].name,
+   RED, NORM);
else
-   fprintf(fp, "--%s %s%s%s%*s %s*%s %s\n",
+   fprintf(fp, "--%s %s%s%s%*s %s*%s ",
opts[i].name,
DKBLUE, (opts[i].has_arg == a_argument ? a_arg 
: opt_arg), NORM,
(int)(optlen - strlen(opts[i].name) - 
a_arg_len), "",
-   RED, NORM, _(help[i]));
+   RED, NORM);
+
+   /* then wrap the help text, if necessary */
+   prefixlen = 6 + 2 + optlen + 1 + 1 + 1;
+   if ((size_t)twidth < prefixlen + 10) {
+   fprintf(fp, "%s\n", _(help[i]));
+   } else {
+   const char *t;
+   hstr = _(help[i]);
+   l = strlen(hstr);
+   while (twidth - prefixlen < l) {
+   /* search backwards for a space */
+   t = &hstr[twidth - prefixlen];
+   while (t > hstr && !isspace((int)*t))
+

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

2019-07-14 Thread Fabian Groffen
commit: 47087590e69be3b84c299d4e69d028d8c783b14e
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sun Jul 14 09:31:21 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sun Jul 14 09:31:21 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=47087590

applets: reword -v help description into what it really is

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

 applets.h   | 2 +-
 man/q.1 | 4 ++--
 man/qatom.1 | 2 +-
 man/qcheck.1| 2 +-
 man/qdepends.1  | 2 +-
 man/qgrep.1 | 2 +-
 man/qkeyword.1  | 4 ++--
 man/qlist.1 | 2 +-
 man/qlop.1  | 2 +-
 man/qmanifest.1 | 4 ++--
 man/qmerge.1| 4 ++--
 man/qpkg.1  | 2 +-
 man/qsearch.1   | 2 +-
 man/qsize.1 | 2 +-
 man/qtbz2.1 | 2 +-
 man/qtegrity.1  | 4 ++--
 man/quse.1  | 2 +-
 man/qxpak.1 | 4 ++--
 18 files changed, 24 insertions(+), 24 deletions(-)

diff --git a/applets.h b/applets.h
index acc85da..999cf7a 100644
--- a/applets.h
+++ b/applets.h
@@ -133,7 +133,7 @@ static const struct applet_t {
{NULL,no_argument, NULL, 0x0}
 #define COMMON_OPTS_HELP \
"Set the ROOT env var", \
-   "Make a lot of noise", \
+   "Report full package versions, emit more elaborate output", \
"Tighter output; suppress warnings", \
"Don't output color", \
"Print this help and exit", \

diff --git a/man/q.1 b/man/q.1
index 0546ab1..4e6264c 100644
--- a/man/q.1
+++ b/man/q.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH q "1" "May 2019" "Gentoo Foundation" "q"
+.TH q "1" "Jul 2019" "Gentoo Foundation" "q"
 .SH NAME
 q \- invoke a portage utility applet
 .SH SYNOPSIS
@@ -26,7 +26,7 @@ Print available overlays (read from repos.conf).
 Set the ROOT env var.
 .TP
 \fB\-v\fR, \fB\-\-verbose\fR
-Make a lot of noise.
+Report full package versions, emit more elaborate output.
 .TP
 \fB\-q\fR, \fB\-\-quiet\fR
 Tighter output; suppress warnings.

diff --git a/man/qatom.1 b/man/qatom.1
index 968e1af..ab6cfb3 100644
--- a/man/qatom.1
+++ b/man/qatom.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qatom "1" "Jun 2019" "Gentoo Foundation" "qatom"
+.TH qatom "1" "Jul 2019" "Gentoo Foundation" "qatom"
 .SH NAME
 qatom \- split atom strings
 .SH SYNOPSIS

diff --git a/man/qcheck.1 b/man/qcheck.1
index f48fa63..fce6b42 100644
--- a/man/qcheck.1
+++ b/man/qcheck.1
@@ -40,7 +40,7 @@ Undo prelink when calculating checksums.
 Set the ROOT env var.
 .TP
 \fB\-v\fR, \fB\-\-verbose\fR
-Make a lot of noise.
+Report full package versions, emit more elaborate output.
 .TP
 \fB\-q\fR, \fB\-\-quiet\fR
 Tighter output; suppress warnings.

diff --git a/man/qdepends.1 b/man/qdepends.1
index 7898e3d..8b0ad69 100644
--- a/man/qdepends.1
+++ b/man/qdepends.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qdepends "1" "Jun 2019" "Gentoo Foundation" "qdepends"
+.TH qdepends "1" "Jul 2019" "Gentoo Foundation" "qdepends"
 .SH NAME
 qdepends \- show dependency info
 .SH SYNOPSIS

diff --git a/man/qgrep.1 b/man/qgrep.1
index fbde702..f3a5c2d 100644
--- a/man/qgrep.1
+++ b/man/qgrep.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qgrep "1" "Jun 2019" "Gentoo Foundation" "qgrep"
+.TH qgrep "1" "Jul 2019" "Gentoo Foundation" "qgrep"
 .SH NAME
 qgrep \- grep in ebuilds
 .SH SYNOPSIS

diff --git a/man/qkeyword.1 b/man/qkeyword.1
index 483c608..a191d72 100644
--- a/man/qkeyword.1
+++ b/man/qkeyword.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qkeyword "1" "May 2019" "Gentoo Foundation" "qkeyword"
+.TH qkeyword "1" "Jul 2019" "Gentoo Foundation" "qkeyword"
 .SH NAME
 qkeyword \- list packages based on keywords
 .SH SYNOPSIS
@@ -53,7 +53,7 @@ list packages that aren't keyworded on a given arch.
 Set the ROOT env var.
 .TP
 \fB\-v\fR, \fB\-\-verbose\fR
-Make a lot of noise.
+Report full package versions, emit more elaborate output.
 .TP
 \fB\-q\fR, \fB\-\-quiet\fR
 Tighter output; suppress warnings.

diff --git a/man/qlist.1 b/man/qlist.1
index cd1e8bb..8f9cf56 100644
--- a/man/qlist.1
+++ b/man/qlist.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qlist "1" "May 2019" "Gentoo Foundation" "qlist"
+.TH qlist "1" "Jul 2019" "Gentoo Foundation" "qlist"
 .SH NAME
 qlist \- list files owned by pkgname
 .SH SYNOPSIS

diff --git a/man/qlop.1 b/man/qlop.1
index f42a853..3fb9c7a 100644
--- a/man/qlop.1
+++ b/man/qlop.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qlop "1" "May 2019" "Gentoo Foundation" "qlop"
+.TH qlop "1" "Jul 2019" "Gentoo Foundation" "qlop"
 .SH NAME
 qlop \- emerge log analyzer
 .SH SYNOPSIS

diff --git a/man/qmanifest.1 b/man/qmanifest.1
index 15027f6..5d00bd3 100644
--- a/man/qmanifest.1
+++ b/man/qmanifest.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qmanifest "1" "May 2019" "Gentoo Foundation" "qmanifest"
+.TH qmanifest "1" "Jul 2019" "Gentoo Foundation" "qmanifest"
 .SH NAME
 qmani

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

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

qfile add -F argument

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

 man/qcheck.1 |  5 -
 man/qfile.1  |  5 -
 qfile.c  | 49 -
 3 files changed, 32 insertions(+), 27 deletions(-)

diff --git a/man/qcheck.1 b/man/qcheck.1
index 9e4d873..f48fa63 100644
--- a/man/qcheck.1
+++ b/man/qcheck.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qcheck "1" "May 2019" "Gentoo Foundation" "qcheck"
+.TH qcheck "1" "Jul 2019" "Gentoo Foundation" "qcheck"
 .SH NAME
 qcheck \- verify integrity of installed packages
 .SH SYNOPSIS
@@ -9,6 +9,9 @@ qcheck \- verify integrity of installed packages
 
 .SH OPTIONS
 .TP
+\fB\-F\fR \fI\fR, \fB\-\-format\fR \fI\fR
+Custom output format (default: %[CATEGORY]%[PN]).
+.TP
 \fB\-s\fR \fI\fR, \fB\-\-skip\fR \fI\fR
 Ignore files matching the regular expression .
 .TP

diff --git a/man/qfile.1 b/man/qfile.1
index 6dedef2..33dfbee 100644
--- a/man/qfile.1
+++ b/man/qfile.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qfile "1" "May 2019" "Gentoo Foundation" "qfile"
+.TH qfile "1" "Jul 2019" "Gentoo Foundation" "qfile"
 .SH NAME
 qfile \- list all pkgs owning files
 .SH SYNOPSIS
@@ -35,6 +35,9 @@ After version \fB0.74\fR of portage-utils, the \fB-b\fR 
option was
 renamed to \fB-d\fR.
 .SH OPTIONS
 .TP
+\fB\-F\fR \fI\fR, \fB\-\-format\fR \fI\fR
+Print matched atom using given format string.
+.TP
 \fB\-S\fR, \fB\-\-slots\fR
 Display installed packages with slots.
 .TP

diff --git a/qfile.c b/qfile.c
index 1a6b470..bc5c9ac 100644
--- a/qfile.c
+++ b/qfile.c
@@ -20,8 +20,9 @@
 #include "rmspace.h"
 #include "tree.h"
 
-#define QFILE_FLAGS "doRx:S" COMMON_FLAGS
+#define QFILE_FLAGS "F:doRx:S" COMMON_FLAGS
 static struct option const qfile_long_opts[] = {
+   {"format",   a_argument, NULL, 'F'},
{"slots",   no_argument, NULL, 'S'},
{"root-prefix", no_argument, NULL, 'R'},
{"dir", no_argument, NULL, 'd'},
@@ -30,6 +31,7 @@ static struct option const qfile_long_opts[] = {
COMMON_LONG_OPTS
 };
 static const char * const qfile_opts_help[] = {
+   "Print matched atom using given format string",
"Display installed packages with slots",
"Assume arguments are already prefixed by $ROOT",
"Also match directories for single component arguments",
@@ -64,16 +66,13 @@ struct qfile_opt_state {
char *exclude_pkg;
char *exclude_slot;
depend_atom *exclude_atom;
-   bool slotted;
bool basename;
bool orphans;
bool assume_root_prefix;
+   const char *format;
+   bool need_full_atom;
 };
 
-/*
- * We assume the people calling us have chdir(/var/db/pkg) and so
- * we use relative paths throughout here.
- */
 static int qfile_cb(tree_pkg_ctx *pkg_ctx, void *priv)
 {
struct qfile_opt_state *state = priv;
@@ -215,24 +214,9 @@ static int qfile_cb(tree_pkg_ctx *pkg_ctx, void *priv)
continue;
 
if (non_orphans == NULL) {
-   const char *fmt;
-
-   atom = tree_get_atom(pkg_ctx, true);
+   atom = tree_get_atom(pkg_ctx, 
state->need_full_atom);
 
-   if (state->slotted) {
-   if (verbose) {
-   fmt = "%[CATEGORY]%[PF]%[SLOT]";
-   } else {
-   fmt = "%[CATEGORY]%[PN]%[SLOT]";
-   }
-   } else {
-   if (verbose) {
-   fmt = "%[CATEGORY]%[PF]";
-   } else {
-   fmt = "%[CATEGORY]%[PN]";
-   }
-   }
-   printf("%s", atom_format(fmt, atom));
+   printf("%s", atom_format(state->format, atom));
if (quiet)
puts("");
else
@@ -402,10 +386,11 @@ int qfile_main(int argc, char **argv)
 {
struct qfile_opt_state state = {
.buflen = _Q_PATH_MAX,
-   .slotted = false,
+   .need_full_atom = false,
.basename = false,
.orphans = false,
.assume_root_prefix = false,
+   .format = NULL,
};
int i, nb_of_queries, found = 0;

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

2019-07-14 Thread Fabian Groffen
commit: 46f6f4a1c29eb1bcd66af043b13d6952ad3a5e0a
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sun Jul 14 11:43:29 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sun Jul 14 11:43:29 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=46f6f4a1

qsearch: add -F argument, also make -v act like for other applets

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

 man/qsearch.1 |  3 +++
 qsearch.c | 59 ---
 2 files changed, 39 insertions(+), 23 deletions(-)

diff --git a/man/qsearch.1 b/man/qsearch.1
index f6b9baf..e805f82 100644
--- a/man/qsearch.1
+++ b/man/qsearch.1
@@ -29,6 +29,9 @@ Show homepage info instead of description.
 \fB\-R\fR, \fB\-\-repo\fR
 Show repository the ebuild originates from.
 .TP
+\fB\-F\fR \fI\fR, \fB\-\-format\fR \fI\fR
+Print matched atom using given format string.
+.TP
 \fB\-\-root\fR \fI\fR
 Set the ROOT env var.
 .TP

diff --git a/qsearch.c b/qsearch.c
index db220c7..8245383 100644
--- a/qsearch.c
+++ b/qsearch.c
@@ -25,7 +25,7 @@
 #include "xarray.h"
 #include "xregex.h"
 
-#define QSEARCH_FLAGS "asSNHR" COMMON_FLAGS
+#define QSEARCH_FLAGS "asSNHRF:" COMMON_FLAGS
 static struct option const qsearch_long_opts[] = {
{"all",   no_argument, NULL, 'a'},
{"search",no_argument, NULL, 's'},
@@ -33,6 +33,7 @@ static struct option const qsearch_long_opts[] = {
{"name-only", no_argument, NULL, 'N'},
{"homepage",  no_argument, NULL, 'H'},
{"repo",  no_argument, NULL, 'R'},
+   {"format", a_argument, NULL, 'F'},
COMMON_LONG_OPTS
 };
 static const char * const qsearch_opts_help[] = {
@@ -42,6 +43,7 @@ static const char * const qsearch_opts_help[] = {
"Only show package name",
"Show homepage info instead of description",
"Show repository the ebuild originates from",
+   "Print matched atom using given format string",
COMMON_OPTS_HELP
 };
 #define qsearch_usage(ret) usage(ret, QSEARCH_FLAGS, qsearch_long_opts, 
qsearch_opts_help, NULL, lookup_applet_idx("qsearch"))
@@ -50,10 +52,11 @@ struct qsearch_state {
bool show_homepage:1;
bool show_name:1;
bool show_desc:1;
-   bool show_repo:1;
bool search_desc:1;
bool search_name:1;
+   bool need_full_atom:1;
regex_t search_expr;
+   const char *fmt;
 };
 
 static int
@@ -99,16 +102,10 @@ qsearch_cb(tree_pkg_ctx *pkg_ctx, void *priv)
match = true;
 
if (match) {
-   const char *qfmt;
-   if (state->show_repo) {
-   atom = tree_get_atom(pkg_ctx, 1);
-   qfmt = "%[CATEGORY]%[PN]%[REPO]";
-   } else {
-   qfmt = "%[CATEGORY]%[PN]";
-   }
+   atom = tree_get_atom(pkg_ctx, state->need_full_atom);
printf("%s%s%s\n",
-   atom_format(qfmt, atom),
-   (state->show_name ? "" : " "),
+   atom_format(state->fmt, atom),
+   (state->show_name ? "" : ": "),
(state->show_name ? "" : desc ? desc : ""));
}
 
@@ -131,23 +128,25 @@ int qsearch_main(int argc, char **argv)
const char *overlay;
size_t n;
struct qsearch_state state = {
-   .show_homepage = false,
-   .show_name = false,
-   .show_desc = false,
-   .show_repo = false,
-   .search_desc = false,
-   .search_name = false,
+   .show_homepage  = false,
+   .show_name  = false,
+   .show_desc  = false,
+   .search_desc= false,
+   .search_name= false,
+   .need_full_atom = false,
+   .fmt= NULL,
};
 
while ((i = GETOPT_LONG(QSEARCH, qsearch, "")) != -1) {
switch (i) {
COMMON_GETOPTS_CASES(qsearch)
-   case 'a': search_me   = ".*";  break;
-   case 's': state.search_name   = true;  break;
-   case 'S': state.search_desc   = true;  break;
-   case 'N': state.show_name = true;  break;
-   case 'H': state.show_homepage = true;  break;
-   case 'R': state.show_repo = true;  break;
+   case 'a': search_me= ".*";   break;
+   case 's': state.search_name= true;   break;
+   case 'S': state.search_desc= true;   break;
+   case 'N': state.show_name  = true;   break;
+   case 'H': state.show_homepage  = true;   break;
+   case 'F': state.fmt= optarg; /* fall through */
+   case 'R': state.need_full_atom = true;   break;
}
}
 
@@ -165,6 +164,20 @@ int qsearch_main(int argc

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

2019-07-14 Thread Fabian Groffen
commit: 44b67c2d685a763c3f8aee1ecffc8d3f5ababe4c
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sun Jul 14 11:55:07 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sun Jul 14 11:55:07 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=44b67c2d

qsize: add -F argument, changed default format to match other applets

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

 man/qsize.1 |  3 +++
 qsize.c | 36 +++-
 2 files changed, 30 insertions(+), 9 deletions(-)

diff --git a/man/qsize.1 b/man/qsize.1
index 3a359e4..df85970 100644
--- a/man/qsize.1
+++ b/man/qsize.1
@@ -33,6 +33,9 @@ Display all sizes in bytes.
 Filter out entries matching \fI\fR, which is a regular
 expression, before calculating size.
 .TP
+\fB\-F\fR \fI\fR, \fB\-\-format\fR \fI\fR
+Print matched atom using given format string.
+.TP
 \fB\-\-root\fR \fI\fR
 Set the ROOT env var.
 .TP

diff --git a/qsize.c b/qsize.c
index 10aadc8..1f1dfc9 100644
--- a/qsize.c
+++ b/qsize.c
@@ -55,7 +55,7 @@
 #include "xarray.h"
 #include "xregex.h"
 
-#define QSIZE_FLAGS "fsSmkbi:" COMMON_FLAGS
+#define QSIZE_FLAGS "fsSmkbi:F:" COMMON_FLAGS
 static struct option const qsize_long_opts[] = {
{"filesystem", no_argument, NULL, 'f'},
{"sum",no_argument, NULL, 's'},
@@ -64,6 +64,7 @@ static struct option const qsize_long_opts[] = {
{"kilobytes",  no_argument, NULL, 'k'},
{"bytes",  no_argument, NULL, 'b'},
{"ignore",  a_argument, NULL, 'i'},
+   {"format",  a_argument, NULL, 'F'},
COMMON_LONG_OPTS
 };
 static const char * const qsize_opts_help[] = {
@@ -74,6 +75,7 @@ static const char * const qsize_opts_help[] = {
"Display all sizes in kilobytes",
"Display all sizes in bytes",
"Ignore regexp string",
+   "Print matched atom using given format string",
COMMON_OPTS_HELP
 };
 #define qsize_usage(ret) usage(ret, QSIZE_FLAGS, qsize_long_opts, 
qsize_opts_help, NULL, lookup_applet_idx("qsize"))
@@ -88,6 +90,8 @@ struct qsize_opt_state {
size_t disp_units;
const char *str_disp_units;
array_t *ignore_regexp;
+   const char *fmt;
+   bool need_full_atom:1;
 
size_t buflen;
char *buf;
@@ -160,9 +164,9 @@ qsize_cb(tree_pkg_ctx *pkg_ctx, void *priv)
state->num_all_ignored += num_ignored;
 
if (!state->summary_only) {
-   atom = tree_get_atom(pkg_ctx, 0);
+   atom = tree_get_atom(pkg_ctx, state->need_full_atom);
printf("%s: %'zu files, %'zu non-files, ",
-   atom_format("%[CATEGORY]%[PF]", atom),
+   atom_format(state->fmt, atom),
num_files, num_nonfiles);
if (num_ignored)
printf("%'zu names-ignored, ", num_ignored);
@@ -195,17 +199,24 @@ int qsize_main(int argc, char **argv)
.num_all_files = 0,
.num_all_nonfiles = 0,
.num_all_ignored = 0,
+   .need_full_atom = false,
+   .fmt = NULL,
};
 
while ((ret = GETOPT_LONG(QSIZE, qsize, "")) != -1) {
switch (ret) {
COMMON_GETOPTS_CASES(qsize)
-   case 'f': state.fs_size = 1; break;
-   case 's': state.summary = 1; break;
-   case 'S': state.summary = state.summary_only = 1; break;
-   case 'm': state.disp_units = MEGABYTE; state.str_disp_units = 
"MiB"; break;
-   case 'k': state.disp_units = KILOBYTE; state.str_disp_units = 
"KiB"; break;
-   case 'b': state.disp_units = 1; state.str_disp_units = "bytes"; 
break;
+   case 'f': state.fs_size = 1;   break;
+   case 's': state.summary = 1;   break;
+   case 'S': state.summary = state.summary_only = 1;  break;
+   case 'm': state.disp_units = MEGABYTE;
+ state.str_disp_units = "MiB";
break;
+   case 'k': state.disp_units = KILOBYTE;
+ state.str_disp_units = "KiB";
break;
+   case 'b': state.disp_units = 1;
+ state.str_disp_units = "bytes";  
break;
+   case 'F': state.fmt = optarg;
+ state.need_full_atom = true; 
break;
case 'i': {
regex_t regex;
xregcomp(®ex, optarg, REG_EXTENDED|REG_NOSUB);
@@ -225,6 +236,13 @@ int qsize_main(int argc, char **argv)
xarraypush_ptr(state.atoms, atom);
}
 
+   if (state.fmt == NULL) {
+   if (verbose)
+   state.fmt = "%[CATEGORY]%[PF]";
+   else
+   state.fmt = "%[CATEGORY]%[PN]";
+   }
+
st

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

2019-07-14 Thread Fabian Groffen
commit: bc9b220f15d357ea2b729311a3f9da563d978438
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sun Jul 14 18:43:49 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sun Jul 14 18:43:49 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=bc9b220f

qlist: add -F argument

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

 man/qlist.1 |   3 ++
 qlist.c | 116 ++--
 2 files changed, 68 insertions(+), 51 deletions(-)

diff --git a/man/qlist.1 b/man/qlist.1
index 8f9cf56..2fd9575 100644
--- a/man/qlist.1
+++ b/man/qlist.1
@@ -52,6 +52,9 @@ Only show objects.
 \fB\-s\fR, \fB\-\-sym\fR
 Only show symlinks.
 .TP
+\fB\-F\fR \fI\fR, \fB\-\-format\fR \fI\fR
+Print matched atom using given format string.
+.TP
 \fB\-\-root\fR \fI\fR
 Set the ROOT env var.
 .TP

diff --git a/qlist.c b/qlist.c
index ab3fb4f..e0a8a07 100644
--- a/qlist.c
+++ b/qlist.c
@@ -21,7 +21,7 @@
 #include "tree.h"
 #include "xregex.h"
 
-#define QLIST_FLAGS "ISRUcDeados" COMMON_FLAGS
+#define QLIST_FLAGS "ISRUcDeadosF:" COMMON_FLAGS
 static struct option const qlist_long_opts[] = {
{"installed", no_argument, NULL, 'I'},
{"slots", no_argument, NULL, 'S'},
@@ -35,10 +35,11 @@ static struct option const qlist_long_opts[] = {
{"obj",   no_argument, NULL, 'o'},
{"sym",   no_argument, NULL, 's'},
/* {"file",   a_argument, NULL, 'f'}, */
+   {"format", a_argument, NULL, 'F'},
COMMON_LONG_OPTS
 };
 static const char * const qlist_opts_help[] = {
-   "Just show installed packages",
+   "Just show installed package names",
"Display installed packages with slots (use twice for subslots)",
"Display installed packages with repository",
"Display installed packages with flags used",
@@ -50,6 +51,7 @@ static const char * const qlist_opts_help[] = {
"Only show objects",
"Only show symlinks",
/* "query filename for pkgname", */
+   "Print matched atom using given format string",
COMMON_OPTS_HELP
 };
 #define qlist_usage(ret) usage(ret, QLIST_FLAGS, qlist_long_opts, 
qlist_opts_help, NULL, lookup_applet_idx("qlist"))
@@ -311,19 +313,18 @@ struct qlist_opt_state {
int argc;
char **argv;
depend_atom **atoms;
-   bool exact;
-   bool all;
-   bool just_pkgname;
-   bool show_dir;
-   bool show_obj;
-   bool show_repo;
-   bool show_sym;
-   int show_slots;
-   bool show_umap;
-   bool show_dbg;
-   bool columns;
+   bool exact:1;
+   bool all:1;
+   bool just_pkgname:1;
+   bool show_dir:1;
+   bool show_obj:1;
+   bool show_sym:1;
+   bool need_full_atom:1;
+   bool show_umap:1;
+   bool show_dbg:1;
char *buf;
size_t buflen;
+   const char *fmt;
 };
 
 static int
@@ -342,29 +343,11 @@ qlist_cb(tree_pkg_ctx *pkg_ctx, void *priv)
if ((i == state->argc) && (state->argc != optind))
return 0;
 
-   atom = tree_get_atom(pkg_ctx, false);
+   atom = tree_get_atom(pkg_ctx, state->need_full_atom);
if (state->just_pkgname) {
if ((state->all + state->just_pkgname) < 2) {
-   char qfmt[128];
-   atom = tree_get_atom(pkg_ctx,
-   state->show_slots || state->show_repo);
-   if (state->columns) {
-   snprintf(qfmt, sizeof(qfmt),
-   "%%{CATEGORY} %%{PN}%s%s%s%s",
-   verbose ? " %{PVR}" : "",
-   state->show_slots >= 1 ? " 
%{SLOT}" : "",
-   state->show_slots >= 2 ? " 
%{SUBSLOT}" : "",
-   state->show_repo ? " %{REPO}" : 
"");
-   } else {
-   snprintf(qfmt, sizeof(qfmt),
-   "%%[CATEGORY]%%[P%c]%s%s%s",
-   verbose ? 'F' : 'N',
-   state->show_slots >= 1 ? 
"%[SLOT]" : "",
-   state->show_slots >= 2 ? 
"%[SUBSLOT]" : "",
-   state->show_repo ? "%[REPO]" : 
"");
-   }
printf("%s%s\n",
-   atom_format(qfmt, atom),
+   atom_format(state->fmt, atom),
umapstr(state->show_umap, pkg_ctx));
}
 
@@ -374,7 +357,7 @@ qlist_cb(tree_pkg_ctx *pkg_ctx, void *priv)
 
if (verbose)
printf("%s %sCONTENTS%s:\n",
-   atom_format("%[CATEGORY]%[PF]", atom), DKBLUE,

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

2020-01-19 Thread Fabian Groffen
commit: 16215c71c61da9cb44868d58b4c3ce0529c5d4ac
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sun Jan 19 09:48:50 2020 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sun Jan 19 09:48:50 2020 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=16215c71

qatom: add -l option to match an atom against the tree

returns the latest available version of the atom requested, or nothing
when not found

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

 man/qatom.1 |  5 -
 qatom.c | 33 +++--
 2 files changed, 31 insertions(+), 7 deletions(-)

diff --git a/man/qatom.1 b/man/qatom.1
index 6254912..4f6ccf2 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 2019" "Gentoo Foundation" "qatom"
+.TH qatom "1" "Jan 2020" "Gentoo Foundation" "qatom"
 .SH NAME
 qatom \- split atom strings
 .SH SYNOPSIS
@@ -70,6 +70,9 @@ Compare two atoms.
 \fB\-p\fR, \fB\-\-print\fR
 Print reconstructed atom.
 .TP
+\fB\-l\fR, \fB\-\-lookup\fR
+Lookup atom in tree.
+.TP
 \fB\-\-root\fR \fI\fR
 Set the ROOT env var.
 .TP

diff --git a/qatom.c b/qatom.c
index 23d10d8..59f7392 100644
--- a/qatom.c
+++ b/qatom.c
@@ -8,36 +8,37 @@
  */
 
 #include "main.h"
-
-#include 
-#include 
+#include "applets.h"
 
 #include "atom.h"
-#include "applets.h"
+#include "tree.h"
 
 #define QATOM_FORMAT "%{CATEGORY} %{PN} %{PV} %[PR] %[SLOT] %[pfx] %[sfx]"
 
-#define QATOM_FLAGS "F:cp" COMMON_FLAGS
+#define QATOM_FLAGS "F:cpl" COMMON_FLAGS
 static struct option const qatom_long_opts[] = {
{"format", a_argument, NULL, 'F'},
{"compare",   no_argument, NULL, 'c'},
{"print", no_argument, NULL, 'p'},
+   {"lookup",no_argument, NULL, 'l'},
COMMON_LONG_OPTS
 };
 static const char * const qatom_opts_help[] = {
"Custom output format (default: " QATOM_FORMAT ")",
"Compare two atoms",
"Print reconstructed atom",
+   "Lookup atom in tree",
COMMON_OPTS_HELP
 };
 #define qatom_usage(ret) usage(ret, QATOM_FLAGS, qatom_long_opts, 
qatom_opts_help, NULL, lookup_applet_idx("qatom"))
 
 int qatom_main(int argc, char **argv)
 {
-   enum qatom_atom { _EXPLODE=0, _COMPARE, _PRINT } action = _EXPLODE;
+   enum qatom_atom { _EXPLODE=0, _COMPARE, _PRINT, _LOOKUP } action = 
_EXPLODE;
const char *format = QATOM_FORMAT;
depend_atom *atom;
depend_atom *atomc;
+   tree_ctx *tree = NULL;
int i;
 
while ((i = GETOPT_LONG(QATOM, qatom, "")) != -1) {
@@ -45,6 +46,7 @@ int qatom_main(int argc, char **argv)
case 'F': format = optarg;   break;
case 'c': action = _COMPARE; break;
case 'p': action = _PRINT;   break;
+   case 'l': action = _LOOKUP;  break;
COMMON_GETOPTS_CASES(qatom)
}
}
@@ -55,6 +57,12 @@ int qatom_main(int argc, char **argv)
if (action == _COMPARE && (argc - optind) % 2)
err("compare needs even number of arguments");
 
+   if (action == _LOOKUP) {
+   tree = tree_open(portroot, main_overlay);
+   if (tree == NULL)
+   err("failed to open tree");
+   }
+
for (i = optind; i < argc; i++) {
atom = atom_explode(argv[i]);
if (atom == NULL) {
@@ -101,10 +109,23 @@ int qatom_main(int argc, char **argv)
case _PRINT:
printf("%s\n", atom_to_string(atom));
break;
+   case _LOOKUP:
+   {
+   tree_pkg_ctx *pkg = tree_match_atom(tree, atom);
+   if (pkg != NULL) {
+   atomc = tree_get_atom(pkg, true);
+   if (!quiet)
+   printf("%s: ", 
atom_to_string(atom));
+   printf("%s\n", atom_format(format, 
atomc));
+   }
+   }
}
 
atom_implode(atom);
}
 
+   if (action == _LOOKUP)
+   tree_close(tree);
+
return EXIT_SUCCESS;
 }



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

2020-01-02 Thread Fabian Groffen
commit: e9a92c63076da2b291f088b33ee5e3841ba06988
Author: Fabian Groffen  gentoo  org>
AuthorDate: Thu Jan  2 09:46:46 2020 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Thu Jan  2 09:46:46 2020 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=e9a92c63

man: update qpkg manpage

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

 man/qpkg.1 | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/man/qpkg.1 b/man/qpkg.1
index 8b681d0..7339ca3 100644
--- a/man/qpkg.1
+++ b/man/qpkg.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qpkg "1" "Nov 2019" "Gentoo Foundation" "qpkg"
+.TH qpkg "1" "Jan 2020" "Gentoo Foundation" "qpkg"
 .SH NAME
 qpkg \- create or manipulate Gentoo binpkgs
 .SH SYNOPSIS
@@ -13,10 +13,10 @@ option.
 .SH OPTIONS
 .TP
 \fB\-c\fR, \fB\-\-clean\fR
-clean pkgdir of unused binary files.
+clean pkgdir of files that are not installed.
 .TP
 \fB\-E\fR, \fB\-\-eclean\fR
-clean pkgdir of files not in the tree anymore (slow).
+clean pkgdir of files that are not in the tree anymore.
 .TP
 \fB\-p\fR, \fB\-\-pretend\fR
 pretend only.



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

2020-01-06 Thread Fabian Groffen
commit: 88bd510b4bd83123cd8c1c4920a8e655584ea2db
Author: Fabian Groffen  gentoo  org>
AuthorDate: Mon Jan  6 15:03:07 2020 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Mon Jan  6 15:03:07 2020 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=88bd510b

qgrep: fix description for -N

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

 man/qgrep.1 | 6 +++---
 qgrep.c | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/man/qgrep.1 b/man/qgrep.1
index e414ba4..2d73f4c 100644
--- a/man/qgrep.1
+++ b/man/qgrep.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qgrep "1" "Nov 2019" "Gentoo Foundation" "qgrep"
+.TH qgrep "1" "Jan 2020" "Gentoo Foundation" "qgrep"
 .SH NAME
 qgrep \- grep in ebuilds
 .SH SYNOPSIS
@@ -20,8 +20,8 @@ Select non-matching lines.
 \fB\-i\fR, \fB\-\-ignore\-case\fR
 Ignore case distinctions.
 .TP
-\fB\-N\fR, \fB\-\-with\-name\fR
-Print the filename for each match.
+\fB\-N\fR, \fB\-\-atom\-name\fR
+Print the atom instead of filename for each match.
 .TP
 \fB\-c\fR, \fB\-\-count\fR
 Only print a count of matching lines per FILE.

diff --git a/qgrep.c b/qgrep.c
index 4d8c27f..019b0b6 100644
--- a/qgrep.c
+++ b/qgrep.c
@@ -28,7 +28,7 @@
 static struct option const qgrep_long_opts[] = {
{"invert-match",  no_argument, NULL, 'I'},
{"ignore-case",   no_argument, NULL, 'i'},
-   {"with-name", no_argument, NULL, 'N'},
+   {"atom-name", no_argument, NULL, 'N'},
{"count", no_argument, NULL, 'c'},
{"list",  no_argument, NULL, 'l'},
{"invert-list",   no_argument, NULL, 'L'},
@@ -46,7 +46,7 @@ static struct option const qgrep_long_opts[] = {
 static const char * const qgrep_opts_help[] = {
"Select non-matching lines",
"Ignore case distinctions",
-   "Print the filename for each match",
+   "Print the atom instead of filename for each match",
"Only print a count of matching lines per FILE",
"Only print FILE names containing matches",
"Only print FILE names containing no match",



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

2019-09-28 Thread Fabian Groffen
commit: ea7f00529fa689a6624f6b26b5d3b7197f4fbfd5
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sat Sep 28 13:18:31 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sat Sep 28 13:18:31 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=ea7f0052

qpkg: don't emit hypothetical messages when real work has been done

drop the "would be" part of how many bytes were freed when we're not
pretending

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

 applets.h  | 2 +-
 man/qpkg.1 | 4 ++--
 qpkg.c | 8 +---
 3 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/applets.h b/applets.h
index 520ff23..364f457 100644
--- a/applets.h
+++ b/applets.h
@@ -82,7 +82,7 @@ static const struct applet_t {
{"qmanifest", qmanifest_main, "", "verify or generate 
thick Manifest files"},
 #endif
{"qmerge",qmerge_main,"",  "fetch and merge 
binary package"},
-   {"qpkg",  qpkg_main,  "", "manipulate Gentoo 
binpkgs"},
+   {"qpkg",  qpkg_main,  "", "create or manipulate 
Gentoo binpkgs"},
{"qsearch",   qsearch_main,   "", "search pkgname/desc"},
{"qsize", qsize_main, "",   "calculate size 
usage"},
{"qtbz2", qtbz2_main, "", "manipulate tbz2 
packages"},

diff --git a/man/qpkg.1 b/man/qpkg.1
index c471ea1..161a8bb 100644
--- a/man/qpkg.1
+++ b/man/qpkg.1
@@ -1,7 +1,7 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qpkg "1" "Jul 2019" "Gentoo Foundation" "qpkg"
+.TH qpkg "1" "Sep 2019" "Gentoo Foundation" "qpkg"
 .SH NAME
-qpkg \- manipulate Gentoo binpkgs
+qpkg \- create or manipulate Gentoo binpkgs
 .SH SYNOPSIS
 .B qpkg
 \fI[opts] \fR

diff --git a/qpkg.c b/qpkg.c
index 0ac6e92..947ff84 100644
--- a/qpkg.c
+++ b/qpkg.c
@@ -171,8 +171,9 @@ qpkg_clean(char *dirp)
disp_units = KILOBYTE;
if ((num_all_bytes / KILOBYTE) > 1000)
disp_units = MEGABYTE;
-   qprintf(" %s*%s Total space that would be freed in packages "
-   "directory: %s%s %ciB%s\n", GREEN, NORM, RED,
+   qprintf(" %s*%s Total space %sfreed in packages "
+   "directory: %s%s %ciB%s\n", GREEN, NORM,
+   pretend ? "that would be " : "", RED,
make_human_readable_str(num_all_bytes, 1, disp_units),
disp_units == MEGABYTE ? 'M' : 'K', NORM);
 
@@ -297,10 +298,11 @@ qpkg_make(depend_atom *atom)
xpak_create(AT_FDCWD, tbz2, 1, xpak_argv, 1, verbose);
 
stat(tbz2, &st);
+   xpaksize = st.st_size - xpaksize;
 
/* save tbz2 tail: STOP */
fp = fopen(tbz2, "a");
-   WRITE_BE_INT32(buf, st.st_size - xpaksize);
+   WRITE_BE_INT32(buf, xpaksize);
fwrite(buf, 1, 4, fp);
fwrite("STOP", 1, 4, fp);
fclose(fp);



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

2019-09-29 Thread Fabian Groffen
commit: ab19f86cb43061a7efa42ec2c3058abf69d72851
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sun Sep 29 12:18:00 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sun Sep 29 12:18:00 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=ab19f86c

man: update qfile page for new -P option

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

 man/qfile.1 | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/man/qfile.1 b/man/qfile.1
index 33dfbee..083641e 100644
--- a/man/qfile.1
+++ b/man/qfile.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qfile "1" "Jul 2019" "Gentoo Foundation" "qfile"
+.TH qfile "1" "Sep 2019" "Gentoo Foundation" "qfile"
 .SH NAME
 qfile \- list all pkgs owning files
 .SH SYNOPSIS
@@ -55,6 +55,9 @@ List orphan files.
 \fB\-x\fR \fI\fR, \fB\-\-exclude\fR \fI\fR
 Don't look in package  (used with --orphans).
 .TP
+\fB\-P\fR, \fB\-\-skip\-plibreg\fR
+Don't look in the prunelib registry.
+.TP
 \fB\-\-root\fR \fI\fR
 Set the ROOT env var.
 .TP



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

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

man: regen

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

 man/qatom.1 |  2 +-
 man/qcheck.1|  2 +-
 man/qdepends.1  |  2 +-
 man/qfile.1 |  2 +-
 man/qgrep.1 |  2 +-
 man/qkeyword.1  |  2 +-
 man/qlist.1 | 11 ++-
 man/qlop.1  |  2 +-
 man/qmanifest.1 |  2 +-
 man/qmerge.1|  2 +-
 man/qpkg.1  |  2 +-
 man/qsearch.1   |  2 +-
 man/qsize.1 |  2 +-
 man/qtbz2.1 |  2 +-
 man/qtegrity.1  |  2 +-
 man/quse.1  |  2 +-
 man/qxpak.1 |  2 +-
 17 files changed, 22 insertions(+), 21 deletions(-)

diff --git a/man/qatom.1 b/man/qatom.1
index ab6cfb3..6254912 100644
--- a/man/qatom.1
+++ b/man/qatom.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qatom "1" "Jul 2019" "Gentoo Foundation" "qatom"
+.TH qatom "1" "Nov 2019" "Gentoo Foundation" "qatom"
 .SH NAME
 qatom \- split atom strings
 .SH SYNOPSIS

diff --git a/man/qcheck.1 b/man/qcheck.1
index fce6b42..a48c7f3 100644
--- a/man/qcheck.1
+++ b/man/qcheck.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qcheck "1" "Jul 2019" "Gentoo Foundation" "qcheck"
+.TH qcheck "1" "Nov 2019" "Gentoo Foundation" "qcheck"
 .SH NAME
 qcheck \- verify integrity of installed packages
 .SH SYNOPSIS

diff --git a/man/qdepends.1 b/man/qdepends.1
index 8b0ad69..e8d1648 100644
--- a/man/qdepends.1
+++ b/man/qdepends.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qdepends "1" "Jul 2019" "Gentoo Foundation" "qdepends"
+.TH qdepends "1" "Nov 2019" "Gentoo Foundation" "qdepends"
 .SH NAME
 qdepends \- show dependency info
 .SH SYNOPSIS

diff --git a/man/qfile.1 b/man/qfile.1
index 083641e..7501311 100644
--- a/man/qfile.1
+++ b/man/qfile.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qfile "1" "Sep 2019" "Gentoo Foundation" "qfile"
+.TH qfile "1" "Nov 2019" "Gentoo Foundation" "qfile"
 .SH NAME
 qfile \- list all pkgs owning files
 .SH SYNOPSIS

diff --git a/man/qgrep.1 b/man/qgrep.1
index f3a5c2d..e414ba4 100644
--- a/man/qgrep.1
+++ b/man/qgrep.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qgrep "1" "Jul 2019" "Gentoo Foundation" "qgrep"
+.TH qgrep "1" "Nov 2019" "Gentoo Foundation" "qgrep"
 .SH NAME
 qgrep \- grep in ebuilds
 .SH SYNOPSIS

diff --git a/man/qkeyword.1 b/man/qkeyword.1
index a191d72..c43fa61 100644
--- a/man/qkeyword.1
+++ b/man/qkeyword.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qkeyword "1" "Jul 2019" "Gentoo Foundation" "qkeyword"
+.TH qkeyword "1" "Nov 2019" "Gentoo Foundation" "qkeyword"
 .SH NAME
 qkeyword \- list packages based on keywords
 .SH SYNOPSIS

diff --git a/man/qlist.1 b/man/qlist.1
index 2fd9575..676ee96 100644
--- a/man/qlist.1
+++ b/man/qlist.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qlist "1" "Jul 2019" "Gentoo Foundation" "qlist"
+.TH qlist "1" "Nov 2019" "Gentoo Foundation" "qlist"
 .SH NAME
 qlist \- list files owned by pkgname
 .SH SYNOPSIS
@@ -11,13 +11,17 @@ 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.
 .SH OPTIONS
 .TP
 \fB\-I\fR, \fB\-\-installed\fR
 Instead of listing the contents of a package, just print the package
 name if the package is currently installed.
 .TP
+\fB\-k\fR, \fB\-\-binpkgs\fR
+Operate on binary packages instead of installed packges.
+.TP
 \fB\-S\fR, \fB\-\-slots\fR
 Display installed packages with slots (use twice for subslots).
 .TP
@@ -40,9 +44,6 @@ Show /usr/lib/debug and /usr/src/debug files.
 \fB\-e\fR, \fB\-\-exact\fR
 Exact match (only CAT/PN or PN without PV).
 .TP
-\fB\-a\fR, \fB\-\-all\fR
-Show every installed package.
-.TP
 \fB\-d\fR, \fB\-\-dir\fR
 Only show directories.
 .TP

diff --git a/man/qlop.1 b/man/qlop.1
index 58efd09..1b63edd 100644
--- a/man/qlop.1
+++ b/man/qlop.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qlop "1" "Oct 2019" "Gentoo Foundation" "qlop"
+.TH qlop "1" "Nov 2019" "Gentoo Foundation" "qlop"
 .SH NAME
 qlop \- emerge log analyzer
 .SH SYNOPSIS

diff --git a/man/qmanifest.1 b/man/qmanifest.1
index 5d00bd3..6f6ab04 100644
--- a/man/qmanifest.1
+++ b/man/qmanifest.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qmanifest "1" "Jul 2019" "Gentoo Foundation" "qmanifest"
+.TH qmanifest "1" "Nov 2019" "Gentoo Foundation" "qmanifest"
 .SH NAME
 qmanifest \- verify or generate thick Manifest files
 .SH 

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

2020-11-29 Thread Fabian Groffen
commit: 5fd373fadbdf3f0bc2733f4c6fee4fab71f76e69
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sun Nov 29 09:28:40 2020 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sun Nov 29 09:28:40 2020 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=5fd373fa

man: regenerate after alignment fix

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

 man/q.1 | 36 ++--
 man/qatom.1 |  2 +-
 man/qcheck.1|  2 +-
 man/qdepends.1  |  2 +-
 man/qfile.1 |  2 +-
 man/qgrep.1 |  2 +-
 man/qkeyword.1  |  2 +-
 man/qlist.1 |  2 +-
 man/qlop.1  | 15 +--
 man/qmanifest.1 |  2 +-
 man/qmerge.1|  2 +-
 man/qpkg.1  |  2 +-
 man/qsearch.1   |  2 +-
 man/qsize.1 |  2 +-
 man/qtbz2.1 |  2 +-
 man/qtegrity.1  |  2 +-
 man/quse.1  |  2 +-
 man/qxpak.1 |  2 +-
 18 files changed, 47 insertions(+), 36 deletions(-)

diff --git a/man/q.1 b/man/q.1
index 21a09b3..d98c3c3 100644
--- a/man/q.1
+++ b/man/q.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH q "1" "Dec 2019" "Gentoo Foundation" "q"
+.TH q "1" "Nov 2020" "Gentoo Foundation" "q"
 .SH NAME
 q \- invoke a portage utility applet
 .SH SYNOPSIS
@@ -58,24 +58,24 @@ Print version and exit.
 .SH APPLETS
 .nf
 .B This applet also has sub applets:
-q   : virtual applet
-qatom: split atom strings
-   qcheck: verify integrity of installed packages
- qdepends: show dependency info
-qfile   : list all pkgs owning files
-qgrep  [pkg ...]: grep in ebuilds
- qkeyword   : list packages based on keywords
-qlist: list files owned by pkgname
- qlop: emerge log analyzer
+ q   : virtual applet
+ qatom: split atom strings
+qcheck: verify integrity of installed packages
+  qdepends: show dependency info
+ qfile   : list all pkgs owning files
+ qgrep  [pkg ...]: grep in ebuilds
+  qkeyword   : list packages based on keywords
+ qlist: list files owned by pkgname
+  qlop: emerge log analyzer
  qmanifest  : verify or generate thick Manifest files
-   qmerge   : fetch and merge binary package
- qpkg  : create or manipulate Gentoo binpkgs
-  qsearch  : search pkgname/desc
-qsize: calculate size usage
-qtbz2  : manipulate tbz2 packages
- qtegrity  : verify files with IMA
- quse: find pkgs using useflags
-qxpak  : manipulate xpak archives
+qmerge   : fetch and merge binary package
+  qpkg  : create or manipulate Gentoo binpkgs
+   qsearch  : search pkgname/desc
+ qsize: calculate size usage
+ qtbz2  : manipulate tbz2 packages
+  qtegrity  : verify files with IMA
+  quse: find pkgs using useflags
+ qxpak  : manipulate xpak archives
 .fi
 .SH "REPORTING BUGS"
 Please report bugs via http://bugs.gentoo.org/

diff --git a/man/qatom.1 b/man/qatom.1
index 9ebb9a0..d8c7cd6 100644
--- a/man/qatom.1
+++ b/man/qatom.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qatom "1" "May 2020" "Gentoo Foundation" "qatom"
+.TH qatom "1" "Nov 2020" "Gentoo Foundation" "qatom"
 .SH NAME
 qatom \- split atom strings
 .SH SYNOPSIS

diff --git a/man/qcheck.1 b/man/qcheck.1
index a48c7f3..2473513 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 2019" "Gentoo Foundation" "qcheck"
+.TH qcheck "1" "Nov 2020" "Gentoo Foundation" "qcheck"
 .SH NAME
 qcheck \- verify integrity of installed packages
 .SH SYNOPSIS

diff --git a/man/qdepends.1 b/man/qdepends.1
index e8d1648..0eb7ba3 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 2019" "Gentoo Foundation" "qdepends"
+.TH qdepends "1" "Nov 2020" "Gentoo Foundation" "qdepends"
 .SH NAME
 qdepends \- show dependency info
 .SH SYNOPSIS

diff --git a/man/qfile.1 b/man/qfile.1
index 7caa459..ffe0968 100644
--- a/man/qfile.1
+++ b/man/qfile.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qfile "1" "May 2020" "Gentoo Foundation" "qfile"
+.TH qfile "1" "Nov 2020" "Gentoo Foundation" "qfile"
 .SH NAME
 qfile \- list all pkgs owning files
 .SH SYNOPSIS

diff --git a/man/qgrep.1 b/man/qgrep.1
index 2d73f4c..70d7eba 100644
--- a/man/qgrep.1
+++ b/man/qgrep.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qgrep "1" "Jan 2020" "Gentoo Foundation" "qgrep"
+.TH qgrep "1" "Nov 2020" "Gentoo Foundation" "qgrep"
 .SH NAME
 qgrep \- grep in ebuilds
 .SH SYNOPSIS

diff --git a/man/qkeyword.1 b/man/qkeyword.1
index 5a26218..d18bea6 100644
--- a/man/qkeyword.1
+++ b/man/qkeyword.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qkeyword "1" "Dec 2019" "Gentoo Foundation" "qkeyword"
+.TH qkeyword "1" "Nov 2020" "Gentoo Foundat

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

2019-10-27 Thread Fabian Groffen
commit: c9d7b9de78f1488827cb516bf61a54df28a750ab
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sun Oct 27 12:19:06 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sun Oct 27 12:19:06 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=c9d7b9de

qlop: take two at implementing currently running merges

Probe /proc filesystem for running merges, and use the atoms found there
to select the packages to list.  In addition, prune any operations that
started > 10 days ago so there will be some sort of convergence.

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

 main.c |   3 +-
 man/qlop.1 |   4 +-
 qlop.c | 175 ++---
 3 files changed, 173 insertions(+), 9 deletions(-)

diff --git a/main.c b/main.c
index 5d4c4cd..0b827fc 100644
--- a/main.c
+++ b/main.c
@@ -501,7 +501,8 @@ read_portage_env_file(const char *configroot, const char 
*file, env_vars vars[])
source_len = strlen(sfile);
 
if (buflen <= source_len + file_path_len)
-   buf = xrealloc(buf, buflen = source_len 
+ file_path_len + 1);
+   buf = xrealloc(buf,
+   buflen = source_len + 
file_path_len + 1);
memmove(buf + file_path_len, buf + 7, 
source_len + 1);
memcpy(buf, file, file_path_len);
sfile = buf;

diff --git a/man/qlop.1 b/man/qlop.1
index de1e525..58efd09 100644
--- a/man/qlop.1
+++ b/man/qlop.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qlop "1" "Sep 2019" "Gentoo Foundation" "qlop"
+.TH qlop "1" "Oct 2019" "Gentoo Foundation" "qlop"
 .SH NAME
 qlop \- emerge log analyzer
 .SH SYNOPSIS
@@ -51,7 +51,7 @@ Print elapssed time in human readable format.  This form uses
 minutes, hours and days instead of just seconds.
 .TP
 \fB\-M\fR, \fB\-\-machine\fR
-Print elapsed time as seconds with no formatting.
+Print start/elapsed time as seconds with no formatting.
 .TP
 \fB\-m\fR, \fB\-\-merge\fR
 Show merge history.

diff --git a/qlop.c b/qlop.c
index 7a93656..6cb2c04 100644
--- a/qlop.c
+++ b/qlop.c
@@ -16,9 +16,11 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "atom.h"
 #include "eat_file.h"
+#include "scandirat.h"
 #include "set.h"
 #include "xarray.h"
 #include "xasprintf.h"
@@ -51,7 +53,7 @@ static const char * const qlop_opts_help[] = {
"Print time taken to complete action",
"Print average time taken to complete action",
"Print elapsed time in human readable format (use with -t or -a)",
-   "Print elapsed time as seconds with no formatting",
+   "Print start/elapsed time as seconds with no formatting",
"Show merge history",
"Show unmerge history",
"Show autoclean unmerge history",
@@ -201,10 +203,15 @@ parse_date(const char *sdate, time_t *t)
 static char _date_buf[48];
 static char *fmt_date(struct qlop_mode *flags, time_t ts, time_t te)
 {
-   time_t t;
+   time_t t = flags->do_endtime ? te : ts;
+
+   if (flags->do_machine)
+   snprintf(_date_buf, sizeof(_date_buf),
+   "%zd", (size_t)t);
+   else
+   strftime(_date_buf, sizeof(_date_buf),
+   "%Y-%m-%dT%H:%M:%S", localtime(&t));
 
-   t = flags->do_endtime ? te : ts;
-   strftime(_date_buf, sizeof(_date_buf), "%Y-%m-%dT%H:%M:%S", 
localtime(&t));
return _date_buf;
 }
 
@@ -336,6 +343,21 @@ New format:
 1550953125:  >>> unmerge success: app-admin/pwgen-2.08
 1550953125:  *** exiting successfully.
 1550953125:  *** terminating.
+
+
+Currently running merges can be found in the /proc filesystem:
+- Linux: readlink(/proc//fd/X)
+- Solaris: readlink(/proc//path/X)
+from here a file should be there that points to the build.log file
+$CAT/$P/work/build.log.  If so, it's running for $CAT/$P.
+This requires being the portage user though, or root.
+
+Should there be no /proc, we can deduce from the log whether a package
+is being emerged, if and only if, there are no parallel merges, and
+portage never got interrupted in a way where it could not write its
+interruption to the log.  Unfortunately these scenarios happen a lot.
+As such, we can try to remedy this somewhat by using a rule of thumb
+that currently merging packages need to be withinin the last 10 days.
 */
 static int do_emerge_log(
const char *log,
@@ -463,6 +485,7 @@ static int do_emerge_log(
tbegin = last_merge;
tend = tstart;
}
+
/* loop over lines searching for atoms */
while (fgets(buf, sizeof(buf), fp) != NULL) {
if ((p = strchr(buf, ':')) == NULL)
@@ -821,11 +844,19 @@ static int do_emerge_log(
}
fclose(f

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

2020-05-02 Thread Fabian Groffen
commit: 20844dc943700cca72bbb6896f42adcd30de41e3
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sat May  2 08:13:29 2020 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sat May  2 08:45:40 2020 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=20844dc9

qlop: silently drop -l when -d is used with -E

While -E defaults to -l (last merge), silently drop it when -d is used.

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

 man/qlop.1 | 4 ++--
 qlop.c | 5 +++--
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/man/qlop.1 b/man/qlop.1
index 1b63edd..7027f14 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 2019" "Gentoo Foundation" "qlop"
+.TH qlop "1" "May 2020" "Gentoo Foundation" "qlop"
 .SH NAME
 qlop \- emerge log analyzer
 .SH SYNOPSIS
@@ -66,7 +66,7 @@ Show autoclean unmerge history.
 Show sync history.
 .TP
 \fB\-E\fR, \fB\-\-emerge\fR
-Show last merge like how emerge(1) -v would show it.
+Show last merge similar to how emerge(1) -v would show it.
 .TP
 \fB\-e\fR, \fB\-\-endtime\fR
 Report time at which the operation finished (iso started).

diff --git a/qlop.c b/qlop.c
index cbe3b58..3e38adf 100644
--- a/qlop.c
+++ b/qlop.c
@@ -58,7 +58,7 @@ static const char * const qlop_opts_help[] = {
"Show unmerge history",
"Show autoclean unmerge history",
"Show sync history",
-   "Show last merge like how emerge(1) -v would show it",
+   "Show last merge similar to how emerge(1) -v would show it",
"Report time at which the operation finished (iso started)",
"Show current emerging packages",
"Limit selection to this time (1st -d is start, 2nd -d is end)",
@@ -1367,7 +1367,8 @@ int qlop_main(int argc, char **argv)
 
/* handle -l / -d conflict */
if (start_time != 0 && m.show_lastmerge) {
-   warn("-l and -d cannot be used together, dropping -l");
+   if (m.show_emerge)
+   warn("-l and -d cannot be used together, dropping -l");
m.show_lastmerge = 0;
}
 



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

2019-11-24 Thread Fabian Groffen
commit: abbfff8553d8e99d71d71054e81a7f21d6479221
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sun Nov 24 12:26:47 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sun Nov 24 12:26:47 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=abbfff85

main: overhaul profile/config reading somewhat

- track where values come from, expose using -v (with q -[oe])
- follow repo-prefixed profiles in parent files (non-PMS feature?)
- read usr/share/portage/config/repos.conf for repo defaults

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

 applets.h |   1 +
 main.c| 397 --
 main.h|   1 +
 man/q.1   |   6 +-
 q.c   |  20 +++-
 5 files changed, 254 insertions(+), 171 deletions(-)

diff --git a/applets.h b/applets.h
index 364f457..e7b81f4 100644
--- a/applets.h
+++ b/applets.h
@@ -168,6 +168,7 @@ extern char *features;
 extern char *install_mask;
 extern DEFINE_ARRAY(overlays);
 extern DEFINE_ARRAY(overlay_names);
+extern DEFINE_ARRAY(overlay_src);
 extern char *main_overlay;
 extern int twidth;
 

diff --git a/main.c b/main.c
index e236934..081d72a 100644
--- a/main.c
+++ b/main.c
@@ -44,6 +44,7 @@ char *features;
 char *install_mask;
 DECLARE_ARRAY(overlays);
 DECLARE_ARRAY(overlay_names);
+DECLARE_ARRAY(overlay_src);
 
 static char *portarch;
 static char *portedb;
@@ -248,96 +249,6 @@ makeargv(const char *string, int *argc, char ***argv)
free(q);
 }
 
-/* Handle a single file in the repos.conf format. */
-static void
-read_one_repos_conf(const char *repos_conf)
-{
-   int nsec;
-   char *conf;
-   const char *main_repo, *repo, *path;
-   dictionary *dict;
-
-   if (getenv("DEBUG"))
-   fprintf(stderr, "  parse %s\n", repos_conf);
-
-   dict = iniparser_load(repos_conf);
-
-   main_repo = iniparser_getstring(dict, "DEFAULT:main-repo", NULL);
-
-   nsec = iniparser_getnsec(dict);
-   while (nsec-- > 0) {
-   repo = iniparser_getsecname(dict, nsec);
-   if (!strcmp(repo, "DEFAULT"))
-   continue;
-
-   xasprintf(&conf, "%s:location", repo);
-   path = iniparser_getstring(dict, conf, NULL);
-   if (path) {
-   void *ele = xarraypush_str(overlays, path);
-   xarraypush_str(overlay_names, repo);
-   if (main_repo && !strcmp(repo, main_repo))
-   main_overlay = ele;
-   }
-   free(conf);
-   }
-
-   iniparser_freedict(dict);
-}
-
-/* Handle a possible directory of files. */
-static void
-read_repos_conf(const char *configroot, const char *repos_conf)
-{
-   char *top_conf, *sub_conf;
-   int i, count;
-   struct dirent **confs;
-
-   xasprintf(&top_conf, "%s%s", configroot, repos_conf);
-   if (getenv("DEBUG"))
-   fprintf(stderr, "repos.conf.d scanner %s\n", top_conf);
-   count = scandir(top_conf, &confs, NULL, alphasort);
-   if (count == -1) {
-   if (errno == ENOTDIR)
-   read_one_repos_conf(top_conf);
-   } else {
-   for (i = 0; i < count; ++i) {
-   const char *name = confs[i]->d_name;
-
-   if (name[0] == '.' || name[0] == '\0')
-   continue;
-
-   /* Exclude backup files (aka files with ~ as postfix). 
*/
-   if (name[strlen(name) - 1] == '~')
-   continue;
-
-#ifdef DT_UNKNOWN
-   if (confs[i]->d_type != DT_UNKNOWN &&
-   confs[i]->d_type != DT_REG &&
-   confs[i]->d_type != DT_LNK)
-   continue;
-#endif
-
-   xasprintf(&sub_conf, "%s/%s", top_conf, name);
-
-#ifdef DT_UNKNOWN
-   if (confs[i]->d_type != DT_REG)
-#endif
-   {
-   struct stat st;
-   if (stat(sub_conf, &st) || 
!S_ISREG(st.st_mode)) {
-   free(sub_conf);
-   continue;
-   }
-   }
-
-   read_one_repos_conf(sub_conf);
-   free(sub_conf);
-   }
-   scandir_free(confs, count);
-   }
-   free(top_conf);
-}
-
 static void
 strincr_var(const char *name, const char *s, char **value, size_t *value_len)
 {
@@ -406,19 +317,33 @@ get_portage_env_var(env_vars *vars, const char *name)
 }
 
 static void
-set_portage_env_var(env_vars *var, const char *value)
+set_portage_env_var(env_vars *var, const char *value, const char *src)
 {
switch (var->type) {
case _Q_BOOL:
*var->value.b = 1;
+   free(var->src);
+   var->src 

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

2022-05-26 Thread Fabian Groffen
commit: d301ed27e28417f185c374a044cfabeb32beb607
Author: Fabian Groffen  gentoo  org>
AuthorDate: Thu May 26 14:32:32 2022 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Thu May 26 14:32:32 2022 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=d301ed27

qdepends: add --resolve flag to lookup depstrings

This doesn't respect keywords or masks, but with installed packages
shows which packages currently match the deps as expressed

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

 man/qdepends.1 | 11 ++-
 qdepends.c | 51 +++
 2 files changed, 45 insertions(+), 17 deletions(-)

diff --git a/man/qdepends.1 b/man/qdepends.1
index 0690f16..5e5b00a 100644
--- a/man/qdepends.1
+++ b/man/qdepends.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qdepends "1" "Feb 2021" "Gentoo Foundation" "qdepends"
+.TH qdepends "1" "May 2022" "Gentoo Foundation" "qdepends"
 .SH NAME
 qdepends \- show dependency info
 .SH SYNOPSIS
@@ -68,6 +68,9 @@ Search installed packages using VDB.
 \fB\-t\fR, \fB\-\-tree\fR
 Search available ebuilds in the tree.
 .TP
+\fB\-U\fR, \fB\-\-use\fR
+Apply profile USE-flags to conditional deps.
+.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
@@ -82,6 +85,9 @@ e.g.\ the DEPEND= part is skipped.
 \fB\-S\fR, \fB\-\-pretty\fR
 Pretty format specified depend strings.
 .TP
+\fB\-R\fR, \fB\-\-resolve\fR
+Resolve found dependencies to package versions.
+.TP
 \fB\-\-root\fR \fI\fR
 Set the ROOT env var.
 .TP
@@ -97,6 +103,9 @@ Suppress DEPEND= output for \fB\-f\fR.  Only print the 
matching atom for \fB\-Q\
 \fB\-C\fR, \fB\-\-nocolor\fR
 Don't output color.
 .TP
+\fB\-\-color\fR
+Force color in output.
+.TP
 \fB\-h\fR, \fB\-\-help\fR
 Print this help and exit.
 .TP

diff --git a/qdepends.c b/qdepends.c
index f1bc3ad..bd7c379 100644
--- a/qdepends.c
+++ b/qdepends.c
@@ -22,7 +22,7 @@
 #include "xasprintf.h"
 #include "xregex.h"
 
-#define QDEPENDS_FLAGS "drpbQitUF:S" COMMON_FLAGS
+#define QDEPENDS_FLAGS "drpbQitUF:SR" COMMON_FLAGS
 static struct option const qdepends_long_opts[] = {
{"depend",no_argument, NULL, 'd'},
{"rdepend",   no_argument, NULL, 'r'},
@@ -34,6 +34,7 @@ static struct option const qdepends_long_opts[] = {
{"use",   no_argument, NULL, 'U'},
{"format", a_argument, NULL, 'F'},
{"pretty",no_argument, NULL, 'S'},
+   {"resolve",   no_argument, NULL, 'R'},
COMMON_LONG_OPTS
 };
 static const char * const qdepends_opts_help[] = {
@@ -47,20 +48,23 @@ static const char * const qdepends_opts_help[] = {
"Apply profile USE-flags to conditional deps",
"Print matched atom using given format string",
"Pretty format specified depend strings",
+   "Resolve found dependencies to package versions",
COMMON_OPTS_HELP
 };
 #define qdepends_usage(ret) usage(ret, QDEPENDS_FLAGS, qdepends_long_opts, 
qdepends_opts_help, NULL, lookup_applet_idx("qdepends"))
 
 /* structures / types / etc ... */
 struct qdepends_opt_state {
-   unsigned int qmode;
-   array_t *atoms;
-   array_t *deps;
-   set *udeps;
-   char *depend;
-   size_t depend_len;
-   const char *format;
-   tree_ctx *vdb;
+   unsigned int  qmode;
+   array_t  *atoms;
+   array_t  *deps;
+   set  *udeps;
+   char *depend;
+   size_tdepend_len;
+   const char   *format;
+   char  resolve:1;
+   tree_ctx *vdb;
+   tree_ctx *rtree;
 };
 
 #define QMODE_DEPEND (1<<0)
@@ -174,6 +178,10 @@ qdepends_results_cb(tree_pkg_ctx *pkg_ctx, void *priv)
continue;
}
 
+   /* try and resolve expressions to real package atoms */
+   if (state->resolve)
+   dep_resolve_tree(dep_tree, state->rtree);
+
if (state->qmode & QMODE_TREE &&
!(state->qmode & QMODE_REVERSE) &&
verbose)
@@ -301,12 +309,14 @@ int qdepends_main(int argc, char **argv)
DECLARE_ARRAY(atoms);
DECLARE_ARRAY(deps);
struct qdepends_opt_state state = {
-   .atoms = atoms,
-   .deps = deps,
-   .udeps = create_set(),
-   .qmode = 0,
-   .format = "%[CATEGORY]%[PF]",
-   .vdb = NULL,
+   .atoms   = atoms,
+   .deps= deps,
+   .udeps   = create_set(),
+   .qmode   = 0,
+   .format  = "%[CATEGORY]%[PF]",
+   .resolve = false,
+   .vdb = NULL,
+   .rtree   = NULL,
};
size_t i;
int ret;
@@ -328,6 +338,7 @@ int qdepends_main(int argc, char **argv)
case 't': state.qmode

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

2016-03-27 Thread Mike Frysinger
commit: f27b1c430a13ed45dba638f2390e6a22f7199f8f
Author: Mike Frysinger  gentoo  org>
AuthorDate: Sun Mar 27 16:42:58 2016 +
Commit: Mike Frysinger  gentoo  org>
CommitDate: Sun Mar 27 16:42:58 2016 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=f27b1c43

usage: handle optional args, and auto-align display

Since --help is not performance sensitive, add a bit of logic to auto
align the width of the help columns.

 main.c   | 24 
 man/mkman.py |  4 ++--
 2 files changed, 22 insertions(+), 6 deletions(-)

diff --git a/main.c b/main.c
index d366bef..e9bacda 100644
--- a/main.c
+++ b/main.c
@@ -117,7 +117,11 @@ void no_colors(void)
 static void usage(int status, const char *flags, struct option const opts[],
   const char * const help[], int blabber)
 {
-   unsigned long i;
+   const char opt_arg[] = "[arg]";
+   const char a_arg[] = "";
+   size_t a_arg_len = strlen(a_arg) + 1;
+   size_t i, optlen;
+
if (status != EXIT_SUCCESS)
dup2(STDERR_FILENO, STDOUT_FILENO);
if (blabber == 0) {
@@ -140,6 +144,15 @@ static void usage(int status, const char *flags, struct 
option const opts[],
if (module_name != NULL)
printf("%sLoaded module:%s\n%s%8s%s %s%s\n", GREEN, NORM, 
YELLOW, module_name, NORM, DKBLUE, NORM);
 
+   /* Prescan the --long opt length to auto-align. */
+   optlen = 0;
+   for (i = 0; opts[i].name; ++i) {
+   size_t l = strlen(opts[i].name);
+   if (opts[i].has_arg != no_argument)
+   l += a_arg_len;
+   optlen = MAX(l, optlen);
+   }
+
printf("\n%sOptions:%s -[%s]\n", GREEN, NORM, flags);
for (i = 0; opts[i].name; ++i) {
/* this assert is a life saver when adding new applets. */
@@ -153,11 +166,14 @@ static void usage(int status, const char *flags, struct 
option const opts[],
 
/* then the long flag + help text */
if (opts[i].has_arg == no_argument)
-   printf("--%-15s%s*%s %s\n", opts[i].name,
+   printf("--%-*s %s*%s %s\n", (int)optlen, opts[i].name,
RED, NORM, _(help[i]));
else
-   printf("--%-8s %s%s %s*%s %s\n", opts[i].name,
-   DKBLUE, NORM, RED, NORM, _(help[i]));
+   printf("--%s %s%s%s%*s %s*%s %s\n",
+   opts[i].name,
+   DKBLUE, (opts[i].has_arg == a_argument ? a_arg 
: opt_arg), NORM,
+   (int)(optlen - strlen(opts[i].name) - 
a_arg_len), "",
+   RED, NORM, _(help[i]));
}
exit(status);
 }

diff --git a/man/mkman.py b/man/mkman.py
index 1ec8584..0751b92 100755
--- a/man/mkman.py
+++ b/man/mkman.py
@@ -89,8 +89,8 @@ def MkMan(applets, applet, output):
 flags += [option[0].rstrip(',')]
 option.pop(0)
 
-if option[0] == '':
-flags = [r'\fB%s\fR \fI\fR' % x for x in flags]
+if option[0] in ('', '[arg]'):
+flags = [r'\fB%s\fR \fI%s\fR' % (x, option[0]) for x in flags]
 option.pop(0)
 else:
 flags = [r'\fB%s\fR' % x for x in flags]



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

2016-03-27 Thread Mike Frysinger
commit: d81fc0710ae12ce026053163370ab3dac5c1b1a5
Author: Mike Frysinger  gentoo  org>
AuthorDate: Mon Mar 28 03:53:50 2016 +
Commit: Mike Frysinger  gentoo  org>
CommitDate: Mon Mar 28 03:53:50 2016 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=d81fc071

usage: add an extended text section

Many applets now are so complicated that a single line of text isn't
sufficient to describe all of its capabilities/nuances.  Allow them
to pass in an arbitrary string of data to contain examples.

 main.c | 13 -
 man/qatom.1|  4 ++--
 man/qcache.1   |  4 ++--
 man/qcheck.1   |  4 ++--
 man/qdepends.1 |  4 ++--
 man/qfile.1|  4 ++--
 man/qgrep.1|  4 ++--
 man/qlist.1|  4 ++--
 man/qlop.1 |  2 +-
 man/qmerge.1   |  4 ++--
 man/qpkg.1 |  4 ++--
 man/qsearch.1  |  4 ++--
 man/qsize.1|  4 ++--
 man/qtbz2.1|  4 ++--
 man/quse.1 |  4 ++--
 man/qxpak.1|  4 ++--
 q.c|  2 +-
 qatom.c|  2 +-
 qcache.c   |  2 +-
 qcheck.c   |  2 +-
 qdepends.c |  2 +-
 qfile.c|  2 +-
 qglsa.c|  2 +-
 qgrep.c|  2 +-
 qlist.c|  2 +-
 qlop.c |  9 -
 qmerge.c   |  2 +-
 qpkg.c |  2 +-
 qsearch.c  |  2 +-
 qsize.c|  2 +-
 qtbz2.c|  2 +-
 quse.c |  2 +-
 qxpak.c|  2 +-
 template.c |  2 +-
 34 files changed, 62 insertions(+), 52 deletions(-)

diff --git a/main.c b/main.c
index 0834756..a50b451 100644
--- a/main.c
+++ b/main.c
@@ -115,7 +115,7 @@ void no_colors(void)
 
 /* display usage and exit */
 static void usage(int status, const char *flags, struct option const opts[],
-  const char * const help[], int blabber)
+  const char * const help[], const char *desc, int blabber)
 {
const char opt_arg[] = "[arg]";
const char a_arg[] = "";
@@ -136,10 +136,13 @@ static void usage(int status, const char *flags, struct 
option const opts[],
DKBLUE, applets[i].opts, NORM,
RED, NORM, _(applets[i].desc));
} else if (blabber > 0) {
-   printf("%sUsage:%s %s%s%s  %s%s%s %s:%s %s\n", 
GREEN, NORM,
-   YELLOW, applets[blabber].name, NORM,
-   DKBLUE, applets[blabber].opts, NORM,
-   RED, NORM, _(applets[blabber].desc));
+   printf("%sUsage:%s %s%s%s [opts] %s%s%s %s:%s %s\n",
+   GREEN, NORM,
+   YELLOW, applets[blabber].name, NORM,
+   DKBLUE, applets[blabber].opts, NORM,
+   RED, NORM, _(applets[blabber].desc));
+   if (desc)
+   printf("\n%s\n", desc);
}
if (module_name != NULL)
printf("%sLoaded module:%s\n%s%8s%s %s%s\n", GREEN, NORM, 
YELLOW, module_name, NORM, DKBLUE, NORM);

diff --git a/man/qatom.1 b/man/qatom.1
index 42991a5..4a30343 100644
--- a/man/qatom.1
+++ b/man/qatom.1
@@ -1,9 +1,9 @@
-.TH qatom "1" "Feb 2016" "Gentoo Foundation" "qatom"
+.TH qatom "1" "Mar 2016" "Gentoo Foundation" "qatom"
 .SH NAME
 qatom \- split atom strings
 .SH SYNOPSIS
 .B qatom
-\fI \fR
+\fI[opts] \fR
 .SH DESCRIPTION
 
 .SH OPTIONS

diff --git a/man/qcache.1 b/man/qcache.1
index 1f46e4b..81ae2fa 100644
--- a/man/qcache.1
+++ b/man/qcache.1
@@ -1,9 +1,9 @@
-.TH qcache "1" "Mar 2014" "Gentoo Foundation" "qcache"
+.TH qcache "1" "Mar 2016" "Gentoo Foundation" "qcache"
 .SH NAME
 qcache \- search the metadata cache
 .SH SYNOPSIS
 .B qcache
-\fI  \fR
+\fI[opts]  \fR
 .SH DESCRIPTION
 
 .SH OPTIONS

diff --git a/man/qcheck.1 b/man/qcheck.1
index b686662..ed90c86 100644
--- a/man/qcheck.1
+++ b/man/qcheck.1
@@ -1,9 +1,9 @@
-.TH qcheck "1" "Feb 2016" "Gentoo Foundation" "qcheck"
+.TH qcheck "1" "Mar 2016" "Gentoo Foundation" "qcheck"
 .SH NAME
 qcheck \- verify integrity of installed packages
 .SH SYNOPSIS
 .B qcheck
-\fI \fR
+\fI[opts] \fR
 .SH DESCRIPTION
 
 .SH OPTIONS

diff --git a/man/qdepends.1 b/man/qdepends.1
index 3b316a0..a0cac5b 100644
--- a/man/qdepends.1
+++ b/man/qdepends.1
@@ -1,9 +1,9 @@
-.TH qdepends "1" "Mar 2014" "Gentoo Foundation" "qdepends"
+.TH qdepends "1" "Mar 2016" "Gentoo Foundation" "qdepends"
 .SH NAME
 qdepends \- show dependency info
 .SH SYNOPSIS
 .B qdepends
-\fI \fR
+\fI[opts] \fR
 .SH DESCRIPTION
 The qdepends applet has a couple different modes.  Normally it is geared 
towards
 answering the queries "what does package X depend on" and "what packages depend

diff --git a/man/qfile.1 b/man/qfile.1
index 54823cd..e57e8e3 100644
--- a/man/qfile.1
+++ b/man/qfile.1
@@ -1,9 +1,9 @@
-.TH qfile "1" "Feb 2016" "Gentoo Foundation" "qfile"
+.TH qfile "1" "Mar 2016" "Gentoo Foundation" "qfile"
 .SH NAME
 qfile \- list all pkgs owning files
 .SH SYNOPSIS
 .B qfile
-\fI \fR
+\fI[opts] \fR
 .SH DESCRIPTION
 
 .SH OPTIONS

diff --git a/man/qg

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

2016-06-19 Thread Mike Frysinger
commit: 3040132ef330e83c1a04f05eda333c79ae4868a8
Author: Mike Frysinger  gentoo  org>
AuthorDate: Mon Jun 20 03:10:38 2016 +
Commit: Mike Frysinger  gentoo  org>
CommitDate: Mon Jun 20 03:10:38 2016 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=3040132e

man: drop qfile --from docs (part 2)

Have to regen the man page after updating its fragment.

 man/qfile.1 | 63 +
 1 file changed, 1 insertion(+), 62 deletions(-)

diff --git a/man/qfile.1 b/man/qfile.1
index e57e8e3..5bd58c7 100644
--- a/man/qfile.1
+++ b/man/qfile.1
@@ -1,4 +1,4 @@
-.TH qfile "1" "Mar 2016" "Gentoo Foundation" "qfile"
+.TH qfile "1" "Jun 2016" "Gentoo Foundation" "qfile"
 .SH NAME
 qfile \- list all pkgs owning files
 .SH SYNOPSIS
@@ -148,67 +148,6 @@ Sure, the same differences hold when querying for orphan 
files:
$ ROOT=/mnt qfile -Ro /mnt/bin/*
/mnt/bin/dostuff.sh
 .fi
-.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
 .SH "SEARCHING FOR FILE COLLISIONS"
 .PP
 A last option of \fBqfile\fP is \fB\-\-exclude\fP (\fB\-x\fP), which will makes



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

2016-02-04 Thread Mike Frysinger
commit: d63a4b1b586b4a1f5f6d841af582bb7fd1bcecff
Author: Mike Frysinger  gentoo  org>
AuthorDate: Thu Feb  4 17:56:41 2016 +
Commit: Mike Frysinger  gentoo  org>
CommitDate: Thu Feb  4 17:56:41 2016 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=d63a4b1b

man: get mkman.py working under py2 & py3

 man/mkman.py | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/man/mkman.py b/man/mkman.py
index cd0fa7a..1ec8584 100755
--- a/man/mkman.py
+++ b/man/mkman.py
@@ -1,4 +1,5 @@
 #!/usr/bin/python
+# -*- coding: utf-8 -*-
 
 """Generate man pages for the q applets"""
 
@@ -25,7 +26,7 @@ Q = os.path.join(TOPDIR, 'q')
 def FindApplets():
 """Return a list of all supported applets"""
 applets = os.path.join(TOPDIR, 'applets.sh')
-return subprocess.check_output([applets]).splitlines()
+return subprocess.check_output([applets]).decode('ascii').splitlines()
 
 
 COMMON_AUTHORS = [
@@ -61,7 +62,7 @@ def MkMan(applets, applet, output):
 
 # Extract the main use string and description:
 # Usage: q: invoke a portage utility applet
-ahelp = subprocess.check_output([Q, applet, '--help'])
+ahelp = subprocess.check_output([Q, applet, '--help']).decode('ascii')
 lines = ahelp.splitlines()
 m = re.search(r'^Usage: %s (.*) : (.*)' % applet, ahelp)
 usage = m.group(1)
@@ -77,7 +78,7 @@ def MkMan(applets, applet, output):
 
 # Extract all the options
 options = []
-for line, i in zip(lines, xrange(len(lines))):
+for line, i in zip(lines, range(len(lines))):
 if not line.startswith('Options: '):
 continue
 



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

2016-02-22 Thread Mike Frysinger
commit: dcec34fcf04c0399efc466adf770d60dc145129f
Author: Mike Frysinger  gentoo  org>
AuthorDate: Mon Feb 22 17:49:25 2016 +
Commit: Mike Frysinger  gentoo  org>
CommitDate: Mon Feb 22 17:49:25 2016 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=dcec34fc

qsize: change interface to operate on atoms

We also drop the --all flag as it's now the default behavior.
If no atoms are specified, we just check everything.

 man/qsize.1 |  5 +
 qsize.c | 49 -
 2 files changed, 33 insertions(+), 21 deletions(-)

diff --git a/man/qsize.1 b/man/qsize.1
index ca6a352..af32869 100644
--- a/man/qsize.1
+++ b/man/qsize.1
@@ -1,4 +1,4 @@
-.TH qsize "1" "Mar 2014" "Gentoo Foundation" "qsize"
+.TH qsize "1" "Feb 2016" "Gentoo Foundation" "qsize"
 .SH NAME
 qsize \- calculate size usage
 .SH SYNOPSIS
@@ -11,9 +11,6 @@ qsize \- calculate size usage
 \fB\-f\fR, \fB\-\-filesystem\fR
 Show size used on disk
 .TP
-\fB\-a\fR, \fB\-\-all\fR
-Size all installed packages
-.TP
 \fB\-s\fR, \fB\-\-sum\fR
 Include a summary
 .TP

diff --git a/qsize.c b/qsize.c
index 3a11842..7a40141 100644
--- a/qsize.c
+++ b/qsize.c
@@ -8,10 +8,9 @@
 
 #ifdef APPLET_qsize
 
-#define QSIZE_FLAGS "fasSmkbi:" COMMON_FLAGS
+#define QSIZE_FLAGS "fsSmkbi:" COMMON_FLAGS
 static struct option const qsize_long_opts[] = {
{"filesystem", no_argument, NULL, 'f'},
-   {"all",no_argument, NULL, 'a'},
{"sum",no_argument, NULL, 's'},
{"sum-only",   no_argument, NULL, 'S'},
{"megabytes",  no_argument, NULL, 'm'},
@@ -22,7 +21,6 @@ static struct option const qsize_long_opts[] = {
 };
 static const char * const qsize_opts_help[] = {
"Show size used on disk",
-   "Size all installed packages",
"Include a summary",
"Show just the summary",
"Display size in megabytes",
@@ -39,7 +37,6 @@ int qsize_main(int argc, char **argv)
q_vdb_cat_ctx *cat_ctx;
q_vdb_pkg_ctx *pkg_ctx;
size_t i;
-   char search_all = 0;
struct stat st;
char fs_size = 0, summary = 0, summary_only = 0;
size_t num_all_files, num_all_nonfiles, num_all_ignored;
@@ -50,13 +47,14 @@ int qsize_main(int argc, char **argv)
size_t buflen;
char *buf;
char filename[_Q_PATH_MAX], *filename_root;
+   depend_atom *atom;
+   DECLARE_ARRAY(atoms);
DECLARE_ARRAY(ignore_regexp);
 
while ((i = GETOPT_LONG(QSIZE, qsize, "")) != -1) {
switch (i) {
COMMON_GETOPTS_CASES(qsize)
case 'f': fs_size = 1; break;
-   case 'a': search_all = 1; break;
case 's': summary = 1; break;
case 'S': summary = summary_only = 1; break;
case 'm': disp_units = MEGABYTE; str_disp_units = "MiB"; break;
@@ -70,8 +68,16 @@ int qsize_main(int argc, char **argv)
}
}
}
-   if ((argc == optind) && !search_all)
-   qsize_usage(EXIT_FAILURE);
+
+   argc -= optind;
+   argv += optind;
+   for (i = 0; i < argc; ++i) {
+   atom = atom_explode(argv[i]);
+   if (!atom)
+   warn("invalid atom: %s", argv[i]);
+   else
+   xarraypush_ptr(atoms, atom);
+   }
 
num_all_bytes = num_all_files = num_all_nonfiles = num_all_ignored = 0;
 
@@ -91,18 +97,24 @@ int qsize_main(int argc, char **argv)
while ((pkg_ctx = q_vdb_next_pkg(cat_ctx))) {
const char *pkgname = pkg_ctx->name;
FILE *fp;
+   bool showit = false;
+
/* see if this cat/pkg is requested */
-   if (!search_all) {
-   for (i = optind; i < argc; ++i) {
-   snprintf(buf, buflen, "%s/%s", catname, 
pkgname);
-   if (rematch(argv[i], buf, REG_EXTENDED) 
== 0)
+   if (array_cnt(atoms)) {
+   depend_atom *qatom;
+
+   snprintf(buf, buflen, "%s/%s", catname, 
pkgname);
+   qatom = atom_explode(buf);
+   array_for_each(atoms, i, atom)
+   if (atom_compare(atom, qatom) == EQUAL) 
{
+   showit = true;
break;
-   if (rematch(argv[i], pkgname, 
REG_EXTENDED) == 0)
-   break;
-   }
-   if (i == argc)
-   goto next_pkg;
-   }
+   }
+   atom_implode(qatom);
+  

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

2016-02-22 Thread Mike Frysinger
commit: 1dbce6aec3b91f9efb13df94c5a8e5c33ea65a4c
Author: Mike Frysinger  gentoo  org>
AuthorDate: Mon Feb 22 18:31:41 2016 +
Commit: Mike Frysinger  gentoo  org>
CommitDate: Mon Feb 22 18:31:41 2016 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=1dbce6ae

man: regen manpages

 man/qatom.1  | 5 -
 man/qfile.1  | 8 +---
 man/qlist.1  | 4 ++--
 man/qlop.1   | 4 ++--
 man/qmerge.1 | 5 +
 5 files changed, 10 insertions(+), 16 deletions(-)

diff --git a/man/qatom.1 b/man/qatom.1
index b4bc8ce..42991a5 100644
--- a/man/qatom.1
+++ b/man/qatom.1
@@ -1,4 +1,4 @@
-.TH qatom "1" "Mar 2014" "Gentoo Foundation" "qatom"
+.TH qatom "1" "Feb 2016" "Gentoo Foundation" "qatom"
 .SH NAME
 qatom \- split atom strings
 .SH SYNOPSIS
@@ -8,6 +8,9 @@ qatom \- split atom strings
 
 .SH OPTIONS
 .TP
+\fB\-F\fR \fI\fR, \fB\-\-format\fR \fI\fR
+Custom output format (default: %{CATEGORY} %{PN} %{PV} %[PR] %[SLOT] %[pfx] 
%[sfx])
+.TP
 \fB\-c\fR, \fB\-\-compare\fR
 Compare two atoms
 .TP

diff --git a/man/qfile.1 b/man/qfile.1
index 83dacfb..54823cd 100644
--- a/man/qfile.1
+++ b/man/qfile.1
@@ -1,4 +1,4 @@
-.TH qfile "1" "Mar 2014" "Gentoo Foundation" "qfile"
+.TH qfile "1" "Feb 2016" "Gentoo Foundation" "qfile"
 .SH NAME
 qfile \- list all pkgs owning files
 .SH SYNOPSIS
@@ -14,12 +14,6 @@ Display installed packages with slots
 \fB\-R\fR, \fB\-\-root\-prefix\fR
 Assume arguments are already prefixed by $ROOT
 .TP
-\fB\-f\fR \fI\fR, \fB\-\-from\fR \fI\fR
-Read arguments from file  ("-" for stdin)
-.TP
-\fB\-m\fR \fI\fR, \fB\-\-max\-args\fR \fI\fR
-Treat from file arguments by groups of  (defaults to 5000)
-.TP
 \fB\-b\fR, \fB\-\-basename\fR
 Match any component of the path
 .TP

diff --git a/man/qlist.1 b/man/qlist.1
index eee563d..eedc2cd 100644
--- a/man/qlist.1
+++ b/man/qlist.1
@@ -1,4 +1,4 @@
-.TH qlist "1" "Mar 2014" "Gentoo Foundation" "qlist"
+.TH qlist "1" "Feb 2016" "Gentoo Foundation" "qlist"
 .SH NAME
 qlist \- list files owned by pkgname
 .SH SYNOPSIS
@@ -12,7 +12,7 @@ qlist \- list files owned by pkgname
 Just show installed packages
 .TP
 \fB\-S\fR, \fB\-\-slots\fR
-Display installed packages with slots
+Display installed packages with slots (use twice for subslots)
 .TP
 \fB\-R\fR, \fB\-\-repo\fR
 Display installed packages with repository

diff --git a/man/qlop.1 b/man/qlop.1
index 26ef7b5..6e645a8 100644
--- a/man/qlop.1
+++ b/man/qlop.1
@@ -1,4 +1,4 @@
-.TH qlop "1" "Mar 2014" "Gentoo Foundation" "qlop"
+.TH qlop "1" "Feb 2016" "Gentoo Foundation" "qlop"
 .SH NAME
 qlop \- emerge log analyzer
 .SH SYNOPSIS
@@ -30,7 +30,7 @@ Show sync history
 Show current emerging packages
 .TP
 \fB\-f\fR \fI\fR, \fB\-\-logfile\fR \fI\fR
-Read emerge logfile instead of /var/log/emerge.log
+Read emerge logfile instead of $EMERGE_LOG_DIR/emerge.log
 .TP
 \fB\-\-root\fR \fI\fR
 Set the ROOT env var

diff --git a/man/qmerge.1 b/man/qmerge.1
index 558a810..df928f1 100644
--- a/man/qmerge.1
+++ b/man/qmerge.1
@@ -1,4 +1,4 @@
-.TH qmerge "1" "Mar 2014" "Gentoo Foundation" "qmerge"
+.TH qmerge "1" "Feb 2016" "Gentoo Foundation" "qmerge"
 .SH NAME
 qmerge \- fetch and merge binary package
 .SH SYNOPSIS
@@ -35,9 +35,6 @@ Don't prompt before overwriting
 \fB\-O\fR, \fB\-\-nodeps\fR
 Don't merge dependencies
 .TP
-\fB\-5\fR, \fB\-\-nomd5\fR
-Don't verify MD5 digest of files
-.TP
 \fB\-\-debug\fR
 Run shell funcs with `set -x`
 .TP



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

2018-05-18 Thread Fabian Groffen
commit: 93d6bb6e36d0559322c06508302d39a4db2ce272
Author: Fabian Groffen  gentoo  org>
AuthorDate: Fri May 18 10:14:02 2018 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Fri May 18 10:14:02 2018 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=93d6bb6e

man/qfile.1: regenerate after author change

 man/qfile.1 | 17 -
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/man/qfile.1 b/man/qfile.1
index ff92897..729b561 100644
--- a/man/qfile.1
+++ b/man/qfile.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qfile "1" "Apr 2018" "Gentoo Foundation" "qfile"
+.TH qfile "1" "May 2018" "Gentoo Foundation" "qfile"
 .SH NAME
 qfile \- list all pkgs owning files
 .SH SYNOPSIS
@@ -50,16 +50,17 @@ Print this help and exit.
 .TP
 \fB\-V\fR, \fB\-\-version\fR
 Print version and exit.
-.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
@@ -71,7 +72,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
@@ -202,10 +203,6 @@ tar tjf "${tarbz2}" \\
| qfile -e -f - -x ${categ}/${pn}:${slot}
 rm -rf "${tmpdir}"
 .PP
-.SH "ADDITIONAL CONTRIBUTORS"
-.nf
-TGL degrenier[at]easyconnect.fr
-.fi
 .SH "REPORTING BUGS"
 Please report bugs via http://bugs.gentoo.org/
 .br
@@ -215,6 +212,7 @@ portage-ut...@gentoo.org
 .nf
 Ned Ludd 
 Mike Frysinger 
+TGL 
 .fi
 .SH "SEE ALSO"
 .BR q (1),
@@ -230,5 +228,6 @@ Mike Frysinger 
 .BR qsearch (1),
 .BR qsize (1),
 .BR qtbz2 (1),
+.BR qtegrity (1),
 .BR quse (1),
 .BR qxpak (1)



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

2018-05-18 Thread Fabian Groffen
commit: 41c8ebc7eb8c1e517bd191736f4ef3ac66ab34e0
Author: Fabian Groffen  gentoo  org>
AuthorDate: Fri May 18 11:34:45 2018 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Fri May 18 11:34:45 2018 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=41c8ebc7

mkman: add myself as author

 man/mkman.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/man/mkman.py b/man/mkman.py
index 7089320..bd3111c 100755
--- a/man/mkman.py
+++ b/man/mkman.py
@@ -33,6 +33,7 @@ def FindApplets():
 COMMON_AUTHORS = [
 'Ned Ludd ',
 'Mike Frysinger ',
+'Fabian Groffen ',
 ]
 TEMPLATE = r""".\" generated by mkman.py, please do NOT edit!
 .TH %(applet)s "1" "%(date)s" "Gentoo Foundation" "%(applet)s"



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

2018-05-18 Thread Fabian Groffen
commit: 56ab601781a95b1172cbcf957ef706bbc021116a
Author: Fabian Groffen  gentoo  org>
AuthorDate: Fri May 18 11:35:26 2018 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Fri May 18 11:35:26 2018 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=56ab6017

man: regenerate

 man/q.1| 1 +
 man/qatom.1| 1 +
 man/qcache.1   | 1 +
 man/qcheck.1   | 1 +
 man/qdepends.1 | 1 +
 man/qfile.1| 1 +
 man/qgrep.1| 1 +
 man/qlist.1| 1 +
 man/qlop.1 | 1 +
 man/qmerge.1   | 1 +
 man/qpkg.1 | 1 +
 man/qsearch.1  | 1 +
 man/qsize.1| 1 +
 man/qtbz2.1| 1 +
 man/qtegrity.1 | 1 +
 man/quse.1 | 1 +
 man/qxpak.1| 1 +
 17 files changed, 17 insertions(+)

diff --git a/man/q.1 b/man/q.1
index 80c3d0a..b88dd4c 100644
--- a/man/q.1
+++ b/man/q.1
@@ -69,6 +69,7 @@ portage-ut...@gentoo.org
 .nf
 Ned Ludd 
 Mike Frysinger 
+Fabian Groffen 
 .fi
 .SH "SEE ALSO"
 .BR qatom (1),

diff --git a/man/qatom.1 b/man/qatom.1
index dd44038..f1c985b 100644
--- a/man/qatom.1
+++ b/man/qatom.1
@@ -94,6 +94,7 @@ portage-ut...@gentoo.org
 .nf
 Ned Ludd 
 Mike Frysinger 
+Fabian Groffen 
 .fi
 .SH "SEE ALSO"
 .BR q (1),

diff --git a/man/qcache.1 b/man/qcache.1
index acbaa24..fd8a620 100644
--- a/man/qcache.1
+++ b/man/qcache.1
@@ -60,6 +60,7 @@ portage-ut...@gentoo.org
 .nf
 Ned Ludd 
 Mike Frysinger 
+Fabian Groffen 
 .fi
 .SH "SEE ALSO"
 .BR q (1),

diff --git a/man/qcheck.1 b/man/qcheck.1
index e52e2e3..f6f1d26 100644
--- a/man/qcheck.1
+++ b/man/qcheck.1
@@ -60,6 +60,7 @@ portage-ut...@gentoo.org
 .nf
 Ned Ludd 
 Mike Frysinger 
+Fabian Groffen 
 .fi
 .SH "SEE ALSO"
 .BR q (1),

diff --git a/man/qdepends.1 b/man/qdepends.1
index c0032fa..2e1aab2 100644
--- a/man/qdepends.1
+++ b/man/qdepends.1
@@ -114,6 +114,7 @@ portage-ut...@gentoo.org
 .nf
 Ned Ludd 
 Mike Frysinger 
+Fabian Groffen 
 .fi
 .SH "SEE ALSO"
 .BR q (1),

diff --git a/man/qfile.1 b/man/qfile.1
index 729b561..6916628 100644
--- a/man/qfile.1
+++ b/man/qfile.1
@@ -212,6 +212,7 @@ portage-ut...@gentoo.org
 .nf
 Ned Ludd 
 Mike Frysinger 
+Fabian Groffen 
 TGL 
 .fi
 .SH "SEE ALSO"

diff --git a/man/qgrep.1 b/man/qgrep.1
index 40e4999..0cc0831 100644
--- a/man/qgrep.1
+++ b/man/qgrep.1
@@ -85,6 +85,7 @@ portage-ut...@gentoo.org
 .nf
 Ned Ludd 
 Mike Frysinger 
+Fabian Groffen 
 .fi
 .SH "SEE ALSO"
 .BR q (1),

diff --git a/man/qlist.1 b/man/qlist.1
index 905c0be..96b201b 100644
--- a/man/qlist.1
+++ b/man/qlist.1
@@ -83,6 +83,7 @@ portage-ut...@gentoo.org
 .nf
 Ned Ludd 
 Mike Frysinger 
+Fabian Groffen 
 .fi
 .SH "SEE ALSO"
 .BR q (1),

diff --git a/man/qlop.1 b/man/qlop.1
index 10e2394..8def1f2 100644
--- a/man/qlop.1
+++ b/man/qlop.1
@@ -89,6 +89,7 @@ portage-ut...@gentoo.org
 .nf
 Ned Ludd 
 Mike Frysinger 
+Fabian Groffen 
 .fi
 .SH "SEE ALSO"
 .BR q (1),

diff --git a/man/qmerge.1 b/man/qmerge.1
index fb94de6..56c79e9 100644
--- a/man/qmerge.1
+++ b/man/qmerge.1
@@ -71,6 +71,7 @@ portage-ut...@gentoo.org
 .nf
 Ned Ludd 
 Mike Frysinger 
+Fabian Groffen 
 .fi
 .SH "SEE ALSO"
 .BR q (1),

diff --git a/man/qpkg.1 b/man/qpkg.1
index 4738026..b5691b1 100644
--- a/man/qpkg.1
+++ b/man/qpkg.1
@@ -51,6 +51,7 @@ portage-ut...@gentoo.org
 .nf
 Ned Ludd 
 Mike Frysinger 
+Fabian Groffen 
 TGL 
 .fi
 .SH "SEE ALSO"

diff --git a/man/qsearch.1 b/man/qsearch.1
index e3e93a6..f3ae1f5 100644
--- a/man/qsearch.1
+++ b/man/qsearch.1
@@ -59,6 +59,7 @@ portage-ut...@gentoo.org
 .nf
 Ned Ludd 
 Mike Frysinger 
+Fabian Groffen 
 TGL 
 .fi
 .SH "SEE ALSO"

diff --git a/man/qsize.1 b/man/qsize.1
index cd1a664..d2ea494 100644
--- a/man/qsize.1
+++ b/man/qsize.1
@@ -60,6 +60,7 @@ portage-ut...@gentoo.org
 .nf
 Ned Ludd 
 Mike Frysinger 
+Fabian Groffen 
 .fi
 .SH "SEE ALSO"
 .BR q (1),

diff --git a/man/qtbz2.1 b/man/qtbz2.1
index d21c804..b356d53 100644
--- a/man/qtbz2.1
+++ b/man/qtbz2.1
@@ -55,6 +55,7 @@ portage-ut...@gentoo.org
 .nf
 Ned Ludd 
 Mike Frysinger 
+Fabian Groffen 
 .fi
 .SH "SEE ALSO"
 .BR q (1),

diff --git a/man/qtegrity.1 b/man/qtegrity.1
index 76ed731..2ba896c 100644
--- a/man/qtegrity.1
+++ b/man/qtegrity.1
@@ -60,6 +60,7 @@ portage-ut...@gentoo.org
 .nf
 Ned Ludd 
 Mike Frysinger 
+Fabian Groffen 
 Sam Besselink
 .fi
 .SH "SEE ALSO"

diff --git a/man/quse.1 b/man/quse.1
index 28b1a33..c8d9f72 100644
--- a/man/quse.1
+++ b/man/quse.1
@@ -63,6 +63,7 @@ portage-ut...@gentoo.org
 .nf
 Ned Ludd 
 Mike Frysinger 
+Fabian Groffen 
 Sam Besselink
 .fi
 .SH "SEE ALSO"

diff --git a/man/qxpak.1 b/man/qxpak.1
index 6c27a5b..1866c28 100644
--- a/man/qxpak.1
+++ b/man/qxpak.1
@@ -51,6 +51,7 @@ portage-ut...@gentoo.org
 .nf
 Ned Ludd 
 Mike Frysinger 
+Fabian Groffen 
 TGL 
 .fi
 .SH "SEE ALSO"



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

2018-05-18 Thread Fabian Groffen
commit: 3ed4ea7795c32374ba77674d98cecf8e8bc0ff03
Author: Fabian Groffen  gentoo  org>
AuthorDate: Fri May 18 11:15:12 2018 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Fri May 18 11:15:12 2018 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=3ed4ea77

man: regenerate for release

 man/q.1| 4 +++-
 man/qatom.1| 3 ++-
 man/qcache.1   | 3 ++-
 man/qcheck.1   | 3 ++-
 man/qdepends.1 | 3 ++-
 man/qgrep.1| 3 ++-
 man/qlist.1| 3 ++-
 man/qlop.1 | 3 ++-
 man/qmerge.1   | 3 ++-
 man/qpkg.1 | 4 +++-
 man/qsearch.1  | 4 +++-
 man/qsize.1| 3 ++-
 man/qtbz2.1| 3 ++-
 man/quse.1 | 4 +++-
 man/qxpak.1| 4 +++-
 15 files changed, 35 insertions(+), 15 deletions(-)

diff --git a/man/q.1 b/man/q.1
index c47c177..80c3d0a 100644
--- a/man/q.1
+++ b/man/q.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH q "1" "Apr 2018" "Gentoo Foundation" "q"
+.TH q "1" "May 2018" "Gentoo Foundation" "q"
 .SH NAME
 q \- invoke a portage utility applet
 .SH SYNOPSIS
@@ -58,6 +58,7 @@ Print version and exit.
 qtbz2  : manipulate tbz2 packages
  quse: find pkgs using useflags
 qxpak  : manipulate xpak archives
+ qtegrity  : verify files with IMA
 .fi
 .SH "REPORTING BUGS"
 Please report bugs via http://bugs.gentoo.org/
@@ -83,5 +84,6 @@ Mike Frysinger 
 .BR qsearch (1),
 .BR qsize (1),
 .BR qtbz2 (1),
+.BR qtegrity (1),
 .BR quse (1),
 .BR qxpak (1)

diff --git a/man/qatom.1 b/man/qatom.1
index aeb9629..dd44038 100644
--- a/man/qatom.1
+++ b/man/qatom.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qatom "1" "Apr 2018" "Gentoo Foundation" "qatom"
+.TH qatom "1" "May 2018" "Gentoo Foundation" "qatom"
 .SH NAME
 qatom \- split atom strings
 .SH SYNOPSIS
@@ -109,5 +109,6 @@ Mike Frysinger 
 .BR qsearch (1),
 .BR qsize (1),
 .BR qtbz2 (1),
+.BR qtegrity (1),
 .BR quse (1),
 .BR qxpak (1)

diff --git a/man/qcache.1 b/man/qcache.1
index fe2ef07..acbaa24 100644
--- a/man/qcache.1
+++ b/man/qcache.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qcache "1" "Apr 2018" "Gentoo Foundation" "qcache"
+.TH qcache "1" "May 2018" "Gentoo Foundation" "qcache"
 .SH NAME
 qcache \- search the metadata cache
 .SH SYNOPSIS
@@ -75,5 +75,6 @@ Mike Frysinger 
 .BR qsearch (1),
 .BR qsize (1),
 .BR qtbz2 (1),
+.BR qtegrity (1),
 .BR quse (1),
 .BR qxpak (1)

diff --git a/man/qcheck.1 b/man/qcheck.1
index 2351ed3..e52e2e3 100644
--- a/man/qcheck.1
+++ b/man/qcheck.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qcheck "1" "Apr 2018" "Gentoo Foundation" "qcheck"
+.TH qcheck "1" "May 2018" "Gentoo Foundation" "qcheck"
 .SH NAME
 qcheck \- verify integrity of installed packages
 .SH SYNOPSIS
@@ -75,5 +75,6 @@ Mike Frysinger 
 .BR qsearch (1),
 .BR qsize (1),
 .BR qtbz2 (1),
+.BR qtegrity (1),
 .BR quse (1),
 .BR qxpak (1)

diff --git a/man/qdepends.1 b/man/qdepends.1
index c51a02d..c0032fa 100644
--- a/man/qdepends.1
+++ b/man/qdepends.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qdepends "1" "Apr 2018" "Gentoo Foundation" "qdepends"
+.TH qdepends "1" "May 2018" "Gentoo Foundation" "qdepends"
 .SH NAME
 qdepends \- show dependency info
 .SH SYNOPSIS
@@ -129,5 +129,6 @@ Mike Frysinger 
 .BR qsearch (1),
 .BR qsize (1),
 .BR qtbz2 (1),
+.BR qtegrity (1),
 .BR quse (1),
 .BR qxpak (1)

diff --git a/man/qgrep.1 b/man/qgrep.1
index bd140b3..40e4999 100644
--- a/man/qgrep.1
+++ b/man/qgrep.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qgrep "1" "Apr 2018" "Gentoo Foundation" "qgrep"
+.TH qgrep "1" "May 2018" "Gentoo Foundation" "qgrep"
 .SH NAME
 qgrep \- grep in ebuilds
 .SH SYNOPSIS
@@ -100,5 +100,6 @@ Mike Frysinger 
 .BR qsearch (1),
 .BR qsize (1),
 .BR qtbz2 (1),
+.BR qtegrity (1),
 .BR quse (1),
 .BR qxpak (1)

diff --git a/man/qlist.1 b/man/qlist.1
index f7dd847..905c0be 100644
--- a/man/qlist.1
+++ b/man/qlist.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qlist "1" "Apr 2018" "Gentoo Foundation" "qlist"
+.TH qlist "1" "May 2018" "Gentoo Foundation" "qlist"
 .SH NAME
 qlist \- list files owned by pkgname
 .SH SYNOPSIS
@@ -98,5 +98,6 @@ Mike Frysinger 
 .BR qsearch (1),
 .BR qsize (1),
 .BR qtbz2 (1),
+.BR qtegrity (1),
 .BR quse (1),
 .BR qxpak (1)

diff --git a/man/qlop.1 b/man/qlop.1
index 18c05fb..10e2394 100644
--- a/man/qlop.1
+++ b/man/qlop.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qlop "1" "Apr 2018" "Gentoo Foundation" "qlop"
+.TH qlop "1" "May 2018" "Gentoo Foundation" "qlop"
 .SH NAME
 qlop \- emerge log analyzer
 .SH SYNOPSIS
@@ -104,5 +104,6 @@ Mike Frysinger 
 .BR qsearch (1),
 .BR qsize (1),
 .BR qtbz2 (1),
+.BR qtegrity (1),
 .BR quse (1),
 .BR qxpak (1)

diff --git a/man/qmerge.1 b/man/qmerge.1
index f66908e..fb94de6 100644
--- a/man/qmerge.1
+++ b/man/qmerge.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qmerge "1" "A

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

2018-03-31 Thread Fabian Groffen
commit: fe42f2a99297fed36720e71ba2ed77cf7a9da804
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sat Mar 31 19:04:20 2018 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sat Mar 31 19:04:20 2018 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=fe42f2a9

man/qlop: add some more/better documentation

Bug: https://bugs.gentoo.org/335453
Bug: https://bugs.gentoo.org/367199

 man/qlop.1 | 40 +++-
 1 file changed, 23 insertions(+), 17 deletions(-)

diff --git a/man/qlop.1 b/man/qlop.1
index f8f0cdd..70fb411 100644
--- a/man/qlop.1
+++ b/man/qlop.1
@@ -1,57 +1,63 @@
-.TH qlop "1" "Mar 2016" "Gentoo Foundation" "qlop"
+.TH qlop "1" "Mar 2018" "Gentoo Foundation" "qlop"
 .SH NAME
 qlop \- emerge log analyzer
 .SH SYNOPSIS
 .B qlop
 \fI[opts] \fR
 .SH DESCRIPTION
-
+qlop reads from $EMERGE_LOG_DIR/emerge.log and tries to extract
+information about merges, unmerges and syncs.  For packages, it can
+calculate average merge times or just list them.
 .SH OPTIONS
 .TP
 \fB\-g\fR, \fB\-\-gauge\fR
-Gauge number of times a package has been merged
+Gauge number of times a package has been merged.  This shows the merge
+time for each individual merge of package.
 .TP
 \fB\-t\fR, \fB\-\-time\fR
-Calculate merge time for a specific package
+Calculate merge time for a specific package.  This is the average time
+for all merges of package.
 .TP
 \fB\-H\fR, \fB\-\-human\fR
-Print seconds in human readable format (needs -t)
+Print seconds in human readable format (needs -t), using minutes, hours
+and days instead of just seconds.
 .TP
 \fB\-l\fR, \fB\-\-list\fR
-Show merge history
+Show merge history.
 .TP
 \fB\-u\fR, \fB\-\-unlist\fR
-Show unmerge history
+Show unmerge history.
 .TP
 \fB\-s\fR, \fB\-\-sync\fR
-Show sync history
+Show sync history.
 .TP
 \fB\-c\fR, \fB\-\-current\fR
-Show current emerging packages
+Show current emerging packages.  This relies on FEATURES=sandbox in
+order to detect running merges.
 .TP
 \fB\-d\fR \fI\fR, \fB\-\-date\fR \fI\fR
-Limit selection to this time (1st -d is start, 2nd -d is end)
+Limit selection to this time (1st -d is start, 2nd -d is end).
 .TP
 \fB\-f\fR \fI\fR, \fB\-\-logfile\fR \fI\fR
-Read emerge logfile instead of $EMERGE_LOG_DIR/emerge.log
+Read emerge logfile instead of $EMERGE_LOG_DIR/emerge.log.
 .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 and revisions.
 .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/



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

2018-04-01 Thread Fabian Groffen
commit: 684a8118721c28690b74fbdc3e74b351e799ffd8
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sun Apr  1 12:39:17 2018 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sun Apr  1 12:39:17 2018 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=684a8118

man/mkman: add header, allow argument description override

 man/mkman.py | 29 -
 1 file changed, 24 insertions(+), 5 deletions(-)

diff --git a/man/mkman.py b/man/mkman.py
index 0751b92..8444311 100755
--- a/man/mkman.py
+++ b/man/mkman.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # -*- coding: utf-8 -*-
 
 """Generate man pages for the q applets"""
@@ -14,6 +14,7 @@ import os
 import re
 import subprocess
 import sys
+import yaml
 
 
 MKMAN_DIR = os.path.realpath(os.path.join(__file__, '..'))
@@ -33,7 +34,8 @@ COMMON_AUTHORS = [
 'Ned Ludd ',
 'Mike Frysinger ',
 ]
-TEMPLATE = r""".TH %(applet)s "1" "%(date)s" "Gentoo Foundation" "%(applet)s"
+TEMPLATE = r""".\" generated by mkman.py, please do NOT edit!
+.TH %(applet)s "1" "%(date)s" "Gentoo Foundation" "%(applet)s"
 .SH NAME
 %(applet)s \- %(short_desc)s
 .SH SYNOPSIS
@@ -47,7 +49,8 @@ TEMPLATE = r""".TH %(applet)s "1" "%(date)s" "Gentoo 
Foundation" "%(applet)s"
 .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
 %(authors)s
@@ -74,7 +77,15 @@ def MkMan(applets, applet, output):
 description = ''
 desc_file = os.path.join(FRAGS_DIR, '%s.desc' % applet)
 if os.path.exists(desc_file):
-description = open(desc_file).read().rstrip()
+fh = open(desc_file)
+description = fh.read().rstrip()
+fh.close()
+
+optdescs = []
+desc_file = os.path.join(FRAGS_DIR, '%s.optdesc.yaml' % applet)
+if os.path.exists(desc_file):
+with open(desc_file) as fh:
+optdescs = yaml.load(fh)
 
 # Extract all the options
 options = []
@@ -89,6 +100,11 @@ def MkMan(applets, applet, output):
 flags += [option[0].rstrip(',')]
 option.pop(0)
 
+optdesc = None
+for x in flags:
+if x.lstrip('-') in optdescs:
+optdesc = optdescs[x.lstrip('-')].strip()
+
 if option[0] in ('', '[arg]'):
 flags = [r'\fB%s\fR \fI%s\fR' % (x, option[0]) for x in flags]
 option.pop(0)
@@ -98,10 +114,13 @@ def MkMan(applets, applet, output):
 assert option[0] == '*', 'help line for %s is broken: %r' % 
(applet, option)
 option.pop(0)
 
+if not optdesc:
+optdesc = ' '.join(option).rstrip('.') + '.'
+
 options += [
 '.TP',
 ', '.join(flags).replace('-', r'\-'),
-' '.join(option),
+optdesc,
 ]
 break
 



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

2018-04-03 Thread Fabian Groffen
commit: ac708664ba64def5168a827e937401150809606d
Author: Fabian Groffen  gentoo  org>
AuthorDate: Tue Apr  3 19:59:44 2018 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Tue Apr  3 19:59:44 2018 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=ac708664

man: regen remaining manpages

 man/q.1  | 26 ++
 man/qcache.1 | 32 +---
 man/qcheck.1 | 34 ++
 man/qpkg.1   |  2 +-
 4 files changed, 50 insertions(+), 44 deletions(-)

diff --git a/man/q.1 b/man/q.1
index 0f8f367..c47c177 100644
--- a/man/q.1
+++ b/man/q.1
@@ -1,4 +1,5 @@
-.TH q "1" "Mar 2016" "Gentoo Foundation" "q"
+.\" generated by mkman.py, please do NOT edit!
+.TH q "1" "Apr 2018" "Gentoo Foundation" "q"
 .SH NAME
 q \- invoke a portage utility applet
 .SH SYNOPSIS
@@ -9,34 +10,34 @@ q \- invoke a portage utility applet
 .SH OPTIONS
 .TP
 \fB\-i\fR, \fB\-\-install\fR
-Install symlinks for applets
+Install symlinks for applets.
 .TP
 \fB\-r\fR \fI[arg]\fR, \fB\-\-reinitialize\fR \fI[arg]\fR
-Reinitialize ebuild cache
+Reinitialize ebuild cache.
 .TP
 \fB\-m\fR \fI[arg]\fR, \fB\-\-metacache\fR \fI[arg]\fR
-Reinitialize metadata cache
+Reinitialize metadata cache.
 .TP
 \fB\-M\fR \fI\fR, \fB\-\-modpath\fR \fI\fR
-Module path
+Module path.
 .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 APPLETS
 .nf
 .B This applet also has sub applets:
@@ -61,7 +62,8 @@ Print version and exit
 .SH "REPORTING BUGS"
 Please report bugs via http://bugs.gentoo.org/
 .br
-Product: Portage Development; Component: Tools
+Product: Portage Development; Component: Tools, Assignee:
+portage-ut...@gentoo.org
 .SH AUTHORS
 .nf
 Ned Ludd 

diff --git a/man/qcache.1 b/man/qcache.1
index 81ae2fa..fe2ef07 100644
--- a/man/qcache.1
+++ b/man/qcache.1
@@ -1,4 +1,5 @@
-.TH qcache "1" "Mar 2016" "Gentoo Foundation" "qcache"
+.\" generated by mkman.py, please do NOT edit!
+.TH qcache "1" "Apr 2018" "Gentoo Foundation" "qcache"
 .SH NAME
 qcache \- search the metadata cache
 .SH SYNOPSIS
@@ -9,51 +10,52 @@ qcache \- search the metadata cache
 .SH OPTIONS
 .TP
 \fB\-p\fR \fI\fR, \fB\-\-matchpkg\fR \fI\fR
-match pkgname
+match pkgname.
 .TP
 \fB\-c\fR \fI\fR, \fB\-\-matchcat\fR \fI\fR
-match catname
+match catname.
 .TP
 \fB\-i\fR, \fB\-\-imlate\fR
-list packages that can be marked stable on a given arch
+list packages that can be marked stable on a given arch.
 .TP
 \fB\-d\fR, \fB\-\-dropped\fR
-list packages that have dropped keywords on a version bump on a given arch
+list packages that have dropped keywords on a version bump on a given arch.
 .TP
 \fB\-t\fR, \fB\-\-testing\fR
-list packages that have ~arch versions, but no stable versions on a given arch
+list packages that have ~arch versions, but no stable versions on a given arch.
 .TP
 \fB\-s\fR, \fB\-\-stats\fR
-display statistics about the portage tree
+display statistics about the portage tree.
 .TP
 \fB\-a\fR, \fB\-\-all\fR
-list packages that have at least one version keyworded for on a given arch
+list packages that have at least one version keyworded for on a given arch.
 .TP
 \fB\-n\fR, \fB\-\-not\fR
 list packages that aren't keyworded on a given arch.
 .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 

diff --git a/man/qcheck.1 b/man/qcheck.1
index ed90c86..2351ed3 100644
--- a/man/qcheck.1
+++ b/man/qcheck.1
@@ -1,4 +1,5 @@
-.TH qcheck "1" "Mar 2016" "Gentoo Foundation" "qcheck"
+.\" generated by mkman.py, please do NOT edit!
+.TH qcheck "1" "Apr 2018" "Gentoo Foundation" "qcheck"
 .SH NAME
 qcheck \- verify integrity of installed packages
 .SH SYNOPSIS
@@ -9,51 +10,52 @@ qcheck \- verify integrity of installed packages
 .SH OPTIONS
 .TP
 \fB\-s\fR \fI\fR, \fB\-\-skip\fR \fI\fR
-Ignore files matching the regular expression 
+Ignore files matching the regular expression

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

2014-03-10 Thread Mike Frysinger
commit: 6bc6b925108cdfaed498ebf507ac592721b357b5
Author: Mike Frysinger  gentoo  org>
AuthorDate: Tue Mar 11 04:47:33 2014 +
Commit: Mike Frysinger  gentoo  org>
CommitDate: Tue Mar 11 04:47:33 2014 +
URL:
http://git.overlays.gentoo.org/gitweb/?p=proj/portage-utils.git;a=commit;h=6bc6b925

man: regenerate

---
 man/q.1|  5 -
 man/qatom.1|  5 -
 man/qcache.1   |  5 -
 man/qcheck.1   |  5 -
 man/qdepends.1 | 24 ++--
 man/qfile.1|  5 -
 man/qgrep.1|  5 -
 man/qlist.1| 13 -
 man/qlop.1 |  5 -
 man/qmerge.1   |  8 +++-
 man/qpkg.1 |  5 -
 man/qsearch.1  |  5 -
 man/qsize.1|  5 -
 man/qtbz2.1|  5 -
 man/quse.1 |  5 -
 man/qxpak.1|  5 -
 16 files changed, 89 insertions(+), 21 deletions(-)

diff --git a/man/q.1 b/man/q.1
index 59aa68d..322e1af 100644
--- a/man/q.1
+++ b/man/q.1
@@ -1,4 +1,4 @@
-.TH q "1" "Sep 2013" "Gentoo Foundation" "q"
+.TH q "1" "Mar 2014" "Gentoo Foundation" "q"
 .SH NAME
 q \- invoke a portage utility applet
 .SH SYNOPSIS
@@ -20,6 +20,9 @@ Reinitialize metadata cache
 \fB\-M\fR \fI\fR, \fB\-\-modpath\fR \fI\fR
 Module path
 .TP
+\fB\-\-root\fR \fI\fR
+Set the ROOT env var
+.TP
 \fB\-v\fR, \fB\-\-verbose\fR
 Make a lot of noise
 .TP

diff --git a/man/qatom.1 b/man/qatom.1
index 934546d..b4bc8ce 100644
--- a/man/qatom.1
+++ b/man/qatom.1
@@ -1,4 +1,4 @@
-.TH qatom "1" "Sep 2013" "Gentoo Foundation" "qatom"
+.TH qatom "1" "Mar 2014" "Gentoo Foundation" "qatom"
 .SH NAME
 qatom \- split atom strings
 .SH SYNOPSIS
@@ -11,6 +11,9 @@ qatom \- split atom strings
 \fB\-c\fR, \fB\-\-compare\fR
 Compare two atoms
 .TP
+\fB\-\-root\fR \fI\fR
+Set the ROOT env var
+.TP
 \fB\-v\fR, \fB\-\-verbose\fR
 Make a lot of noise
 .TP

diff --git a/man/qcache.1 b/man/qcache.1
index 549777d..1f46e4b 100644
--- a/man/qcache.1
+++ b/man/qcache.1
@@ -1,4 +1,4 @@
-.TH qcache "1" "Sep 2013" "Gentoo Foundation" "qcache"
+.TH qcache "1" "Mar 2014" "Gentoo Foundation" "qcache"
 .SH NAME
 qcache \- search the metadata cache
 .SH SYNOPSIS
@@ -32,6 +32,9 @@ list packages that have at least one version keyworded for on 
a given arch
 \fB\-n\fR, \fB\-\-not\fR
 list packages that aren't keyworded on a given arch.
 .TP
+\fB\-\-root\fR \fI\fR
+Set the ROOT env var
+.TP
 \fB\-v\fR, \fB\-\-verbose\fR
 Make a lot of noise
 .TP

diff --git a/man/qcheck.1 b/man/qcheck.1
index a830023..3633311 100644
--- a/man/qcheck.1
+++ b/man/qcheck.1
@@ -1,4 +1,4 @@
-.TH qcheck "1" "Sep 2013" "Gentoo Foundation" "qcheck"
+.TH qcheck "1" "Mar 2014" "Gentoo Foundation" "qcheck"
 .SH NAME
 qcheck \- verify integrity of installed packages
 .SH SYNOPSIS
@@ -38,6 +38,9 @@ Ignore files in CONFIG_PROTECT-ed paths
 \fB\-p\fR, \fB\-\-prelink\fR
 Undo prelink when calculating checksums
 .TP
+\fB\-\-root\fR \fI\fR
+Set the ROOT env var
+.TP
 \fB\-v\fR, \fB\-\-verbose\fR
 Make a lot of noise
 .TP

diff --git a/man/qdepends.1 b/man/qdepends.1
index 2014c3f..3b316a0 100644
--- a/man/qdepends.1
+++ b/man/qdepends.1
@@ -1,4 +1,4 @@
-.TH qdepends "1" "Sep 2013" "Gentoo Foundation" "qdepends"
+.TH qdepends "1" "Mar 2014" "Gentoo Foundation" "qdepends"
 .SH NAME
 qdepends \- show dependency info
 .SH SYNOPSIS
@@ -13,6 +13,9 @@ By default, it will tell you the build time dependencies only 
(DEPEND).
 
 Currently, qdepends will only query installed packages.  There is no support 
for
 querying packages not yet installed (the \fBequery\fR(1) tool can do that).
+
+If there is no answer to your query (i.e. you've asked for a package that is 
not
+installed, or a version that does not match), then you will get back no output.
 .SH OPTIONS
 .TP
 \fB\-d\fR, \fB\-\-depend\fR
@@ -39,6 +42,9 @@ Show all DEPEND info
 \fB\-f\fR, \fB\-\-format\fR
 Pretty format specified depend strings
 .TP
+\fB\-\-root\fR \fI\fR
+Set the ROOT env var
+.TP
 \fB\-v\fR, \fB\-\-verbose\fR
 Make a lot of noise
 .TP
@@ -71,4 +77,18 @@ Ned Ludd 
 Mike Frysinger 
 .fi
 .SH "SEE ALSO"
-
+.BR q (1),
+.BR qatom (1),
+.BR qcache (1),
+.BR qcheck (1),
+.BR qfile (1),
+.BR qgrep (1),
+.BR qlist (1),
+.BR qlop (1),
+.BR qmerge (1),
+.BR qpkg (1),
+.BR qsearch (1),
+.BR qsize (1),
+.BR qtbz2 (1),
+.BR quse (1),
+.BR qxpak (1)

diff --git a/man/qfile.1 b/man/qfile.1
index a651a95..83dacfb 100644
--- a/man/qfile.1
+++ b/man/qfile.1
@@ -1,4 +1,4 @@
-.TH qfile "1" "Sep 2013" "Gentoo Foundation" "qfile"
+.TH qfile "1" "Mar 2014" "Gentoo Foundation" "qfile"
 .SH NAME
 qfile \- list all pkgs owning files
 .SH SYNOPSIS
@@ -32,6 +32,9 @@ Don't look in package  (used with --orphans)
 \fB\-e\fR, \fB\-\-exact\fR
 Exact match (used with --exclude)
 .TP
+\fB\-\-root\fR \fI\fR
+Set the ROOT env var
+.TP
 \fB\-v\fR, \fB\-\-verbose\fR
 Make a lot of noise
 .TP

diff --git a/man/qgrep.1 b/man/qgrep.1
index 6858b70..1ff4797 100644
--- a/man/qgrep.1
+++ b/man/qgrep.1
@@ -1,4 +1,4 @@
-.TH qgrep "1" "Sep 2013" "Gentoo Foundation" "qgrep"
+.TH qgrep "1" "Mar 2014" "Gentoo Foun

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

2019-06-12 Thread Fabian Groffen
commit: a7ff20f634939e5766cd962bb51234cd0644b5d1
Author: Fabian Groffen  gentoo  org>
AuthorDate: Wed Jun 12 09:07:28 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Wed Jun 12 09:07:28 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=a7ff20f6

man/mkman: skip generation for applets that aren't enabled

This just eases the situation with --disable-qmanifest.

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

 man/mkman.py | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/man/mkman.py b/man/mkman.py
index ff11e0b..a1b68a7 100755
--- a/man/mkman.py
+++ b/man/mkman.py
@@ -64,7 +64,10 @@ def MkMan(applets, applet, output):
 
 # Extract the main use string and description:
 # Usage: q: invoke a portage utility applet
-ahelp = subprocess.check_output([Q, applet, '--help']).decode('ascii')
+try:
+ahelp = subprocess.check_output([Q, applet, '--help']).decode('ascii')
+except:
+return
 lines = ahelp.splitlines()
 m = re.search(r'^Usage: %s (.*) : (.*)' % applet, ahelp)
 usage = m.group(1)



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

2019-05-02 Thread Fabian Groffen
commit: 6eee66bd91df5928c0fbf1ee9cd2ff8a3f575d89
Author: Fabian Groffen  gentoo  org>
AuthorDate: Thu May  2 18:00:17 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Thu May  2 18:00:17 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=6eee66bd

qcache: rename to qkeyword

qcache has its roots in reading the metadata cache, but since this is
standard functionality provided by libq/cache now, all that qcache does
really is things with keywords.

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

 .gitignore   |   4 +-
 Makefile.am  |   6 +--
 Makefile.in  |  40 
 TODO.md  |   2 -
 applets.h|   4 +-
 man/q.1  |   6 +--
 man/qatom.1  |   4 +-
 man/qcheck.1 |   4 +-
 man/qdepends.1   |   4 +-
 man/qfile.1  |   4 +-
 man/qgrep.1  |   4 +-
 man/{qcache.1 => qkeyword.1} |   6 +--
 man/qlist.1  |   4 +-
 man/qlop.1   |   4 +-
 man/qmerge.1 |   4 +-
 man/qpkg.1   |   4 +-
 man/qsearch.1|   4 +-
 man/qsize.1  |   4 +-
 man/qtbz2.1  |   4 +-
 man/qtegrity.1   |   4 +-
 man/quse.1   |   2 +-
 man/qxpak.1  |   4 +-
 qcache.c => qkeyword.c   | 112 +--
 23 files changed, 118 insertions(+), 120 deletions(-)

diff --git a/.gitignore b/.gitignore
index c571c4e..b65a0fb 100644
--- a/.gitignore
+++ b/.gitignore
@@ -32,18 +32,18 @@ stamp-h1
 /*.old.c
 /q
 /qatom
-/qcache
 /qcheck
 /qdepends
 /qfile
 /qglsa
 /qgrep
+/qkeyword
 /qlist
 /qlop
 /qmerge
 /qpkg
 /qsearch
 /qsize
+/qtegrity
 /quse
 /qxpak
-/qtegrity

diff --git a/Makefile.am b/Makefile.am
index 9306019..b36173c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -10,11 +10,11 @@ SUBDIRS = \
 APPLETS = \
q \
qatom \
-   qcache \
qcheck \
qdepends \
qfile \
qgrep \
+   qkeyword \
qlist \
qlop \
qmerge \
@@ -30,11 +30,11 @@ APPLETS = \
 dist_man_MANS = \
man/q.1 \
man/qatom.1 \
-   man/qcache.1 \
man/qcheck.1 \
man/qdepends.1 \
man/qfile.1 \
man/qgrep.1 \
+   man/qkeyword.1 \
man/qlist.1 \
man/qlop.1 \
man/qmerge.1 \
@@ -52,11 +52,11 @@ q_SOURCES = \
main.c \
q.c \
qatom.c \
-   qcache.c \
qcheck.c \
qdepends.c \
qfile.c \
qgrep.c \
+   qkeyword.c \
qlist.c \
qlop.c \
qmerge.c \

diff --git a/Makefile.in b/Makefile.in
index b211bdd..6af9c8a 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -246,8 +246,8 @@ CONFIG_CLEAN_VPATH_FILES =
 am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"
 PROGRAMS = $(bin_PROGRAMS)
 am_q_OBJECTS = q-main.$(OBJEXT) q-q.$(OBJEXT) q-qatom.$(OBJEXT) \
-   q-qcache.$(OBJEXT) q-qcheck.$(OBJEXT) q-qdepends.$(OBJEXT) \
-   q-qfile.$(OBJEXT) q-qgrep.$(OBJEXT) q-qlist.$(OBJEXT) \
+   q-qcheck.$(OBJEXT) q-qdepends.$(OBJEXT) q-qfile.$(OBJEXT) \
+   q-qgrep.$(OBJEXT) q-qkeyword.$(OBJEXT) q-qlist.$(OBJEXT) \
q-qlop.$(OBJEXT) q-qmerge.$(OBJEXT) q-qpkg.$(OBJEXT) \
q-qsearch.$(OBJEXT) q-qsize.$(OBJEXT) q-qtbz2.$(OBJEXT) \
q-qtegrity.$(OBJEXT) q-quse.$(OBJEXT) q-qxpak.$(OBJEXT)
@@ -1550,11 +1550,11 @@ SUBDIRS = \
 APPLETS = \
q \
qatom \
-   qcache \
qcheck \
qdepends \
qfile \
qgrep \
+   qkeyword \
qlist \
qlop \
qmerge \
@@ -1570,11 +1570,11 @@ APPLETS = \
 dist_man_MANS = \
man/q.1 \
man/qatom.1 \
-   man/qcache.1 \
man/qcheck.1 \
man/qdepends.1 \
man/qfile.1 \
man/qgrep.1 \
+   man/qkeyword.1 \
man/qlist.1 \
man/qlop.1 \
man/qmerge.1 \
@@ -1591,11 +1591,11 @@ q_SOURCES = \
main.c \
q.c \
qatom.c \
-   qcache.c \
qcheck.c \
qdepends.c \
qfile.c \
qgrep.c \
+   qkeyword.c \
qlist.c \
qlop.c \
qmerge.c \
@@ -1744,11 +1744,11 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/q-main.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/q-q.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/q-qatom.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/q-qcache.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/q-qcheck.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/q-qdepends.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/q-qfile.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/q-qgrep.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/q-qkeyword.Po@am__quote@
 @

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

2019-05-03 Thread Fabian Groffen
commit: 47c13a275a7b76d77e5ac3e3ada5024bfc5372bd
Author: Fabian Groffen  gentoo  org>
AuthorDate: Fri May  3 08:47:26 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Fri May  3 08:47:26 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=47c13a27

quse: make -v output faster, format and introduce --repo

- improve performance for -v output (listing all use-flags with
  descriptions per package match)
- add -R/--repo flag to print repository next to atom
- align USE-flags in -v mode per package

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

 TODO.md|   1 -
 man/quse.1 |   3 ++
 quse.c | 171 +
 3 files changed, 131 insertions(+), 44 deletions(-)

diff --git a/TODO.md b/TODO.md
index 349170f..b70dffc 100644
--- a/TODO.md
+++ b/TODO.md
@@ -88,5 +88,4 @@
   package X
 
 # quse
-- make -v faster by calling searcg funcs once per package match
 - make -v only print requested USE-flag when flags given

diff --git a/man/quse.1 b/man/quse.1
index 6f0d8d3..ef17c10 100644
--- a/man/quse.1
+++ b/man/quse.1
@@ -25,6 +25,9 @@ Describe the USE flag.
 \fB\-p\fR \fI\fR, \fB\-\-package\fR \fI\fR
 Restrict matching to package or category.
 .TP
+\fB\-R\fR, \fB\-\-repo\fR
+Show repository the ebuild originates from.
+.TP
 \fB\-\-root\fR \fI\fR
 Set the ROOT env var.
 .TP

diff --git a/quse.c b/quse.c
index fbf61cf..604efdf 100644
--- a/quse.c
+++ b/quse.c
@@ -26,13 +26,14 @@
 #include "xarray.h"
 #include "xregex.h"
 
-#define QUSE_FLAGS "eaLDp:" COMMON_FLAGS
+#define QUSE_FLAGS "eaLDp: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'},
{"package",a_argument, NULL, 'p'},
+   {"repo",  no_argument, NULL, 'R'},
COMMON_LONG_OPTS
 };
 static const char * const quse_opts_help[] = {
@@ -41,6 +42,7 @@ static const char * const quse_opts_help[] = {
"Use the LICENSE vs IUSE",
"Describe the USE flag",
"Restrict matching to package or category",
+   "Show repository the ebuild originates from",
COMMON_OPTS_HELP
 };
 #define quse_usage(ret) usage(ret, QUSE_FLAGS, quse_long_opts, quse_opts_help, 
NULL, lookup_applet_idx("quse"))
@@ -48,12 +50,14 @@ static const char * const quse_opts_help[] = {
 struct quse_state {
int argc;
char **argv;
+   char **retv;
const char *overlay;
bool do_all:1;
bool do_regex:1;
bool do_describe:1;
bool do_licence:1;
bool do_list:1;
+   bool do_repo:1;
depend_atom *match;
regex_t *pregv;
 };
@@ -110,6 +114,9 @@ quse_search_use_local_desc(int portdirfd, struct quse_state 
*state)
 
match = false;
for (i = 0; i < state->argc; i++) {
+   if (state->do_list && state->retv[i] != NULL)
+   continue;
+
if (state->do_regex) {
if (regexec(&state->pregv[i], p, 0, NULL, 0) != 
0)
continue;
@@ -128,13 +135,14 @@ quse_search_use_local_desc(int portdirfd, struct 
quse_state *state)
if (state->match == NULL ||
atom_compare(atom, state->match) == 
EQUAL)
{
-   if (state->do_list)
-   printf("  %s%s%s  %s\n", MAGENTA, p, 
NORM, q);
-   else
+   if (state->do_list) {
+   state->retv[i] = xstrdup(q);
+   } else {
printf("%s%s/%s%s%s[%s%s%s] %s\n",
BOLD, atom->CATEGORY,
BLUE, atom->PN, NORM,
MAGENTA, p, NORM, q);
+   }
}
 
atom_implode(atom);
@@ -142,6 +150,16 @@ quse_search_use_local_desc(int portdirfd, struct 
quse_state *state)
}
} while (1);
 
+   if (state->do_list && ret) {
+   /* check if all requested flags are retrieved */
+   ret = true;
+   for (i = 0; i < state->argc; i++)
+   if (state->retv[i] == NULL)
+   break;
+   if (i < state->argc)
+   ret = false;
+   }
+
fclose(f);
return ret;
 }
@@ -186,6 +204,9 @@ quse_search_use_desc(int portdirfd, struct quse_state 
*state)
 
match = false;
for (i = 0; i < state->a

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

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

man/mkman: don't use yaml.load(), bug #659348

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

 man/mkman.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/man/mkman.py b/man/mkman.py
index 8c7fc9d..ff11e0b 100755
--- a/man/mkman.py
+++ b/man/mkman.py
@@ -84,7 +84,7 @@ def MkMan(applets, applet, output):
 desc_file = os.path.join(FRAGS_DIR, '%s.optdesc.yaml' % applet)
 if os.path.exists(desc_file):
 with open(desc_file) as fh:
-optdescs = yaml.load(fh)
+optdescs = yaml.safe_load(fh)
 
 # Extract all the options
 options = []



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

2019-05-20 Thread Fabian Groffen
commit: 861d52c3d5fe82d4ca07ba7159f3232c215af28e
Author: Fabian Groffen  gentoo  org>
AuthorDate: Mon May 20 08:40:58 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Mon May 20 08:43:57 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=861d52c3

q: remove -M (modpath) option

modpath is never used in the code, remove its option

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

 applets.h | 1 -
 main.c| 1 -
 man/q.1   | 3 ---
 q.c   | 5 +
 4 files changed, 1 insertion(+), 9 deletions(-)

diff --git a/applets.h b/applets.h
index 8cb537a..f183dca 100644
--- a/applets.h
+++ b/applets.h
@@ -137,7 +137,6 @@ static const struct applet_t {
case 'C': no_colors(); break; \
default: applet ## _usage(EXIT_FAILURE); break;
 
-extern char *modpath;
 extern char *portroot;
 extern int verbose;
 extern int quiet;

diff --git a/main.c b/main.c
index 944950e..bf86c49 100644
--- a/main.c
+++ b/main.c
@@ -24,7 +24,6 @@
 
 /* variables to control runtime behavior */
 char *module_name = NULL;
-char *modpath = NULL;
 int verbose = 0;
 int quiet = 0;
 char pretend = 0;

diff --git a/man/q.1 b/man/q.1
index 92794a2..4d0b352 100644
--- a/man/q.1
+++ b/man/q.1
@@ -19,9 +19,6 @@ no longer necessary to initialise the cache at any time.
 \fB\-i\fR, \fB\-\-install\fR
 Install symlinks for applets.
 .TP
-\fB\-M\fR \fI\fR, \fB\-\-modpath\fR \fI\fR
-Module path.
-.TP
 \fB\-\-root\fR \fI\fR
 Set the ROOT env var.
 .TP

diff --git a/q.c b/q.c
index b6486ee..6307658 100644
--- a/q.c
+++ b/q.c
@@ -21,15 +21,13 @@
 
 #include "basename.h"
 
-#define Q_FLAGS "iM:" COMMON_FLAGS
+#define Q_FLAGS "i" COMMON_FLAGS
 static struct option const q_long_opts[] = {
{"install",   no_argument, NULL, 'i'},
-   {"modpath",a_argument, NULL, 'M'},
COMMON_LONG_OPTS
 };
 static const char * const q_opts_help[] = {
"Install symlinks for applets",
-   "Module path",
COMMON_OPTS_HELP
 };
 #define q_usage(ret) usage(ret, Q_FLAGS, q_long_opts, q_opts_help, NULL, 
lookup_applet_idx("q"))
@@ -95,7 +93,6 @@ int q_main(int argc, char **argv)
while ((i = GETOPT_LONG(Q, q, "+")) != -1) {
switch (i) {
COMMON_GETOPTS_CASES(q)
-   case 'M': modpath = optarg; break;
case 'i': install = 1; break;
}
}



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

2019-06-21 Thread Fabian Groffen
commit: 2fd5a0ccc059a64a25aa292b7899af9e3ccf94f0
Author: Fabian Groffen  gentoo  org>
AuthorDate: Fri Jun 21 18:23:31 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Fri Jun 21 18:23:31 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=2fd5a0cc

qgrep: fix command descriptions

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

 man/qgrep.1 | 32 
 qgrep.c |  1 -
 2 files changed, 16 insertions(+), 17 deletions(-)

diff --git a/man/qgrep.1 b/man/qgrep.1
index 6701061..fbde702 100644
--- a/man/qgrep.1
+++ b/man/qgrep.1
@@ -24,43 +24,43 @@ Ignore case distinctions.
 Print the filename for each match.
 .TP
 \fB\-c\fR, \fB\-\-count\fR
-Print the package or eclass name for each match.
+Only print a count of matching lines per FILE.
 .TP
 \fB\-l\fR, \fB\-\-list\fR
-Only print a count of matching lines per FILE.
+Only print FILE names containing matches.
 .TP
 \fB\-L\fR, \fB\-\-invert\-list\fR
-Only print FILE names containing matches.
+Only print FILE names containing no match.
 .TP
 \fB\-e\fR, \fB\-\-regexp\fR
-Only print FILE names containing no match.
+Use PATTERN as a regular expression.
 .TP
 \fB\-x\fR, \fB\-\-extended\fR
-Use PATTERN as a regular expression.
+Use PATTERN as an extended regular expression.
 .TP
 \fB\-J\fR, \fB\-\-installed\fR
-Use PATTERN as an extended regular expression.
+Search in installed ebuilds instead of the tree.
 .TP
 \fB\-E\fR, \fB\-\-eclass\fR
-Search in installed ebuilds instead of the tree.
+Search in eclasses instead of ebuilds.
 .TP
 \fB\-s\fR, \fB\-\-skip\-comments\fR
-Search in eclasses instead of ebuilds.
+Skip comments lines.
 .TP
 \fB\-R\fR, \fB\-\-repo\fR
-Skip comments lines.
+Print source repository name for each match (implies -N).
 .TP
 \fB\-S\fR \fI\fR, \fB\-\-skip\fR \fI\fR
-Print source repository name for each match (implies -N).
+Skip lines matching .
 .TP
 \fB\-B\fR \fI\fR, \fB\-\-before\fR \fI\fR
-Skip lines matching .
+Print  lines of leading context.
 .TP
 \fB\-A\fR \fI\fR, \fB\-\-after\fR \fI\fR
-Print  lines of leading context.
+Print  lines of trailing context.
 .TP
 \fB\-\-root\fR \fI\fR
-Print  lines of trailing context.
+Set the ROOT env var.
 .TP
 \fB\-v\fR, \fB\-\-verbose\fR
 Prefix each matching line with filename (like \fB-H\fR).  When this
@@ -70,13 +70,13 @@ option is given multiple times, also linenumbers are 
printed.
 Do not prefix each match with filename.
 .TP
 \fB\-C\fR, \fB\-\-nocolor\fR
-Tighter output; suppress warnings.
+Don't output color.
 .TP
 \fB\-h\fR, \fB\-\-help\fR
-Don't output color.
+Print this help and exit.
 .TP
 \fB\-V\fR, \fB\-\-version\fR
-Print this help and exit.
+Print version and exit.
 
 .SH "REPORTING BUGS"
 Please report bugs via http://bugs.gentoo.org/

diff --git a/qgrep.c b/qgrep.c
index 003ead2..1f6d0de 100644
--- a/qgrep.c
+++ b/qgrep.c
@@ -47,7 +47,6 @@ static const char * const qgrep_opts_help[] = {
"Select non-matching lines",
"Ignore case distinctions",
"Print the filename for each match",
-   "Print the package or eclass name for each match",
"Only print a count of matching lines per FILE",
"Only print FILE names containing matches",
"Only print FILE names containing no match",



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

2019-04-25 Thread Fabian Groffen
commit: 13b7387c9288363eeb9dfbc397a2e3859eccbee7
Author: Fabian Groffen  gentoo  org>
AuthorDate: Thu Apr 25 09:18:29 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Thu Apr 25 09:18:29 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=13b7387c

man/mkman: fix authors showing up on random pages

dropped multiprocessing crap as it complicates and doesn't really speed
up anything (I suspected it to be faulty at first, but left it out)

the real issue was COMMON_AUTHORS not being copied, therefore any temp
additions were done to the common authors list

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

 man/mkman.py | 19 +--
 1 file changed, 5 insertions(+), 14 deletions(-)

diff --git a/man/mkman.py b/man/mkman.py
index f578305..8c7fc9d 100755
--- a/man/mkman.py
+++ b/man/mkman.py
@@ -9,7 +9,6 @@ import datetime
 import functools
 import glob
 import locale
-import multiprocessing
 import os
 import re
 import subprocess
@@ -71,7 +70,7 @@ def MkMan(applets, applet, output):
 usage = m.group(1)
 short_desc = m.group(2)
 
-authors = COMMON_AUTHORS
+authors = COMMON_AUTHORS[:]
 see_also = sorted(['.BR %s (1)' % x for x in applets if x != applet])
 
 description = ''
@@ -139,7 +138,7 @@ 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:
-if "-authors." in frag:
+if frag.endswith('-authors.include'):
 authors += [x.rstrip() for x in f.readlines()]
 else:
 extra_sections += [x.rstrip() for x in f.readlines()]
@@ -159,13 +158,6 @@ def MkMan(applets, applet, output):
 with open(output, 'w') as f:
 f.write(TEMPLATE % data)
 
-
-def _MkMan(applets, applet):
-"""Trampoline to MkMan for multiprocessing pickle"""
-output = os.path.join(MKMAN_DIR, '%s.1' % applet)
-MkMan(applets, applet, output)
-
-
 def main(argv):
 os.environ['NOCOLOR'] = '1'
 
@@ -174,10 +166,9 @@ def main(argv):
 # Support file completion like "qfile.1" or "./qdepends.1"
 applets = [os.path.basename(x).split('.', 1)[0] for x in argv]
 
-p = multiprocessing.Pool()
-functor = functools.partial(_MkMan, applets)
-p.map(functor, applets)
-
+for applet in applets:
+output = os.path.join(MKMAN_DIR, '%s.1' % applet)
+MkMan(applets, applet, output)
 
 if __name__ == '__main__':
 sys.exit(main(sys.argv[1:]))



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

2019-04-25 Thread Fabian Groffen
commit: 9122b278974bc7e4705f1a8db1cc16618be2bce2
Author: Fabian Groffen  gentoo  org>
AuthorDate: Thu Apr 25 09:20:19 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Thu Apr 25 09:20:19 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=9122b278

man: regenerate

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

 man/q.1|  8 +---
 man/qcache.1   |  2 +-
 man/qcheck.1   |  2 +-
 man/qfile.1|  2 +-
 man/qgrep.1|  2 +-
 man/qlop.1 |  2 +-
 man/qmerge.1   |  2 +-
 man/qpkg.1 |  3 +--
 man/qsearch.1  | 16 ++--
 man/qsize.1|  2 +-
 man/qtbz2.1|  2 +-
 man/qtegrity.1 |  2 +-
 man/quse.1 |  3 +--
 man/qxpak.1|  3 +--
 14 files changed, 19 insertions(+), 32 deletions(-)

diff --git a/man/q.1 b/man/q.1
index c9867c6..b3e985b 100644
--- a/man/q.1
+++ b/man/q.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH q "1" "Feb 2019" "Gentoo Foundation" "q"
+.TH q "1" "Apr 2019" "Gentoo Foundation" "q"
 .SH NAME
 q \- invoke a portage utility applet
 .SH SYNOPSIS
@@ -12,12 +12,6 @@ q \- invoke a portage utility applet
 \fB\-i\fR, \fB\-\-install\fR
 Install symlinks for applets.
 .TP
-\fB\-r\fR \fI[arg]\fR, \fB\-\-reinitialize\fR \fI[arg]\fR
-Reinitialize ebuild cache.
-.TP
-\fB\-m\fR \fI[arg]\fR, \fB\-\-metacache\fR \fI[arg]\fR
-Reinitialize metadata cache.
-.TP
 \fB\-M\fR \fI\fR, \fB\-\-modpath\fR \fI\fR
 Module path.
 .TP

diff --git a/man/qcache.1 b/man/qcache.1
index a94e5dd..675059e 100644
--- a/man/qcache.1
+++ b/man/qcache.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qcache "1" "Feb 2019" "Gentoo Foundation" "qcache"
+.TH qcache "1" "Apr 2019" "Gentoo Foundation" "qcache"
 .SH NAME
 qcache \- search the metadata cache
 .SH SYNOPSIS

diff --git a/man/qcheck.1 b/man/qcheck.1
index f394418..c139744 100644
--- a/man/qcheck.1
+++ b/man/qcheck.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qcheck "1" "Feb 2019" "Gentoo Foundation" "qcheck"
+.TH qcheck "1" "Apr 2019" "Gentoo Foundation" "qcheck"
 .SH NAME
 qcheck \- verify integrity of installed packages
 .SH SYNOPSIS

diff --git a/man/qfile.1 b/man/qfile.1
index 6bf07c0..5cd297a 100644
--- a/man/qfile.1
+++ b/man/qfile.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qfile "1" "Feb 2019" "Gentoo Foundation" "qfile"
+.TH qfile "1" "Apr 2019" "Gentoo Foundation" "qfile"
 .SH NAME
 qfile \- list all pkgs owning files
 .SH SYNOPSIS

diff --git a/man/qgrep.1 b/man/qgrep.1
index f446c13..662122d 100644
--- a/man/qgrep.1
+++ b/man/qgrep.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qgrep "1" "Feb 2019" "Gentoo Foundation" "qgrep"
+.TH qgrep "1" "Apr 2019" "Gentoo Foundation" "qgrep"
 .SH NAME
 qgrep \- grep in ebuilds
 .SH SYNOPSIS

diff --git a/man/qlop.1 b/man/qlop.1
index f0ef69a..4dd31c1 100644
--- a/man/qlop.1
+++ b/man/qlop.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qlop "1" "Mar 2019" "Gentoo Foundation" "qlop"
+.TH qlop "1" "Apr 2019" "Gentoo Foundation" "qlop"
 .SH NAME
 qlop \- emerge log analyzer
 .SH SYNOPSIS

diff --git a/man/qmerge.1 b/man/qmerge.1
index 0391d5a..d303e45 100644
--- a/man/qmerge.1
+++ b/man/qmerge.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qmerge "1" "Feb 2019" "Gentoo Foundation" "qmerge"
+.TH qmerge "1" "Apr 2019" "Gentoo Foundation" "qmerge"
 .SH NAME
 qmerge \- fetch and merge binary package
 .SH SYNOPSIS

diff --git a/man/qpkg.1 b/man/qpkg.1
index c67b614..17278ec 100644
--- a/man/qpkg.1
+++ b/man/qpkg.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qpkg "1" "Feb 2019" "Gentoo Foundation" "qpkg"
+.TH qpkg "1" "Apr 2019" "Gentoo Foundation" "qpkg"
 .SH NAME
 qpkg \- manipulate Gentoo binpkgs
 .SH SYNOPSIS
@@ -51,7 +51,6 @@ Product: Portage Development; Component: Tools
 Ned Ludd 
 Mike Frysinger 
 Fabian Groffen 
-TGL 
 .fi
 .SH "SEE ALSO"
 .BR q (1),

diff --git a/man/qsearch.1 b/man/qsearch.1
index 04f7d41..1bea7ab 100644
--- a/man/qsearch.1
+++ b/man/qsearch.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qsearch "1" "Feb 2019" "Gentoo Foundation" "qsearch"
+.TH qsearch "1" "Apr 2019" "Gentoo Foundation" "qsearch"
 .SH NAME
 qsearch \- search pkgname/desc
 .SH SYNOPSIS
@@ -14,23 +14,20 @@ all ebuilds in the tree.
 \fB\-a\fR, \fB\-\-all\fR
 List the descriptions of every package in the cache.
 .TP
-\fB\-c\fR, \fB\-\-cache\fR
-Use the portage cache.
-.TP
-\fB\-e\fR, \fB\-\-ebuilds\fR
-Use the portage ebuild tree (default).
-.TP
 \fB\-s\fR, \fB\-\-search\fR
 Regex search package basenames.
 .TP
 \fB\-S\fR \fI\fR, \fB\-\-desc\fR \fI\fR
-Regex search package descriptions.
+Regex search package descriptions (or homepage when using -H).
 .TP
 \fB\-N\fR, \fB\-\-name\-only\fR
 Only show package name.
 .TP
 \fB\-H\fR, \fB\-\-homepage\fR
-Show homepage info.
+Show homepage info instead of description.
+.TP
+\fB\-R\fR, \fB\-\-repo\fR
+Sho

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

2019-04-28 Thread Fabian Groffen
commit: 92192efb2f621ad13a412d659bb682989a301acc
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sun Apr 28 08:50:43 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sun Apr 28 08:50:43 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=92192efb

qgrep: use colours for atom printing, and support -R/--repo

use same colour scheme as with qlist, qdepends, etc.
support printing repo for ebuilds mode

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

 man/qgrep.1 |  3 +++
 qgrep.c | 43 ++-
 2 files changed, 29 insertions(+), 17 deletions(-)

diff --git a/man/qgrep.1 b/man/qgrep.1
index 347c88c..34fe54d 100644
--- a/man/qgrep.1
+++ b/man/qgrep.1
@@ -50,6 +50,9 @@ Search in eclasses instead of ebuilds.
 \fB\-s\fR, \fB\-\-skip\-comments\fR
 Skip comments lines.
 .TP
+\fB\-R\fR, \fB\-\-repo\fR
+Print source repository name for each match (implies -N).
+.TP
 \fB\-S\fR \fI\fR, \fB\-\-skip\fR \fI\fR
 Skip lines matching .
 .TP

diff --git a/qgrep.c b/qgrep.c
index 3950c22..9d78c18 100644
--- a/qgrep.c
+++ b/qgrep.c
@@ -25,7 +25,7 @@
 #include "xchdir.h"
 #include "xregex.h"
 
-#define QGREP_FLAGS "IiHNclLexJEsS:B:A:" COMMON_FLAGS
+#define QGREP_FLAGS "IiHNclLexJEsRS:B:A:" COMMON_FLAGS
 static struct option const qgrep_long_opts[] = {
{"invert-match",  no_argument, NULL, 'I'},
{"ignore-case",   no_argument, NULL, 'i'},
@@ -39,6 +39,7 @@ static struct option const qgrep_long_opts[] = {
{"installed", no_argument, NULL, 'J'},
{"eclass",no_argument, NULL, 'E'},
{"skip-comments", no_argument, NULL, 's'},
+   {"repo",  no_argument, NULL, 'R'},
{"skip",   a_argument, NULL, 'S'},
{"before", a_argument, NULL, 'B'},
{"after",  a_argument, NULL, 'A'},
@@ -57,6 +58,7 @@ static const char * const qgrep_opts_help[] = {
"Search in installed ebuilds instead of the tree",
"Search in eclasses instead of ebuilds",
"Skip comments lines",
+   "Print source repository name for each match (implies -N)",
"Skip lines matching ",
"Print  lines of leading context",
"Print  lines of trailing context",
@@ -198,6 +200,7 @@ struct qgrep_grepargs {
bool do_list:1;
bool show_filename:1;
bool show_name:1;
+   bool show_repo:1;
bool skip_comments:1;
bool invert_list:1;
bool invert_match:1;
@@ -421,7 +424,10 @@ qgrep_cache_cb(cache_pkg_ctx *pkg_ctx, void *priv)
 
label = NULL;
if (data->show_name) {
-   snprintf(name, sizeof(name), "%s/%s", patom->CATEGORY, 
patom->P);
+   char *repo = data->show_repo ? cctx->repo : NULL;
+   snprintf(name, sizeof(name), "%s%s/%s%s%s%s%s%s",
+   BOLD, patom->CATEGORY, BLUE, patom->P, GREEN,
+   repo ? "::" : "", repo ? repo : "", NORM);
label = name;
} else if (data->show_filename) {
label = buf;
@@ -473,7 +479,8 @@ qgrep_vdb_cb(q_vdb_pkg_ctx *pkg_ctx, void *priv)
 
label = NULL;
if (data->show_name) {
-   snprintf(name, sizeof(name), "%s/%s", patom->CATEGORY, 
patom->P);
+   snprintf(name, sizeof(name), "%s%s/%s%s%s",
+   BOLD, patom->CATEGORY, BLUE, patom->P, NORM);
label = name;
} else if (data->show_filename) {
label = buf;
@@ -523,25 +530,26 @@ int qgrep_main(int argc, char **argv)
 
while ((i = GETOPT_LONG(QGREP, qgrep, "")) != -1) {
switch (i) {
-   case 'I': args.invert_match = 1; break;
+   case 'I': args.invert_match = true;   break;
case 'i':
args.strfunc = strcasestr;
reflags |= REG_ICASE;
break;
-   case 'c': args.do_count = 1; break;
-   case 'l': args.do_list = 1; break;
-   case 'L': args.do_list = args.invert_list = 1; break;
-   case 'e': args.do_regex = 1; break;
+   case 'c': args.do_count = true;   break;
+   case 'l': args.do_list = true;break;
+   case 'L': args.do_list = args.invert_list = true; break;
+   case 'e': args.do_regex = true;   break;
case 'x':
-   args.do_regex = 1;
+   args.do_regex = true;
reflags |= REG_EXTENDED;
break;
-   case 'J': do_installed = 1; break;
-   case 'E': do_eclass = 1; break;
-   case 'H': args.show_filename = 1; break;
-   case 'N': args.show_name = 1; break;
-   case 's': args.skip_comments = 1; break;
-   case 'S': args.skip_pattern = optarg;

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

2019-02-05 Thread Fabian Groffen
commit: 1502daae3a15488f1e9c7a6dffcfa3f2bd863a41
Author: Fabian Groffen  gentoo  org>
AuthorDate: Tue Feb  5 13:48:31 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Tue Feb  5 13:50:46 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=1502daae

man: regen

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

 man/q.1| 3 +--
 man/qatom.1| 2 +-
 man/qcache.1   | 2 +-
 man/qcheck.1   | 2 +-
 man/qfile.1| 2 +-
 man/qgrep.1| 2 +-
 man/qlist.1| 2 +-
 man/qlop.1 | 2 +-
 man/qmerge.1   | 2 +-
 man/qpkg.1 | 2 +-
 man/qsearch.1  | 2 +-
 man/qsize.1| 2 +-
 man/qtbz2.1| 2 +-
 man/qtegrity.1 | 2 +-
 man/quse.1 | 2 +-
 man/qxpak.1| 2 +-
 16 files changed, 16 insertions(+), 17 deletions(-)

diff --git a/man/q.1 b/man/q.1
index b88dd4c..a5eebb8 100644
--- a/man/q.1
+++ b/man/q.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH q "1" "May 2018" "Gentoo Foundation" "q"
+.TH q "1" "Feb 2019" "Gentoo Foundation" "q"
 .SH NAME
 q \- invoke a portage utility applet
 .SH SYNOPSIS
@@ -47,7 +47,6 @@ Print version and exit.
qcheck: verify integrity of installed packages
  qdepends: show dependency info
 qfile   : list all pkgs owning files
-qglsa   : check GLSAs against system
 qgrep  : grep in ebuilds
 qlist: list files owned by pkgname
  qlop: emerge log analyzer

diff --git a/man/qatom.1 b/man/qatom.1
index f1c985b..d83e6e1 100644
--- a/man/qatom.1
+++ b/man/qatom.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qatom "1" "May 2018" "Gentoo Foundation" "qatom"
+.TH qatom "1" "Feb 2019" "Gentoo Foundation" "qatom"
 .SH NAME
 qatom \- split atom strings
 .SH SYNOPSIS

diff --git a/man/qcache.1 b/man/qcache.1
index fd8a620..c5c80b8 100644
--- a/man/qcache.1
+++ b/man/qcache.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qcache "1" "May 2018" "Gentoo Foundation" "qcache"
+.TH qcache "1" "Feb 2019" "Gentoo Foundation" "qcache"
 .SH NAME
 qcache \- search the metadata cache
 .SH SYNOPSIS

diff --git a/man/qcheck.1 b/man/qcheck.1
index f6f1d26..ac93cbb 100644
--- a/man/qcheck.1
+++ b/man/qcheck.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qcheck "1" "May 2018" "Gentoo Foundation" "qcheck"
+.TH qcheck "1" "Feb 2019" "Gentoo Foundation" "qcheck"
 .SH NAME
 qcheck \- verify integrity of installed packages
 .SH SYNOPSIS

diff --git a/man/qfile.1 b/man/qfile.1
index 6916628..5b8411e 100644
--- a/man/qfile.1
+++ b/man/qfile.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qfile "1" "May 2018" "Gentoo Foundation" "qfile"
+.TH qfile "1" "Feb 2019" "Gentoo Foundation" "qfile"
 .SH NAME
 qfile \- list all pkgs owning files
 .SH SYNOPSIS

diff --git a/man/qgrep.1 b/man/qgrep.1
index 0cc0831..d062e99 100644
--- a/man/qgrep.1
+++ b/man/qgrep.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qgrep "1" "May 2018" "Gentoo Foundation" "qgrep"
+.TH qgrep "1" "Feb 2019" "Gentoo Foundation" "qgrep"
 .SH NAME
 qgrep \- grep in ebuilds
 .SH SYNOPSIS

diff --git a/man/qlist.1 b/man/qlist.1
index 96b201b..07275e5 100644
--- a/man/qlist.1
+++ b/man/qlist.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qlist "1" "May 2018" "Gentoo Foundation" "qlist"
+.TH qlist "1" "Feb 2019" "Gentoo Foundation" "qlist"
 .SH NAME
 qlist \- list files owned by pkgname
 .SH SYNOPSIS

diff --git a/man/qlop.1 b/man/qlop.1
index 8def1f2..bdfe3af 100644
--- a/man/qlop.1
+++ b/man/qlop.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qlop "1" "May 2018" "Gentoo Foundation" "qlop"
+.TH qlop "1" "Feb 2019" "Gentoo Foundation" "qlop"
 .SH NAME
 qlop \- emerge log analyzer
 .SH SYNOPSIS

diff --git a/man/qmerge.1 b/man/qmerge.1
index 56c79e9..da36e75 100644
--- a/man/qmerge.1
+++ b/man/qmerge.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qmerge "1" "May 2018" "Gentoo Foundation" "qmerge"
+.TH qmerge "1" "Feb 2019" "Gentoo Foundation" "qmerge"
 .SH NAME
 qmerge \- fetch and merge binary package
 .SH SYNOPSIS

diff --git a/man/qpkg.1 b/man/qpkg.1
index b5691b1..d6949df 100644
--- a/man/qpkg.1
+++ b/man/qpkg.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qpkg "1" "May 2018" "Gentoo Foundation" "qpkg"
+.TH qpkg "1" "Feb 2019" "Gentoo Foundation" "qpkg"
 .SH NAME
 qpkg \- manipulate Gentoo binpkgs
 .SH SYNOPSIS

diff --git a/man/qsearch.1 b/man/qsearch.1
index f3ae1f5..ffe47a1 100644
--- a/man/qsearch.1
+++ b/man/qsearch.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qsearch "1" "May 2018" "Gentoo Foundation" "qsearch"
+.TH qsearch "1" "Feb 2019" "Gentoo Foundation" "qsearch"
 .SH NAME
 qsearch \- search pkgname/desc
 .SH SYNOPSIS

diff --git a/man/qsize.1 b/man/qsize.1
index d2ea494..88bffe4 100644
--- a/man/qsize.1
+++ b/man/qsize.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do

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

2019-02-28 Thread Fabian Groffen
commit: 51d8de0e2c01a7f23d06eb2cda8599ccd0159938
Author: Fabian Groffen  gentoo  org>
AuthorDate: Thu Feb 28 09:38:45 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Thu Feb 28 09:38:45 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=51d8de0e

mkman: drop Assignee suggestion

Usage of a generic alias is no longer allowed (for reasons beyond my
understanding), and I don't want to put my own email here, so rely on
bugwranglers to make the bugs end up with some assignee.

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

 man/mkman.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/man/mkman.py b/man/mkman.py
index bd3111c..f578305 100755
--- a/man/mkman.py
+++ b/man/mkman.py
@@ -50,8 +50,7 @@ TEMPLATE = r""".\" generated by mkman.py, please do NOT edit!
 .SH "REPORTING BUGS"
 Please report bugs via http://bugs.gentoo.org/
 .br
-Product: Portage Development; Component: Tools, Assignee:
-portage-ut...@gentoo.org
+Product: Portage Development; Component: Tools
 .SH AUTHORS
 .nf
 %(authors)s



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

2019-02-28 Thread Fabian Groffen
commit: 3bc514d70090fab825e74eb4f8e28a858bd528ba
Author: Fabian Groffen  gentoo  org>
AuthorDate: Thu Feb 28 09:40:57 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Thu Feb 28 09:40:57 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=3bc514d7

man: regen after Assignee removal

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

 man/q.1| 3 +--
 man/qatom.1| 3 +--
 man/qcache.1   | 3 +--
 man/qcheck.1   | 3 +--
 man/qdepends.1 | 3 +--
 man/qfile.1| 3 +--
 man/qgrep.1| 3 +--
 man/qlist.1| 3 +--
 man/qlop.1 | 5 ++---
 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/qxpak.1| 3 +--
 17 files changed, 18 insertions(+), 35 deletions(-)

diff --git a/man/q.1 b/man/q.1
index a5eebb8..c9867c6 100644
--- a/man/q.1
+++ b/man/q.1
@@ -62,8 +62,7 @@ Print version and exit.
 .SH "REPORTING BUGS"
 Please report bugs via http://bugs.gentoo.org/
 .br
-Product: Portage Development; Component: Tools, Assignee:
-portage-ut...@gentoo.org
+Product: Portage Development; Component: Tools
 .SH AUTHORS
 .nf
 Ned Ludd 

diff --git a/man/qatom.1 b/man/qatom.1
index d83e6e1..4860957 100644
--- a/man/qatom.1
+++ b/man/qatom.1
@@ -88,8 +88,7 @@ Print version and exit.
 .SH "REPORTING BUGS"
 Please report bugs via http://bugs.gentoo.org/
 .br
-Product: Portage Development; Component: Tools, Assignee:
-portage-ut...@gentoo.org
+Product: Portage Development; Component: Tools
 .SH AUTHORS
 .nf
 Ned Ludd 

diff --git a/man/qcache.1 b/man/qcache.1
index c5c80b8..a94e5dd 100644
--- a/man/qcache.1
+++ b/man/qcache.1
@@ -54,8 +54,7 @@ Print version and exit.
 .SH "REPORTING BUGS"
 Please report bugs via http://bugs.gentoo.org/
 .br
-Product: Portage Development; Component: Tools, Assignee:
-portage-ut...@gentoo.org
+Product: Portage Development; Component: Tools
 .SH AUTHORS
 .nf
 Ned Ludd 

diff --git a/man/qcheck.1 b/man/qcheck.1
index ac93cbb..f394418 100644
--- a/man/qcheck.1
+++ b/man/qcheck.1
@@ -54,8 +54,7 @@ Print version and exit.
 .SH "REPORTING BUGS"
 Please report bugs via http://bugs.gentoo.org/
 .br
-Product: Portage Development; Component: Tools, Assignee:
-portage-ut...@gentoo.org
+Product: Portage Development; Component: Tools
 .SH AUTHORS
 .nf
 Ned Ludd 

diff --git a/man/qdepends.1 b/man/qdepends.1
index 0273999..f5c8c01 100644
--- a/man/qdepends.1
+++ b/man/qdepends.1
@@ -111,8 +111,7 @@ dependency is expressed.
 .SH "REPORTING BUGS"
 Please report bugs via http://bugs.gentoo.org/
 .br
-Product: Portage Development; Component: Tools, Assignee:
-portage-ut...@gentoo.org
+Product: Portage Development; Component: Tools
 .SH AUTHORS
 .nf
 Ned Ludd 

diff --git a/man/qfile.1 b/man/qfile.1
index 5b8411e..c7f7054 100644
--- a/man/qfile.1
+++ b/man/qfile.1
@@ -206,8 +206,7 @@ rm -rf "${tmpdir}"
 .SH "REPORTING BUGS"
 Please report bugs via http://bugs.gentoo.org/
 .br
-Product: Portage Development; Component: Tools, Assignee:
-portage-ut...@gentoo.org
+Product: Portage Development; Component: Tools
 .SH AUTHORS
 .nf
 Ned Ludd 

diff --git a/man/qgrep.1 b/man/qgrep.1
index d062e99..f446c13 100644
--- a/man/qgrep.1
+++ b/man/qgrep.1
@@ -79,8 +79,7 @@ Print version and exit.
 .SH "REPORTING BUGS"
 Please report bugs via http://bugs.gentoo.org/
 .br
-Product: Portage Development; Component: Tools, Assignee:
-portage-ut...@gentoo.org
+Product: Portage Development; Component: Tools
 .SH AUTHORS
 .nf
 Ned Ludd 

diff --git a/man/qlist.1 b/man/qlist.1
index 07275e5..c2c585c 100644
--- a/man/qlist.1
+++ b/man/qlist.1
@@ -77,8 +77,7 @@ Print version and exit.
 .SH "REPORTING BUGS"
 Please report bugs via http://bugs.gentoo.org/
 .br
-Product: Portage Development; Component: Tools, Assignee:
-portage-ut...@gentoo.org
+Product: Portage Development; Component: Tools
 .SH AUTHORS
 .nf
 Ned Ludd 

diff --git a/man/qlop.1 b/man/qlop.1
index 46a6f94..4769ecd 100644
--- a/man/qlop.1
+++ b/man/qlop.1
@@ -46,7 +46,7 @@ Calculate average merge, unmerge or sync time.  This is the 
average
 time for all occurrences found respecting any date limits.
 .TP
 \fB\-H\fR, \fB\-\-human\fR
-Print elaspsed time in human readable format.  This form uses
+Print elapssed time in human readable format.  This form uses
 minutes, hours and days instead of just seconds.
 .TP
 \fB\-m\fR, \fB\-\-merge\fR
@@ -119,8 +119,7 @@ Print version and exit.
 .SH "REPORTING BUGS"
 Please report bugs via http://bugs.gentoo.org/
 .br
-Product: Portage Development; Component: Tools, Assignee:
-portage-ut...@gentoo.org
+Product: Portage Development; Component: Tools
 .SH AUTHORS
 .nf
 Ned Ludd 

diff --git a/man/qmerge.1 b/man/qmerge.1
index da36e75..0391d5a 100644
--- a/man/qmerge.1
+++ b/man/qmerge.1
@@ -65,8 +65,7 @@ Print version and exit.
 .SH "REPORTING BUGS"
 Please report bugs via http://bugs.gentoo.org/
 .br
-Product: Portage Development; Component: Tools, Assignee:
-portage-ut.

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

2019-02-28 Thread Fabian Groffen
commit: 01d4f8ae5983bdab35c146fe6facef57cce6870e
Author: Fabian Groffen  gentoo  org>
AuthorDate: Thu Feb 28 18:48:55 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Thu Feb 28 18:48:55 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=01d4f8ae

man: regenerate qlop.1 after options change

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

 man/qlop.1 | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/man/qlop.1 b/man/qlop.1
index 4769ecd..407c9ea 100644
--- a/man/qlop.1
+++ b/man/qlop.1
@@ -49,6 +49,9 @@ time for all occurrences found respecting any date limits.
 Print elapssed time in human readable format.  This form uses
 minutes, hours and days instead of just seconds.
 .TP
+\fB\-M\fR, \fB\-\-machine\fR
+Print elapsed time as seconds with no formatting.
+.TP
 \fB\-m\fR, \fB\-\-merge\fR
 Show merge history.
 .TP



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

2019-02-28 Thread Fabian Groffen
commit: 951a8711a59b1a7d49125f5f5214ff1ae9e50074
Author: Fabian Groffen  gentoo  org>
AuthorDate: Thu Feb 28 19:27:12 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Thu Feb 28 19:27:12 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=951a8711

qfile: drop non-functional --exact option

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

 man/qfile.1 |  3 ---
 qfile.c | 11 ++-
 2 files changed, 2 insertions(+), 12 deletions(-)

diff --git a/man/qfile.1 b/man/qfile.1
index c7f7054..6bf07c0 100644
--- a/man/qfile.1
+++ b/man/qfile.1
@@ -27,9 +27,6 @@ List orphan files.
 \fB\-x\fR \fI\fR, \fB\-\-exclude\fR \fI\fR
 Don't look in package  (used with --orphans).
 .TP
-\fB\-e\fR, \fB\-\-exact\fR
-Exact match (used with --exclude).
-.TP
 \fB\-\-root\fR \fI\fR
 Set the ROOT env var.
 .TP

diff --git a/qfile.c b/qfile.c
index 285277b..6e1cb0a 100644
--- a/qfile.c
+++ b/qfile.c
@@ -8,14 +8,13 @@
 
 #ifdef APPLET_qfile
 
-#define QFILE_FLAGS "beoRx:S" COMMON_FLAGS
+#define QFILE_FLAGS "boRx:S" COMMON_FLAGS
 static struct option const qfile_long_opts[] = {
{"slots",   no_argument, NULL, 'S'},
{"root-prefix", no_argument, NULL, 'R'},
{"basename",no_argument, NULL, 'b'},
{"orphans", no_argument, NULL, 'o'},
{"exclude",  a_argument, NULL, 'x'},
-   {"exact",   no_argument, NULL, 'e'},
COMMON_LONG_OPTS
 };
 static const char * const qfile_opts_help[] = {
@@ -24,7 +23,6 @@ static const char * const qfile_opts_help[] = {
"Match any component of the path",
"List orphan files",
"Don't look in package  (used with --orphans)",
-   "Exact match (used with --exclude)",
COMMON_OPTS_HELP
 };
 #define qfile_usage(ret) usage(ret, QFILE_FLAGS, qfile_long_opts, 
qfile_opts_help, NULL, lookup_applet_idx("qfile"))
@@ -56,7 +54,6 @@ struct qfile_opt_state {
depend_atom *exclude_atom;
bool slotted;
bool basename;
-   bool exact;
bool orphans;
bool assume_root_prefix;
 };
@@ -224,7 +221,7 @@ static int qfile_cb(q_vdb_pkg_ctx *pkg_ctx, void *priv)
} else
slot[0] = '\0';
printf("%s%s/%s%s%s%s", BOLD, atom->CATEGORY, 
BLUE,
-   (state->exact ? pkg_ctx->name : 
atom->PN),
+   (verbose ? pkg_ctx->name : atom->PN),
slot, NORM);
if (quiet)
puts("");
@@ -402,7 +399,6 @@ int qfile_main(int argc, char **argv)
.buflen = _Q_PATH_MAX,
.slotted = false,
.basename = false,
-   .exact = false,
.orphans = false,
.assume_root_prefix = false,
};
@@ -414,7 +410,6 @@ int qfile_main(int argc, char **argv)
COMMON_GETOPTS_CASES(qfile)
case 'S': state.slotted = true; break;
case 'b': state.basename = true; break;
-   case 'e': state.exact = true; break;
case 'o': state.orphans = true; break;
case 'R': state.assume_root_prefix = true; break;
case 'x':
@@ -429,8 +424,6 @@ int qfile_main(int argc, char **argv)
break;
}
}
-   if (!state.exact && verbose)
-   state.exact = true;
if (argc == optind)
qfile_usage(EXIT_FAILURE);
 



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

2014-03-10 Thread Mike Frysinger
commit: 6bc6b925108cdfaed498ebf507ac592721b357b5
Author: Mike Frysinger  gentoo  org>
AuthorDate: Tue Mar 11 04:47:33 2014 +
Commit: Mike Frysinger  gentoo  org>
CommitDate: Tue Mar 11 04:47:33 2014 +
URL:
http://git.overlays.gentoo.org/gitweb/?p=proj/portage-utils.git;a=commit;h=6bc6b925

man: regenerate

---
 man/q.1|  5 -
 man/qatom.1|  5 -
 man/qcache.1   |  5 -
 man/qcheck.1   |  5 -
 man/qdepends.1 | 24 ++--
 man/qfile.1|  5 -
 man/qgrep.1|  5 -
 man/qlist.1| 13 -
 man/qlop.1 |  5 -
 man/qmerge.1   |  8 +++-
 man/qpkg.1 |  5 -
 man/qsearch.1  |  5 -
 man/qsize.1|  5 -
 man/qtbz2.1|  5 -
 man/quse.1 |  5 -
 man/qxpak.1|  5 -
 16 files changed, 89 insertions(+), 21 deletions(-)

diff --git a/man/q.1 b/man/q.1
index 59aa68d..322e1af 100644
--- a/man/q.1
+++ b/man/q.1
@@ -1,4 +1,4 @@
-.TH q "1" "Sep 2013" "Gentoo Foundation" "q"
+.TH q "1" "Mar 2014" "Gentoo Foundation" "q"
 .SH NAME
 q \- invoke a portage utility applet
 .SH SYNOPSIS
@@ -20,6 +20,9 @@ Reinitialize metadata cache
 \fB\-M\fR \fI\fR, \fB\-\-modpath\fR \fI\fR
 Module path
 .TP
+\fB\-\-root\fR \fI\fR
+Set the ROOT env var
+.TP
 \fB\-v\fR, \fB\-\-verbose\fR
 Make a lot of noise
 .TP

diff --git a/man/qatom.1 b/man/qatom.1
index 934546d..b4bc8ce 100644
--- a/man/qatom.1
+++ b/man/qatom.1
@@ -1,4 +1,4 @@
-.TH qatom "1" "Sep 2013" "Gentoo Foundation" "qatom"
+.TH qatom "1" "Mar 2014" "Gentoo Foundation" "qatom"
 .SH NAME
 qatom \- split atom strings
 .SH SYNOPSIS
@@ -11,6 +11,9 @@ qatom \- split atom strings
 \fB\-c\fR, \fB\-\-compare\fR
 Compare two atoms
 .TP
+\fB\-\-root\fR \fI\fR
+Set the ROOT env var
+.TP
 \fB\-v\fR, \fB\-\-verbose\fR
 Make a lot of noise
 .TP

diff --git a/man/qcache.1 b/man/qcache.1
index 549777d..1f46e4b 100644
--- a/man/qcache.1
+++ b/man/qcache.1
@@ -1,4 +1,4 @@
-.TH qcache "1" "Sep 2013" "Gentoo Foundation" "qcache"
+.TH qcache "1" "Mar 2014" "Gentoo Foundation" "qcache"
 .SH NAME
 qcache \- search the metadata cache
 .SH SYNOPSIS
@@ -32,6 +32,9 @@ list packages that have at least one version keyworded for on 
a given arch
 \fB\-n\fR, \fB\-\-not\fR
 list packages that aren't keyworded on a given arch.
 .TP
+\fB\-\-root\fR \fI\fR
+Set the ROOT env var
+.TP
 \fB\-v\fR, \fB\-\-verbose\fR
 Make a lot of noise
 .TP

diff --git a/man/qcheck.1 b/man/qcheck.1
index a830023..3633311 100644
--- a/man/qcheck.1
+++ b/man/qcheck.1
@@ -1,4 +1,4 @@
-.TH qcheck "1" "Sep 2013" "Gentoo Foundation" "qcheck"
+.TH qcheck "1" "Mar 2014" "Gentoo Foundation" "qcheck"
 .SH NAME
 qcheck \- verify integrity of installed packages
 .SH SYNOPSIS
@@ -38,6 +38,9 @@ Ignore files in CONFIG_PROTECT-ed paths
 \fB\-p\fR, \fB\-\-prelink\fR
 Undo prelink when calculating checksums
 .TP
+\fB\-\-root\fR \fI\fR
+Set the ROOT env var
+.TP
 \fB\-v\fR, \fB\-\-verbose\fR
 Make a lot of noise
 .TP

diff --git a/man/qdepends.1 b/man/qdepends.1
index 2014c3f..3b316a0 100644
--- a/man/qdepends.1
+++ b/man/qdepends.1
@@ -1,4 +1,4 @@
-.TH qdepends "1" "Sep 2013" "Gentoo Foundation" "qdepends"
+.TH qdepends "1" "Mar 2014" "Gentoo Foundation" "qdepends"
 .SH NAME
 qdepends \- show dependency info
 .SH SYNOPSIS
@@ -13,6 +13,9 @@ By default, it will tell you the build time dependencies only 
(DEPEND).
 
 Currently, qdepends will only query installed packages.  There is no support 
for
 querying packages not yet installed (the \fBequery\fR(1) tool can do that).
+
+If there is no answer to your query (i.e. you've asked for a package that is 
not
+installed, or a version that does not match), then you will get back no output.
 .SH OPTIONS
 .TP
 \fB\-d\fR, \fB\-\-depend\fR
@@ -39,6 +42,9 @@ Show all DEPEND info
 \fB\-f\fR, \fB\-\-format\fR
 Pretty format specified depend strings
 .TP
+\fB\-\-root\fR \fI\fR
+Set the ROOT env var
+.TP
 \fB\-v\fR, \fB\-\-verbose\fR
 Make a lot of noise
 .TP
@@ -71,4 +77,18 @@ Ned Ludd 
 Mike Frysinger 
 .fi
 .SH "SEE ALSO"
-
+.BR q (1),
+.BR qatom (1),
+.BR qcache (1),
+.BR qcheck (1),
+.BR qfile (1),
+.BR qgrep (1),
+.BR qlist (1),
+.BR qlop (1),
+.BR qmerge (1),
+.BR qpkg (1),
+.BR qsearch (1),
+.BR qsize (1),
+.BR qtbz2 (1),
+.BR quse (1),
+.BR qxpak (1)

diff --git a/man/qfile.1 b/man/qfile.1
index a651a95..83dacfb 100644
--- a/man/qfile.1
+++ b/man/qfile.1
@@ -1,4 +1,4 @@
-.TH qfile "1" "Sep 2013" "Gentoo Foundation" "qfile"
+.TH qfile "1" "Mar 2014" "Gentoo Foundation" "qfile"
 .SH NAME
 qfile \- list all pkgs owning files
 .SH SYNOPSIS
@@ -32,6 +32,9 @@ Don't look in package  (used with --orphans)
 \fB\-e\fR, \fB\-\-exact\fR
 Exact match (used with --exclude)
 .TP
+\fB\-\-root\fR \fI\fR
+Set the ROOT env var
+.TP
 \fB\-v\fR, \fB\-\-verbose\fR
 Make a lot of noise
 .TP

diff --git a/man/qgrep.1 b/man/qgrep.1
index 6858b70..1ff4797 100644
--- a/man/qgrep.1
+++ b/man/qgrep.1
@@ -1,4 +1,4 @@
-.TH qgrep "1" "Sep 2013" "Gentoo Foundation" "qgrep"
+.TH qgrep "1" "Mar 2014" "Gentoo Foun

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

2016-03-27 Thread Mike Frysinger
commit: f27b1c430a13ed45dba638f2390e6a22f7199f8f
Author: Mike Frysinger  gentoo  org>
AuthorDate: Sun Mar 27 16:42:58 2016 +
Commit: Mike Frysinger  gentoo  org>
CommitDate: Sun Mar 27 16:42:58 2016 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=f27b1c43

usage: handle optional args, and auto-align display

Since --help is not performance sensitive, add a bit of logic to auto
align the width of the help columns.

 main.c   | 24 
 man/mkman.py |  4 ++--
 2 files changed, 22 insertions(+), 6 deletions(-)

diff --git a/main.c b/main.c
index d366bef..e9bacda 100644
--- a/main.c
+++ b/main.c
@@ -117,7 +117,11 @@ void no_colors(void)
 static void usage(int status, const char *flags, struct option const opts[],
   const char * const help[], int blabber)
 {
-   unsigned long i;
+   const char opt_arg[] = "[arg]";
+   const char a_arg[] = "";
+   size_t a_arg_len = strlen(a_arg) + 1;
+   size_t i, optlen;
+
if (status != EXIT_SUCCESS)
dup2(STDERR_FILENO, STDOUT_FILENO);
if (blabber == 0) {
@@ -140,6 +144,15 @@ static void usage(int status, const char *flags, struct 
option const opts[],
if (module_name != NULL)
printf("%sLoaded module:%s\n%s%8s%s %s%s\n", GREEN, NORM, 
YELLOW, module_name, NORM, DKBLUE, NORM);
 
+   /* Prescan the --long opt length to auto-align. */
+   optlen = 0;
+   for (i = 0; opts[i].name; ++i) {
+   size_t l = strlen(opts[i].name);
+   if (opts[i].has_arg != no_argument)
+   l += a_arg_len;
+   optlen = MAX(l, optlen);
+   }
+
printf("\n%sOptions:%s -[%s]\n", GREEN, NORM, flags);
for (i = 0; opts[i].name; ++i) {
/* this assert is a life saver when adding new applets. */
@@ -153,11 +166,14 @@ static void usage(int status, const char *flags, struct 
option const opts[],
 
/* then the long flag + help text */
if (opts[i].has_arg == no_argument)
-   printf("--%-15s%s*%s %s\n", opts[i].name,
+   printf("--%-*s %s*%s %s\n", (int)optlen, opts[i].name,
RED, NORM, _(help[i]));
else
-   printf("--%-8s %s%s %s*%s %s\n", opts[i].name,
-   DKBLUE, NORM, RED, NORM, _(help[i]));
+   printf("--%s %s%s%s%*s %s*%s %s\n",
+   opts[i].name,
+   DKBLUE, (opts[i].has_arg == a_argument ? a_arg 
: opt_arg), NORM,
+   (int)(optlen - strlen(opts[i].name) - 
a_arg_len), "",
+   RED, NORM, _(help[i]));
}
exit(status);
 }

diff --git a/man/mkman.py b/man/mkman.py
index 1ec8584..0751b92 100755
--- a/man/mkman.py
+++ b/man/mkman.py
@@ -89,8 +89,8 @@ def MkMan(applets, applet, output):
 flags += [option[0].rstrip(',')]
 option.pop(0)
 
-if option[0] == '':
-flags = [r'\fB%s\fR \fI\fR' % x for x in flags]
+if option[0] in ('', '[arg]'):
+flags = [r'\fB%s\fR \fI%s\fR' % (x, option[0]) for x in flags]
 option.pop(0)
 else:
 flags = [r'\fB%s\fR' % x for x in flags]



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

2016-03-27 Thread Mike Frysinger
commit: d81fc0710ae12ce026053163370ab3dac5c1b1a5
Author: Mike Frysinger  gentoo  org>
AuthorDate: Mon Mar 28 03:53:50 2016 +
Commit: Mike Frysinger  gentoo  org>
CommitDate: Mon Mar 28 03:53:50 2016 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=d81fc071

usage: add an extended text section

Many applets now are so complicated that a single line of text isn't
sufficient to describe all of its capabilities/nuances.  Allow them
to pass in an arbitrary string of data to contain examples.

 main.c | 13 -
 man/qatom.1|  4 ++--
 man/qcache.1   |  4 ++--
 man/qcheck.1   |  4 ++--
 man/qdepends.1 |  4 ++--
 man/qfile.1|  4 ++--
 man/qgrep.1|  4 ++--
 man/qlist.1|  4 ++--
 man/qlop.1 |  2 +-
 man/qmerge.1   |  4 ++--
 man/qpkg.1 |  4 ++--
 man/qsearch.1  |  4 ++--
 man/qsize.1|  4 ++--
 man/qtbz2.1|  4 ++--
 man/quse.1 |  4 ++--
 man/qxpak.1|  4 ++--
 q.c|  2 +-
 qatom.c|  2 +-
 qcache.c   |  2 +-
 qcheck.c   |  2 +-
 qdepends.c |  2 +-
 qfile.c|  2 +-
 qglsa.c|  2 +-
 qgrep.c|  2 +-
 qlist.c|  2 +-
 qlop.c |  9 -
 qmerge.c   |  2 +-
 qpkg.c |  2 +-
 qsearch.c  |  2 +-
 qsize.c|  2 +-
 qtbz2.c|  2 +-
 quse.c |  2 +-
 qxpak.c|  2 +-
 template.c |  2 +-
 34 files changed, 62 insertions(+), 52 deletions(-)

diff --git a/main.c b/main.c
index 0834756..a50b451 100644
--- a/main.c
+++ b/main.c
@@ -115,7 +115,7 @@ void no_colors(void)
 
 /* display usage and exit */
 static void usage(int status, const char *flags, struct option const opts[],
-  const char * const help[], int blabber)
+  const char * const help[], const char *desc, int blabber)
 {
const char opt_arg[] = "[arg]";
const char a_arg[] = "";
@@ -136,10 +136,13 @@ static void usage(int status, const char *flags, struct 
option const opts[],
DKBLUE, applets[i].opts, NORM,
RED, NORM, _(applets[i].desc));
} else if (blabber > 0) {
-   printf("%sUsage:%s %s%s%s  %s%s%s %s:%s %s\n", 
GREEN, NORM,
-   YELLOW, applets[blabber].name, NORM,
-   DKBLUE, applets[blabber].opts, NORM,
-   RED, NORM, _(applets[blabber].desc));
+   printf("%sUsage:%s %s%s%s [opts] %s%s%s %s:%s %s\n",
+   GREEN, NORM,
+   YELLOW, applets[blabber].name, NORM,
+   DKBLUE, applets[blabber].opts, NORM,
+   RED, NORM, _(applets[blabber].desc));
+   if (desc)
+   printf("\n%s\n", desc);
}
if (module_name != NULL)
printf("%sLoaded module:%s\n%s%8s%s %s%s\n", GREEN, NORM, 
YELLOW, module_name, NORM, DKBLUE, NORM);

diff --git a/man/qatom.1 b/man/qatom.1
index 42991a5..4a30343 100644
--- a/man/qatom.1
+++ b/man/qatom.1
@@ -1,9 +1,9 @@
-.TH qatom "1" "Feb 2016" "Gentoo Foundation" "qatom"
+.TH qatom "1" "Mar 2016" "Gentoo Foundation" "qatom"
 .SH NAME
 qatom \- split atom strings
 .SH SYNOPSIS
 .B qatom
-\fI \fR
+\fI[opts] \fR
 .SH DESCRIPTION
 
 .SH OPTIONS

diff --git a/man/qcache.1 b/man/qcache.1
index 1f46e4b..81ae2fa 100644
--- a/man/qcache.1
+++ b/man/qcache.1
@@ -1,9 +1,9 @@
-.TH qcache "1" "Mar 2014" "Gentoo Foundation" "qcache"
+.TH qcache "1" "Mar 2016" "Gentoo Foundation" "qcache"
 .SH NAME
 qcache \- search the metadata cache
 .SH SYNOPSIS
 .B qcache
-\fI  \fR
+\fI[opts]  \fR
 .SH DESCRIPTION
 
 .SH OPTIONS

diff --git a/man/qcheck.1 b/man/qcheck.1
index b686662..ed90c86 100644
--- a/man/qcheck.1
+++ b/man/qcheck.1
@@ -1,9 +1,9 @@
-.TH qcheck "1" "Feb 2016" "Gentoo Foundation" "qcheck"
+.TH qcheck "1" "Mar 2016" "Gentoo Foundation" "qcheck"
 .SH NAME
 qcheck \- verify integrity of installed packages
 .SH SYNOPSIS
 .B qcheck
-\fI \fR
+\fI[opts] \fR
 .SH DESCRIPTION
 
 .SH OPTIONS

diff --git a/man/qdepends.1 b/man/qdepends.1
index 3b316a0..a0cac5b 100644
--- a/man/qdepends.1
+++ b/man/qdepends.1
@@ -1,9 +1,9 @@
-.TH qdepends "1" "Mar 2014" "Gentoo Foundation" "qdepends"
+.TH qdepends "1" "Mar 2016" "Gentoo Foundation" "qdepends"
 .SH NAME
 qdepends \- show dependency info
 .SH SYNOPSIS
 .B qdepends
-\fI \fR
+\fI[opts] \fR
 .SH DESCRIPTION
 The qdepends applet has a couple different modes.  Normally it is geared 
towards
 answering the queries "what does package X depend on" and "what packages depend

diff --git a/man/qfile.1 b/man/qfile.1
index 54823cd..e57e8e3 100644
--- a/man/qfile.1
+++ b/man/qfile.1
@@ -1,9 +1,9 @@
-.TH qfile "1" "Feb 2016" "Gentoo Foundation" "qfile"
+.TH qfile "1" "Mar 2016" "Gentoo Foundation" "qfile"
 .SH NAME
 qfile \- list all pkgs owning files
 .SH SYNOPSIS
 .B qfile
-\fI \fR
+\fI[opts] \fR
 .SH DESCRIPTION
 
 .SH OPTIONS

diff --git a/man/qg

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

2016-02-22 Thread Mike Frysinger
commit: dcec34fcf04c0399efc466adf770d60dc145129f
Author: Mike Frysinger  gentoo  org>
AuthorDate: Mon Feb 22 17:49:25 2016 +
Commit: Mike Frysinger  gentoo  org>
CommitDate: Mon Feb 22 17:49:25 2016 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=dcec34fc

qsize: change interface to operate on atoms

We also drop the --all flag as it's now the default behavior.
If no atoms are specified, we just check everything.

 man/qsize.1 |  5 +
 qsize.c | 49 -
 2 files changed, 33 insertions(+), 21 deletions(-)

diff --git a/man/qsize.1 b/man/qsize.1
index ca6a352..af32869 100644
--- a/man/qsize.1
+++ b/man/qsize.1
@@ -1,4 +1,4 @@
-.TH qsize "1" "Mar 2014" "Gentoo Foundation" "qsize"
+.TH qsize "1" "Feb 2016" "Gentoo Foundation" "qsize"
 .SH NAME
 qsize \- calculate size usage
 .SH SYNOPSIS
@@ -11,9 +11,6 @@ qsize \- calculate size usage
 \fB\-f\fR, \fB\-\-filesystem\fR
 Show size used on disk
 .TP
-\fB\-a\fR, \fB\-\-all\fR
-Size all installed packages
-.TP
 \fB\-s\fR, \fB\-\-sum\fR
 Include a summary
 .TP

diff --git a/qsize.c b/qsize.c
index 3a11842..7a40141 100644
--- a/qsize.c
+++ b/qsize.c
@@ -8,10 +8,9 @@
 
 #ifdef APPLET_qsize
 
-#define QSIZE_FLAGS "fasSmkbi:" COMMON_FLAGS
+#define QSIZE_FLAGS "fsSmkbi:" COMMON_FLAGS
 static struct option const qsize_long_opts[] = {
{"filesystem", no_argument, NULL, 'f'},
-   {"all",no_argument, NULL, 'a'},
{"sum",no_argument, NULL, 's'},
{"sum-only",   no_argument, NULL, 'S'},
{"megabytes",  no_argument, NULL, 'm'},
@@ -22,7 +21,6 @@ static struct option const qsize_long_opts[] = {
 };
 static const char * const qsize_opts_help[] = {
"Show size used on disk",
-   "Size all installed packages",
"Include a summary",
"Show just the summary",
"Display size in megabytes",
@@ -39,7 +37,6 @@ int qsize_main(int argc, char **argv)
q_vdb_cat_ctx *cat_ctx;
q_vdb_pkg_ctx *pkg_ctx;
size_t i;
-   char search_all = 0;
struct stat st;
char fs_size = 0, summary = 0, summary_only = 0;
size_t num_all_files, num_all_nonfiles, num_all_ignored;
@@ -50,13 +47,14 @@ int qsize_main(int argc, char **argv)
size_t buflen;
char *buf;
char filename[_Q_PATH_MAX], *filename_root;
+   depend_atom *atom;
+   DECLARE_ARRAY(atoms);
DECLARE_ARRAY(ignore_regexp);
 
while ((i = GETOPT_LONG(QSIZE, qsize, "")) != -1) {
switch (i) {
COMMON_GETOPTS_CASES(qsize)
case 'f': fs_size = 1; break;
-   case 'a': search_all = 1; break;
case 's': summary = 1; break;
case 'S': summary = summary_only = 1; break;
case 'm': disp_units = MEGABYTE; str_disp_units = "MiB"; break;
@@ -70,8 +68,16 @@ int qsize_main(int argc, char **argv)
}
}
}
-   if ((argc == optind) && !search_all)
-   qsize_usage(EXIT_FAILURE);
+
+   argc -= optind;
+   argv += optind;
+   for (i = 0; i < argc; ++i) {
+   atom = atom_explode(argv[i]);
+   if (!atom)
+   warn("invalid atom: %s", argv[i]);
+   else
+   xarraypush_ptr(atoms, atom);
+   }
 
num_all_bytes = num_all_files = num_all_nonfiles = num_all_ignored = 0;
 
@@ -91,18 +97,24 @@ int qsize_main(int argc, char **argv)
while ((pkg_ctx = q_vdb_next_pkg(cat_ctx))) {
const char *pkgname = pkg_ctx->name;
FILE *fp;
+   bool showit = false;
+
/* see if this cat/pkg is requested */
-   if (!search_all) {
-   for (i = optind; i < argc; ++i) {
-   snprintf(buf, buflen, "%s/%s", catname, 
pkgname);
-   if (rematch(argv[i], buf, REG_EXTENDED) 
== 0)
+   if (array_cnt(atoms)) {
+   depend_atom *qatom;
+
+   snprintf(buf, buflen, "%s/%s", catname, 
pkgname);
+   qatom = atom_explode(buf);
+   array_for_each(atoms, i, atom)
+   if (atom_compare(atom, qatom) == EQUAL) 
{
+   showit = true;
break;
-   if (rematch(argv[i], pkgname, 
REG_EXTENDED) == 0)
-   break;
-   }
-   if (i == argc)
-   goto next_pkg;
-   }
+   }
+   atom_implode(qatom);
+  

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

2016-02-22 Thread Mike Frysinger
commit: 1dbce6aec3b91f9efb13df94c5a8e5c33ea65a4c
Author: Mike Frysinger  gentoo  org>
AuthorDate: Mon Feb 22 18:31:41 2016 +
Commit: Mike Frysinger  gentoo  org>
CommitDate: Mon Feb 22 18:31:41 2016 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=1dbce6ae

man: regen manpages

 man/qatom.1  | 5 -
 man/qfile.1  | 8 +---
 man/qlist.1  | 4 ++--
 man/qlop.1   | 4 ++--
 man/qmerge.1 | 5 +
 5 files changed, 10 insertions(+), 16 deletions(-)

diff --git a/man/qatom.1 b/man/qatom.1
index b4bc8ce..42991a5 100644
--- a/man/qatom.1
+++ b/man/qatom.1
@@ -1,4 +1,4 @@
-.TH qatom "1" "Mar 2014" "Gentoo Foundation" "qatom"
+.TH qatom "1" "Feb 2016" "Gentoo Foundation" "qatom"
 .SH NAME
 qatom \- split atom strings
 .SH SYNOPSIS
@@ -8,6 +8,9 @@ qatom \- split atom strings
 
 .SH OPTIONS
 .TP
+\fB\-F\fR \fI\fR, \fB\-\-format\fR \fI\fR
+Custom output format (default: %{CATEGORY} %{PN} %{PV} %[PR] %[SLOT] %[pfx] 
%[sfx])
+.TP
 \fB\-c\fR, \fB\-\-compare\fR
 Compare two atoms
 .TP

diff --git a/man/qfile.1 b/man/qfile.1
index 83dacfb..54823cd 100644
--- a/man/qfile.1
+++ b/man/qfile.1
@@ -1,4 +1,4 @@
-.TH qfile "1" "Mar 2014" "Gentoo Foundation" "qfile"
+.TH qfile "1" "Feb 2016" "Gentoo Foundation" "qfile"
 .SH NAME
 qfile \- list all pkgs owning files
 .SH SYNOPSIS
@@ -14,12 +14,6 @@ Display installed packages with slots
 \fB\-R\fR, \fB\-\-root\-prefix\fR
 Assume arguments are already prefixed by $ROOT
 .TP
-\fB\-f\fR \fI\fR, \fB\-\-from\fR \fI\fR
-Read arguments from file  ("-" for stdin)
-.TP
-\fB\-m\fR \fI\fR, \fB\-\-max\-args\fR \fI\fR
-Treat from file arguments by groups of  (defaults to 5000)
-.TP
 \fB\-b\fR, \fB\-\-basename\fR
 Match any component of the path
 .TP

diff --git a/man/qlist.1 b/man/qlist.1
index eee563d..eedc2cd 100644
--- a/man/qlist.1
+++ b/man/qlist.1
@@ -1,4 +1,4 @@
-.TH qlist "1" "Mar 2014" "Gentoo Foundation" "qlist"
+.TH qlist "1" "Feb 2016" "Gentoo Foundation" "qlist"
 .SH NAME
 qlist \- list files owned by pkgname
 .SH SYNOPSIS
@@ -12,7 +12,7 @@ qlist \- list files owned by pkgname
 Just show installed packages
 .TP
 \fB\-S\fR, \fB\-\-slots\fR
-Display installed packages with slots
+Display installed packages with slots (use twice for subslots)
 .TP
 \fB\-R\fR, \fB\-\-repo\fR
 Display installed packages with repository

diff --git a/man/qlop.1 b/man/qlop.1
index 26ef7b5..6e645a8 100644
--- a/man/qlop.1
+++ b/man/qlop.1
@@ -1,4 +1,4 @@
-.TH qlop "1" "Mar 2014" "Gentoo Foundation" "qlop"
+.TH qlop "1" "Feb 2016" "Gentoo Foundation" "qlop"
 .SH NAME
 qlop \- emerge log analyzer
 .SH SYNOPSIS
@@ -30,7 +30,7 @@ Show sync history
 Show current emerging packages
 .TP
 \fB\-f\fR \fI\fR, \fB\-\-logfile\fR \fI\fR
-Read emerge logfile instead of /var/log/emerge.log
+Read emerge logfile instead of $EMERGE_LOG_DIR/emerge.log
 .TP
 \fB\-\-root\fR \fI\fR
 Set the ROOT env var

diff --git a/man/qmerge.1 b/man/qmerge.1
index 558a810..df928f1 100644
--- a/man/qmerge.1
+++ b/man/qmerge.1
@@ -1,4 +1,4 @@
-.TH qmerge "1" "Mar 2014" "Gentoo Foundation" "qmerge"
+.TH qmerge "1" "Feb 2016" "Gentoo Foundation" "qmerge"
 .SH NAME
 qmerge \- fetch and merge binary package
 .SH SYNOPSIS
@@ -35,9 +35,6 @@ Don't prompt before overwriting
 \fB\-O\fR, \fB\-\-nodeps\fR
 Don't merge dependencies
 .TP
-\fB\-5\fR, \fB\-\-nomd5\fR
-Don't verify MD5 digest of files
-.TP
 \fB\-\-debug\fR
 Run shell funcs with `set -x`
 .TP



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

2016-02-04 Thread Mike Frysinger
commit: d63a4b1b586b4a1f5f6d841af582bb7fd1bcecff
Author: Mike Frysinger  gentoo  org>
AuthorDate: Thu Feb  4 17:56:41 2016 +
Commit: Mike Frysinger  gentoo  org>
CommitDate: Thu Feb  4 17:56:41 2016 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=d63a4b1b

man: get mkman.py working under py2 & py3

 man/mkman.py | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/man/mkman.py b/man/mkman.py
index cd0fa7a..1ec8584 100755
--- a/man/mkman.py
+++ b/man/mkman.py
@@ -1,4 +1,5 @@
 #!/usr/bin/python
+# -*- coding: utf-8 -*-
 
 """Generate man pages for the q applets"""
 
@@ -25,7 +26,7 @@ Q = os.path.join(TOPDIR, 'q')
 def FindApplets():
 """Return a list of all supported applets"""
 applets = os.path.join(TOPDIR, 'applets.sh')
-return subprocess.check_output([applets]).splitlines()
+return subprocess.check_output([applets]).decode('ascii').splitlines()
 
 
 COMMON_AUTHORS = [
@@ -61,7 +62,7 @@ def MkMan(applets, applet, output):
 
 # Extract the main use string and description:
 # Usage: q: invoke a portage utility applet
-ahelp = subprocess.check_output([Q, applet, '--help'])
+ahelp = subprocess.check_output([Q, applet, '--help']).decode('ascii')
 lines = ahelp.splitlines()
 m = re.search(r'^Usage: %s (.*) : (.*)' % applet, ahelp)
 usage = m.group(1)
@@ -77,7 +78,7 @@ def MkMan(applets, applet, output):
 
 # Extract all the options
 options = []
-for line, i in zip(lines, xrange(len(lines))):
+for line, i in zip(lines, range(len(lines))):
 if not line.startswith('Options: '):
 continue
 



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

2016-06-19 Thread Mike Frysinger
commit: 3040132ef330e83c1a04f05eda333c79ae4868a8
Author: Mike Frysinger  gentoo  org>
AuthorDate: Mon Jun 20 03:10:38 2016 +
Commit: Mike Frysinger  gentoo  org>
CommitDate: Mon Jun 20 03:10:38 2016 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=3040132e

man: drop qfile --from docs (part 2)

Have to regen the man page after updating its fragment.

 man/qfile.1 | 63 +
 1 file changed, 1 insertion(+), 62 deletions(-)

diff --git a/man/qfile.1 b/man/qfile.1
index e57e8e3..5bd58c7 100644
--- a/man/qfile.1
+++ b/man/qfile.1
@@ -1,4 +1,4 @@
-.TH qfile "1" "Mar 2016" "Gentoo Foundation" "qfile"
+.TH qfile "1" "Jun 2016" "Gentoo Foundation" "qfile"
 .SH NAME
 qfile \- list all pkgs owning files
 .SH SYNOPSIS
@@ -148,67 +148,6 @@ Sure, the same differences hold when querying for orphan 
files:
$ ROOT=/mnt qfile -Ro /mnt/bin/*
/mnt/bin/dostuff.sh
 .fi
-.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
 .SH "SEARCHING FOR FILE COLLISIONS"
 .PP
 A last option of \fBqfile\fP is \fB\-\-exclude\fP (\fB\-x\fP), which will makes



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

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

man/mkman: don't use yaml.load(), bug #659348

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

 man/mkman.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/man/mkman.py b/man/mkman.py
index 8c7fc9d..ff11e0b 100755
--- a/man/mkman.py
+++ b/man/mkman.py
@@ -84,7 +84,7 @@ def MkMan(applets, applet, output):
 desc_file = os.path.join(FRAGS_DIR, '%s.optdesc.yaml' % applet)
 if os.path.exists(desc_file):
 with open(desc_file) as fh:
-optdescs = yaml.load(fh)
+optdescs = yaml.safe_load(fh)
 
 # Extract all the options
 options = []



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

2019-06-12 Thread Fabian Groffen
commit: a7ff20f634939e5766cd962bb51234cd0644b5d1
Author: Fabian Groffen  gentoo  org>
AuthorDate: Wed Jun 12 09:07:28 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Wed Jun 12 09:07:28 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=a7ff20f6

man/mkman: skip generation for applets that aren't enabled

This just eases the situation with --disable-qmanifest.

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

 man/mkman.py | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/man/mkman.py b/man/mkman.py
index ff11e0b..a1b68a7 100755
--- a/man/mkman.py
+++ b/man/mkman.py
@@ -64,7 +64,10 @@ def MkMan(applets, applet, output):
 
 # Extract the main use string and description:
 # Usage: q: invoke a portage utility applet
-ahelp = subprocess.check_output([Q, applet, '--help']).decode('ascii')
+try:
+ahelp = subprocess.check_output([Q, applet, '--help']).decode('ascii')
+except:
+return
 lines = ahelp.splitlines()
 m = re.search(r'^Usage: %s (.*) : (.*)' % applet, ahelp)
 usage = m.group(1)



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

2019-04-28 Thread Fabian Groffen
commit: 92192efb2f621ad13a412d659bb682989a301acc
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sun Apr 28 08:50:43 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sun Apr 28 08:50:43 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=92192efb

qgrep: use colours for atom printing, and support -R/--repo

use same colour scheme as with qlist, qdepends, etc.
support printing repo for ebuilds mode

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

 man/qgrep.1 |  3 +++
 qgrep.c | 43 ++-
 2 files changed, 29 insertions(+), 17 deletions(-)

diff --git a/man/qgrep.1 b/man/qgrep.1
index 347c88c..34fe54d 100644
--- a/man/qgrep.1
+++ b/man/qgrep.1
@@ -50,6 +50,9 @@ Search in eclasses instead of ebuilds.
 \fB\-s\fR, \fB\-\-skip\-comments\fR
 Skip comments lines.
 .TP
+\fB\-R\fR, \fB\-\-repo\fR
+Print source repository name for each match (implies -N).
+.TP
 \fB\-S\fR \fI\fR, \fB\-\-skip\fR \fI\fR
 Skip lines matching .
 .TP

diff --git a/qgrep.c b/qgrep.c
index 3950c22..9d78c18 100644
--- a/qgrep.c
+++ b/qgrep.c
@@ -25,7 +25,7 @@
 #include "xchdir.h"
 #include "xregex.h"
 
-#define QGREP_FLAGS "IiHNclLexJEsS:B:A:" COMMON_FLAGS
+#define QGREP_FLAGS "IiHNclLexJEsRS:B:A:" COMMON_FLAGS
 static struct option const qgrep_long_opts[] = {
{"invert-match",  no_argument, NULL, 'I'},
{"ignore-case",   no_argument, NULL, 'i'},
@@ -39,6 +39,7 @@ static struct option const qgrep_long_opts[] = {
{"installed", no_argument, NULL, 'J'},
{"eclass",no_argument, NULL, 'E'},
{"skip-comments", no_argument, NULL, 's'},
+   {"repo",  no_argument, NULL, 'R'},
{"skip",   a_argument, NULL, 'S'},
{"before", a_argument, NULL, 'B'},
{"after",  a_argument, NULL, 'A'},
@@ -57,6 +58,7 @@ static const char * const qgrep_opts_help[] = {
"Search in installed ebuilds instead of the tree",
"Search in eclasses instead of ebuilds",
"Skip comments lines",
+   "Print source repository name for each match (implies -N)",
"Skip lines matching ",
"Print  lines of leading context",
"Print  lines of trailing context",
@@ -198,6 +200,7 @@ struct qgrep_grepargs {
bool do_list:1;
bool show_filename:1;
bool show_name:1;
+   bool show_repo:1;
bool skip_comments:1;
bool invert_list:1;
bool invert_match:1;
@@ -421,7 +424,10 @@ qgrep_cache_cb(cache_pkg_ctx *pkg_ctx, void *priv)
 
label = NULL;
if (data->show_name) {
-   snprintf(name, sizeof(name), "%s/%s", patom->CATEGORY, 
patom->P);
+   char *repo = data->show_repo ? cctx->repo : NULL;
+   snprintf(name, sizeof(name), "%s%s/%s%s%s%s%s%s",
+   BOLD, patom->CATEGORY, BLUE, patom->P, GREEN,
+   repo ? "::" : "", repo ? repo : "", NORM);
label = name;
} else if (data->show_filename) {
label = buf;
@@ -473,7 +479,8 @@ qgrep_vdb_cb(q_vdb_pkg_ctx *pkg_ctx, void *priv)
 
label = NULL;
if (data->show_name) {
-   snprintf(name, sizeof(name), "%s/%s", patom->CATEGORY, 
patom->P);
+   snprintf(name, sizeof(name), "%s%s/%s%s%s",
+   BOLD, patom->CATEGORY, BLUE, patom->P, NORM);
label = name;
} else if (data->show_filename) {
label = buf;
@@ -523,25 +530,26 @@ int qgrep_main(int argc, char **argv)
 
while ((i = GETOPT_LONG(QGREP, qgrep, "")) != -1) {
switch (i) {
-   case 'I': args.invert_match = 1; break;
+   case 'I': args.invert_match = true;   break;
case 'i':
args.strfunc = strcasestr;
reflags |= REG_ICASE;
break;
-   case 'c': args.do_count = 1; break;
-   case 'l': args.do_list = 1; break;
-   case 'L': args.do_list = args.invert_list = 1; break;
-   case 'e': args.do_regex = 1; break;
+   case 'c': args.do_count = true;   break;
+   case 'l': args.do_list = true;break;
+   case 'L': args.do_list = args.invert_list = true; break;
+   case 'e': args.do_regex = true;   break;
case 'x':
-   args.do_regex = 1;
+   args.do_regex = true;
reflags |= REG_EXTENDED;
break;
-   case 'J': do_installed = 1; break;
-   case 'E': do_eclass = 1; break;
-   case 'H': args.show_filename = 1; break;
-   case 'N': args.show_name = 1; break;
-   case 's': args.skip_comments = 1; break;
-   case 'S': args.skip_pattern = optarg;

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

2019-05-02 Thread Fabian Groffen
commit: 6eee66bd91df5928c0fbf1ee9cd2ff8a3f575d89
Author: Fabian Groffen  gentoo  org>
AuthorDate: Thu May  2 18:00:17 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Thu May  2 18:00:17 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=6eee66bd

qcache: rename to qkeyword

qcache has its roots in reading the metadata cache, but since this is
standard functionality provided by libq/cache now, all that qcache does
really is things with keywords.

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

 .gitignore   |   4 +-
 Makefile.am  |   6 +--
 Makefile.in  |  40 
 TODO.md  |   2 -
 applets.h|   4 +-
 man/q.1  |   6 +--
 man/qatom.1  |   4 +-
 man/qcheck.1 |   4 +-
 man/qdepends.1   |   4 +-
 man/qfile.1  |   4 +-
 man/qgrep.1  |   4 +-
 man/{qcache.1 => qkeyword.1} |   6 +--
 man/qlist.1  |   4 +-
 man/qlop.1   |   4 +-
 man/qmerge.1 |   4 +-
 man/qpkg.1   |   4 +-
 man/qsearch.1|   4 +-
 man/qsize.1  |   4 +-
 man/qtbz2.1  |   4 +-
 man/qtegrity.1   |   4 +-
 man/quse.1   |   2 +-
 man/qxpak.1  |   4 +-
 qcache.c => qkeyword.c   | 112 +--
 23 files changed, 118 insertions(+), 120 deletions(-)

diff --git a/.gitignore b/.gitignore
index c571c4e..b65a0fb 100644
--- a/.gitignore
+++ b/.gitignore
@@ -32,18 +32,18 @@ stamp-h1
 /*.old.c
 /q
 /qatom
-/qcache
 /qcheck
 /qdepends
 /qfile
 /qglsa
 /qgrep
+/qkeyword
 /qlist
 /qlop
 /qmerge
 /qpkg
 /qsearch
 /qsize
+/qtegrity
 /quse
 /qxpak
-/qtegrity

diff --git a/Makefile.am b/Makefile.am
index 9306019..b36173c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -10,11 +10,11 @@ SUBDIRS = \
 APPLETS = \
q \
qatom \
-   qcache \
qcheck \
qdepends \
qfile \
qgrep \
+   qkeyword \
qlist \
qlop \
qmerge \
@@ -30,11 +30,11 @@ APPLETS = \
 dist_man_MANS = \
man/q.1 \
man/qatom.1 \
-   man/qcache.1 \
man/qcheck.1 \
man/qdepends.1 \
man/qfile.1 \
man/qgrep.1 \
+   man/qkeyword.1 \
man/qlist.1 \
man/qlop.1 \
man/qmerge.1 \
@@ -52,11 +52,11 @@ q_SOURCES = \
main.c \
q.c \
qatom.c \
-   qcache.c \
qcheck.c \
qdepends.c \
qfile.c \
qgrep.c \
+   qkeyword.c \
qlist.c \
qlop.c \
qmerge.c \

diff --git a/Makefile.in b/Makefile.in
index b211bdd..6af9c8a 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -246,8 +246,8 @@ CONFIG_CLEAN_VPATH_FILES =
 am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"
 PROGRAMS = $(bin_PROGRAMS)
 am_q_OBJECTS = q-main.$(OBJEXT) q-q.$(OBJEXT) q-qatom.$(OBJEXT) \
-   q-qcache.$(OBJEXT) q-qcheck.$(OBJEXT) q-qdepends.$(OBJEXT) \
-   q-qfile.$(OBJEXT) q-qgrep.$(OBJEXT) q-qlist.$(OBJEXT) \
+   q-qcheck.$(OBJEXT) q-qdepends.$(OBJEXT) q-qfile.$(OBJEXT) \
+   q-qgrep.$(OBJEXT) q-qkeyword.$(OBJEXT) q-qlist.$(OBJEXT) \
q-qlop.$(OBJEXT) q-qmerge.$(OBJEXT) q-qpkg.$(OBJEXT) \
q-qsearch.$(OBJEXT) q-qsize.$(OBJEXT) q-qtbz2.$(OBJEXT) \
q-qtegrity.$(OBJEXT) q-quse.$(OBJEXT) q-qxpak.$(OBJEXT)
@@ -1550,11 +1550,11 @@ SUBDIRS = \
 APPLETS = \
q \
qatom \
-   qcache \
qcheck \
qdepends \
qfile \
qgrep \
+   qkeyword \
qlist \
qlop \
qmerge \
@@ -1570,11 +1570,11 @@ APPLETS = \
 dist_man_MANS = \
man/q.1 \
man/qatom.1 \
-   man/qcache.1 \
man/qcheck.1 \
man/qdepends.1 \
man/qfile.1 \
man/qgrep.1 \
+   man/qkeyword.1 \
man/qlist.1 \
man/qlop.1 \
man/qmerge.1 \
@@ -1591,11 +1591,11 @@ q_SOURCES = \
main.c \
q.c \
qatom.c \
-   qcache.c \
qcheck.c \
qdepends.c \
qfile.c \
qgrep.c \
+   qkeyword.c \
qlist.c \
qlop.c \
qmerge.c \
@@ -1744,11 +1744,11 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/q-main.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/q-q.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/q-qatom.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/q-qcache.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/q-qcheck.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/q-qdepends.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/q-qfile.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/q-qgrep.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/q-qkeyword.Po@am__quote@
 @

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

2019-05-03 Thread Fabian Groffen
commit: 47c13a275a7b76d77e5ac3e3ada5024bfc5372bd
Author: Fabian Groffen  gentoo  org>
AuthorDate: Fri May  3 08:47:26 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Fri May  3 08:47:26 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=47c13a27

quse: make -v output faster, format and introduce --repo

- improve performance for -v output (listing all use-flags with
  descriptions per package match)
- add -R/--repo flag to print repository next to atom
- align USE-flags in -v mode per package

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

 TODO.md|   1 -
 man/quse.1 |   3 ++
 quse.c | 171 +
 3 files changed, 131 insertions(+), 44 deletions(-)

diff --git a/TODO.md b/TODO.md
index 349170f..b70dffc 100644
--- a/TODO.md
+++ b/TODO.md
@@ -88,5 +88,4 @@
   package X
 
 # quse
-- make -v faster by calling searcg funcs once per package match
 - make -v only print requested USE-flag when flags given

diff --git a/man/quse.1 b/man/quse.1
index 6f0d8d3..ef17c10 100644
--- a/man/quse.1
+++ b/man/quse.1
@@ -25,6 +25,9 @@ Describe the USE flag.
 \fB\-p\fR \fI\fR, \fB\-\-package\fR \fI\fR
 Restrict matching to package or category.
 .TP
+\fB\-R\fR, \fB\-\-repo\fR
+Show repository the ebuild originates from.
+.TP
 \fB\-\-root\fR \fI\fR
 Set the ROOT env var.
 .TP

diff --git a/quse.c b/quse.c
index fbf61cf..604efdf 100644
--- a/quse.c
+++ b/quse.c
@@ -26,13 +26,14 @@
 #include "xarray.h"
 #include "xregex.h"
 
-#define QUSE_FLAGS "eaLDp:" COMMON_FLAGS
+#define QUSE_FLAGS "eaLDp: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'},
{"package",a_argument, NULL, 'p'},
+   {"repo",  no_argument, NULL, 'R'},
COMMON_LONG_OPTS
 };
 static const char * const quse_opts_help[] = {
@@ -41,6 +42,7 @@ static const char * const quse_opts_help[] = {
"Use the LICENSE vs IUSE",
"Describe the USE flag",
"Restrict matching to package or category",
+   "Show repository the ebuild originates from",
COMMON_OPTS_HELP
 };
 #define quse_usage(ret) usage(ret, QUSE_FLAGS, quse_long_opts, quse_opts_help, 
NULL, lookup_applet_idx("quse"))
@@ -48,12 +50,14 @@ static const char * const quse_opts_help[] = {
 struct quse_state {
int argc;
char **argv;
+   char **retv;
const char *overlay;
bool do_all:1;
bool do_regex:1;
bool do_describe:1;
bool do_licence:1;
bool do_list:1;
+   bool do_repo:1;
depend_atom *match;
regex_t *pregv;
 };
@@ -110,6 +114,9 @@ quse_search_use_local_desc(int portdirfd, struct quse_state 
*state)
 
match = false;
for (i = 0; i < state->argc; i++) {
+   if (state->do_list && state->retv[i] != NULL)
+   continue;
+
if (state->do_regex) {
if (regexec(&state->pregv[i], p, 0, NULL, 0) != 
0)
continue;
@@ -128,13 +135,14 @@ quse_search_use_local_desc(int portdirfd, struct 
quse_state *state)
if (state->match == NULL ||
atom_compare(atom, state->match) == 
EQUAL)
{
-   if (state->do_list)
-   printf("  %s%s%s  %s\n", MAGENTA, p, 
NORM, q);
-   else
+   if (state->do_list) {
+   state->retv[i] = xstrdup(q);
+   } else {
printf("%s%s/%s%s%s[%s%s%s] %s\n",
BOLD, atom->CATEGORY,
BLUE, atom->PN, NORM,
MAGENTA, p, NORM, q);
+   }
}
 
atom_implode(atom);
@@ -142,6 +150,16 @@ quse_search_use_local_desc(int portdirfd, struct 
quse_state *state)
}
} while (1);
 
+   if (state->do_list && ret) {
+   /* check if all requested flags are retrieved */
+   ret = true;
+   for (i = 0; i < state->argc; i++)
+   if (state->retv[i] == NULL)
+   break;
+   if (i < state->argc)
+   ret = false;
+   }
+
fclose(f);
return ret;
 }
@@ -186,6 +204,9 @@ quse_search_use_desc(int portdirfd, struct quse_state 
*state)
 
match = false;
for (i = 0; i < state->a

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

2019-04-25 Thread Fabian Groffen
commit: 13b7387c9288363eeb9dfbc397a2e3859eccbee7
Author: Fabian Groffen  gentoo  org>
AuthorDate: Thu Apr 25 09:18:29 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Thu Apr 25 09:18:29 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=13b7387c

man/mkman: fix authors showing up on random pages

dropped multiprocessing crap as it complicates and doesn't really speed
up anything (I suspected it to be faulty at first, but left it out)

the real issue was COMMON_AUTHORS not being copied, therefore any temp
additions were done to the common authors list

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

 man/mkman.py | 19 +--
 1 file changed, 5 insertions(+), 14 deletions(-)

diff --git a/man/mkman.py b/man/mkman.py
index f578305..8c7fc9d 100755
--- a/man/mkman.py
+++ b/man/mkman.py
@@ -9,7 +9,6 @@ import datetime
 import functools
 import glob
 import locale
-import multiprocessing
 import os
 import re
 import subprocess
@@ -71,7 +70,7 @@ def MkMan(applets, applet, output):
 usage = m.group(1)
 short_desc = m.group(2)
 
-authors = COMMON_AUTHORS
+authors = COMMON_AUTHORS[:]
 see_also = sorted(['.BR %s (1)' % x for x in applets if x != applet])
 
 description = ''
@@ -139,7 +138,7 @@ 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:
-if "-authors." in frag:
+if frag.endswith('-authors.include'):
 authors += [x.rstrip() for x in f.readlines()]
 else:
 extra_sections += [x.rstrip() for x in f.readlines()]
@@ -159,13 +158,6 @@ def MkMan(applets, applet, output):
 with open(output, 'w') as f:
 f.write(TEMPLATE % data)
 
-
-def _MkMan(applets, applet):
-"""Trampoline to MkMan for multiprocessing pickle"""
-output = os.path.join(MKMAN_DIR, '%s.1' % applet)
-MkMan(applets, applet, output)
-
-
 def main(argv):
 os.environ['NOCOLOR'] = '1'
 
@@ -174,10 +166,9 @@ def main(argv):
 # Support file completion like "qfile.1" or "./qdepends.1"
 applets = [os.path.basename(x).split('.', 1)[0] for x in argv]
 
-p = multiprocessing.Pool()
-functor = functools.partial(_MkMan, applets)
-p.map(functor, applets)
-
+for applet in applets:
+output = os.path.join(MKMAN_DIR, '%s.1' % applet)
+MkMan(applets, applet, output)
 
 if __name__ == '__main__':
 sys.exit(main(sys.argv[1:]))



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

2019-04-25 Thread Fabian Groffen
commit: 9122b278974bc7e4705f1a8db1cc16618be2bce2
Author: Fabian Groffen  gentoo  org>
AuthorDate: Thu Apr 25 09:20:19 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Thu Apr 25 09:20:19 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=9122b278

man: regenerate

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

 man/q.1|  8 +---
 man/qcache.1   |  2 +-
 man/qcheck.1   |  2 +-
 man/qfile.1|  2 +-
 man/qgrep.1|  2 +-
 man/qlop.1 |  2 +-
 man/qmerge.1   |  2 +-
 man/qpkg.1 |  3 +--
 man/qsearch.1  | 16 ++--
 man/qsize.1|  2 +-
 man/qtbz2.1|  2 +-
 man/qtegrity.1 |  2 +-
 man/quse.1 |  3 +--
 man/qxpak.1|  3 +--
 14 files changed, 19 insertions(+), 32 deletions(-)

diff --git a/man/q.1 b/man/q.1
index c9867c6..b3e985b 100644
--- a/man/q.1
+++ b/man/q.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH q "1" "Feb 2019" "Gentoo Foundation" "q"
+.TH q "1" "Apr 2019" "Gentoo Foundation" "q"
 .SH NAME
 q \- invoke a portage utility applet
 .SH SYNOPSIS
@@ -12,12 +12,6 @@ q \- invoke a portage utility applet
 \fB\-i\fR, \fB\-\-install\fR
 Install symlinks for applets.
 .TP
-\fB\-r\fR \fI[arg]\fR, \fB\-\-reinitialize\fR \fI[arg]\fR
-Reinitialize ebuild cache.
-.TP
-\fB\-m\fR \fI[arg]\fR, \fB\-\-metacache\fR \fI[arg]\fR
-Reinitialize metadata cache.
-.TP
 \fB\-M\fR \fI\fR, \fB\-\-modpath\fR \fI\fR
 Module path.
 .TP

diff --git a/man/qcache.1 b/man/qcache.1
index a94e5dd..675059e 100644
--- a/man/qcache.1
+++ b/man/qcache.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qcache "1" "Feb 2019" "Gentoo Foundation" "qcache"
+.TH qcache "1" "Apr 2019" "Gentoo Foundation" "qcache"
 .SH NAME
 qcache \- search the metadata cache
 .SH SYNOPSIS

diff --git a/man/qcheck.1 b/man/qcheck.1
index f394418..c139744 100644
--- a/man/qcheck.1
+++ b/man/qcheck.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qcheck "1" "Feb 2019" "Gentoo Foundation" "qcheck"
+.TH qcheck "1" "Apr 2019" "Gentoo Foundation" "qcheck"
 .SH NAME
 qcheck \- verify integrity of installed packages
 .SH SYNOPSIS

diff --git a/man/qfile.1 b/man/qfile.1
index 6bf07c0..5cd297a 100644
--- a/man/qfile.1
+++ b/man/qfile.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qfile "1" "Feb 2019" "Gentoo Foundation" "qfile"
+.TH qfile "1" "Apr 2019" "Gentoo Foundation" "qfile"
 .SH NAME
 qfile \- list all pkgs owning files
 .SH SYNOPSIS

diff --git a/man/qgrep.1 b/man/qgrep.1
index f446c13..662122d 100644
--- a/man/qgrep.1
+++ b/man/qgrep.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qgrep "1" "Feb 2019" "Gentoo Foundation" "qgrep"
+.TH qgrep "1" "Apr 2019" "Gentoo Foundation" "qgrep"
 .SH NAME
 qgrep \- grep in ebuilds
 .SH SYNOPSIS

diff --git a/man/qlop.1 b/man/qlop.1
index f0ef69a..4dd31c1 100644
--- a/man/qlop.1
+++ b/man/qlop.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qlop "1" "Mar 2019" "Gentoo Foundation" "qlop"
+.TH qlop "1" "Apr 2019" "Gentoo Foundation" "qlop"
 .SH NAME
 qlop \- emerge log analyzer
 .SH SYNOPSIS

diff --git a/man/qmerge.1 b/man/qmerge.1
index 0391d5a..d303e45 100644
--- a/man/qmerge.1
+++ b/man/qmerge.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qmerge "1" "Feb 2019" "Gentoo Foundation" "qmerge"
+.TH qmerge "1" "Apr 2019" "Gentoo Foundation" "qmerge"
 .SH NAME
 qmerge \- fetch and merge binary package
 .SH SYNOPSIS

diff --git a/man/qpkg.1 b/man/qpkg.1
index c67b614..17278ec 100644
--- a/man/qpkg.1
+++ b/man/qpkg.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qpkg "1" "Feb 2019" "Gentoo Foundation" "qpkg"
+.TH qpkg "1" "Apr 2019" "Gentoo Foundation" "qpkg"
 .SH NAME
 qpkg \- manipulate Gentoo binpkgs
 .SH SYNOPSIS
@@ -51,7 +51,6 @@ Product: Portage Development; Component: Tools
 Ned Ludd 
 Mike Frysinger 
 Fabian Groffen 
-TGL 
 .fi
 .SH "SEE ALSO"
 .BR q (1),

diff --git a/man/qsearch.1 b/man/qsearch.1
index 04f7d41..1bea7ab 100644
--- a/man/qsearch.1
+++ b/man/qsearch.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qsearch "1" "Feb 2019" "Gentoo Foundation" "qsearch"
+.TH qsearch "1" "Apr 2019" "Gentoo Foundation" "qsearch"
 .SH NAME
 qsearch \- search pkgname/desc
 .SH SYNOPSIS
@@ -14,23 +14,20 @@ all ebuilds in the tree.
 \fB\-a\fR, \fB\-\-all\fR
 List the descriptions of every package in the cache.
 .TP
-\fB\-c\fR, \fB\-\-cache\fR
-Use the portage cache.
-.TP
-\fB\-e\fR, \fB\-\-ebuilds\fR
-Use the portage ebuild tree (default).
-.TP
 \fB\-s\fR, \fB\-\-search\fR
 Regex search package basenames.
 .TP
 \fB\-S\fR \fI\fR, \fB\-\-desc\fR \fI\fR
-Regex search package descriptions.
+Regex search package descriptions (or homepage when using -H).
 .TP
 \fB\-N\fR, \fB\-\-name\-only\fR
 Only show package name.
 .TP
 \fB\-H\fR, \fB\-\-homepage\fR
-Show homepage info.
+Show homepage info instead of description.
+.TP
+\fB\-R\fR, \fB\-\-repo\fR
+Sho

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

2019-05-20 Thread Fabian Groffen
commit: 861d52c3d5fe82d4ca07ba7159f3232c215af28e
Author: Fabian Groffen  gentoo  org>
AuthorDate: Mon May 20 08:40:58 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Mon May 20 08:43:57 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=861d52c3

q: remove -M (modpath) option

modpath is never used in the code, remove its option

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

 applets.h | 1 -
 main.c| 1 -
 man/q.1   | 3 ---
 q.c   | 5 +
 4 files changed, 1 insertion(+), 9 deletions(-)

diff --git a/applets.h b/applets.h
index 8cb537a..f183dca 100644
--- a/applets.h
+++ b/applets.h
@@ -137,7 +137,6 @@ static const struct applet_t {
case 'C': no_colors(); break; \
default: applet ## _usage(EXIT_FAILURE); break;
 
-extern char *modpath;
 extern char *portroot;
 extern int verbose;
 extern int quiet;

diff --git a/main.c b/main.c
index 944950e..bf86c49 100644
--- a/main.c
+++ b/main.c
@@ -24,7 +24,6 @@
 
 /* variables to control runtime behavior */
 char *module_name = NULL;
-char *modpath = NULL;
 int verbose = 0;
 int quiet = 0;
 char pretend = 0;

diff --git a/man/q.1 b/man/q.1
index 92794a2..4d0b352 100644
--- a/man/q.1
+++ b/man/q.1
@@ -19,9 +19,6 @@ no longer necessary to initialise the cache at any time.
 \fB\-i\fR, \fB\-\-install\fR
 Install symlinks for applets.
 .TP
-\fB\-M\fR \fI\fR, \fB\-\-modpath\fR \fI\fR
-Module path.
-.TP
 \fB\-\-root\fR \fI\fR
 Set the ROOT env var.
 .TP

diff --git a/q.c b/q.c
index b6486ee..6307658 100644
--- a/q.c
+++ b/q.c
@@ -21,15 +21,13 @@
 
 #include "basename.h"
 
-#define Q_FLAGS "iM:" COMMON_FLAGS
+#define Q_FLAGS "i" COMMON_FLAGS
 static struct option const q_long_opts[] = {
{"install",   no_argument, NULL, 'i'},
-   {"modpath",a_argument, NULL, 'M'},
COMMON_LONG_OPTS
 };
 static const char * const q_opts_help[] = {
"Install symlinks for applets",
-   "Module path",
COMMON_OPTS_HELP
 };
 #define q_usage(ret) usage(ret, Q_FLAGS, q_long_opts, q_opts_help, NULL, 
lookup_applet_idx("q"))
@@ -95,7 +93,6 @@ int q_main(int argc, char **argv)
while ((i = GETOPT_LONG(Q, q, "+")) != -1) {
switch (i) {
COMMON_GETOPTS_CASES(q)
-   case 'M': modpath = optarg; break;
case 'i': install = 1; break;
}
}



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

2019-02-05 Thread Fabian Groffen
commit: 1502daae3a15488f1e9c7a6dffcfa3f2bd863a41
Author: Fabian Groffen  gentoo  org>
AuthorDate: Tue Feb  5 13:48:31 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Tue Feb  5 13:50:46 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=1502daae

man: regen

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

 man/q.1| 3 +--
 man/qatom.1| 2 +-
 man/qcache.1   | 2 +-
 man/qcheck.1   | 2 +-
 man/qfile.1| 2 +-
 man/qgrep.1| 2 +-
 man/qlist.1| 2 +-
 man/qlop.1 | 2 +-
 man/qmerge.1   | 2 +-
 man/qpkg.1 | 2 +-
 man/qsearch.1  | 2 +-
 man/qsize.1| 2 +-
 man/qtbz2.1| 2 +-
 man/qtegrity.1 | 2 +-
 man/quse.1 | 2 +-
 man/qxpak.1| 2 +-
 16 files changed, 16 insertions(+), 17 deletions(-)

diff --git a/man/q.1 b/man/q.1
index b88dd4c..a5eebb8 100644
--- a/man/q.1
+++ b/man/q.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH q "1" "May 2018" "Gentoo Foundation" "q"
+.TH q "1" "Feb 2019" "Gentoo Foundation" "q"
 .SH NAME
 q \- invoke a portage utility applet
 .SH SYNOPSIS
@@ -47,7 +47,6 @@ Print version and exit.
qcheck: verify integrity of installed packages
  qdepends: show dependency info
 qfile   : list all pkgs owning files
-qglsa   : check GLSAs against system
 qgrep  : grep in ebuilds
 qlist: list files owned by pkgname
  qlop: emerge log analyzer

diff --git a/man/qatom.1 b/man/qatom.1
index f1c985b..d83e6e1 100644
--- a/man/qatom.1
+++ b/man/qatom.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qatom "1" "May 2018" "Gentoo Foundation" "qatom"
+.TH qatom "1" "Feb 2019" "Gentoo Foundation" "qatom"
 .SH NAME
 qatom \- split atom strings
 .SH SYNOPSIS

diff --git a/man/qcache.1 b/man/qcache.1
index fd8a620..c5c80b8 100644
--- a/man/qcache.1
+++ b/man/qcache.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qcache "1" "May 2018" "Gentoo Foundation" "qcache"
+.TH qcache "1" "Feb 2019" "Gentoo Foundation" "qcache"
 .SH NAME
 qcache \- search the metadata cache
 .SH SYNOPSIS

diff --git a/man/qcheck.1 b/man/qcheck.1
index f6f1d26..ac93cbb 100644
--- a/man/qcheck.1
+++ b/man/qcheck.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qcheck "1" "May 2018" "Gentoo Foundation" "qcheck"
+.TH qcheck "1" "Feb 2019" "Gentoo Foundation" "qcheck"
 .SH NAME
 qcheck \- verify integrity of installed packages
 .SH SYNOPSIS

diff --git a/man/qfile.1 b/man/qfile.1
index 6916628..5b8411e 100644
--- a/man/qfile.1
+++ b/man/qfile.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qfile "1" "May 2018" "Gentoo Foundation" "qfile"
+.TH qfile "1" "Feb 2019" "Gentoo Foundation" "qfile"
 .SH NAME
 qfile \- list all pkgs owning files
 .SH SYNOPSIS

diff --git a/man/qgrep.1 b/man/qgrep.1
index 0cc0831..d062e99 100644
--- a/man/qgrep.1
+++ b/man/qgrep.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qgrep "1" "May 2018" "Gentoo Foundation" "qgrep"
+.TH qgrep "1" "Feb 2019" "Gentoo Foundation" "qgrep"
 .SH NAME
 qgrep \- grep in ebuilds
 .SH SYNOPSIS

diff --git a/man/qlist.1 b/man/qlist.1
index 96b201b..07275e5 100644
--- a/man/qlist.1
+++ b/man/qlist.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qlist "1" "May 2018" "Gentoo Foundation" "qlist"
+.TH qlist "1" "Feb 2019" "Gentoo Foundation" "qlist"
 .SH NAME
 qlist \- list files owned by pkgname
 .SH SYNOPSIS

diff --git a/man/qlop.1 b/man/qlop.1
index 8def1f2..bdfe3af 100644
--- a/man/qlop.1
+++ b/man/qlop.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qlop "1" "May 2018" "Gentoo Foundation" "qlop"
+.TH qlop "1" "Feb 2019" "Gentoo Foundation" "qlop"
 .SH NAME
 qlop \- emerge log analyzer
 .SH SYNOPSIS

diff --git a/man/qmerge.1 b/man/qmerge.1
index 56c79e9..da36e75 100644
--- a/man/qmerge.1
+++ b/man/qmerge.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qmerge "1" "May 2018" "Gentoo Foundation" "qmerge"
+.TH qmerge "1" "Feb 2019" "Gentoo Foundation" "qmerge"
 .SH NAME
 qmerge \- fetch and merge binary package
 .SH SYNOPSIS

diff --git a/man/qpkg.1 b/man/qpkg.1
index b5691b1..d6949df 100644
--- a/man/qpkg.1
+++ b/man/qpkg.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qpkg "1" "May 2018" "Gentoo Foundation" "qpkg"
+.TH qpkg "1" "Feb 2019" "Gentoo Foundation" "qpkg"
 .SH NAME
 qpkg \- manipulate Gentoo binpkgs
 .SH SYNOPSIS

diff --git a/man/qsearch.1 b/man/qsearch.1
index f3ae1f5..ffe47a1 100644
--- a/man/qsearch.1
+++ b/man/qsearch.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qsearch "1" "May 2018" "Gentoo Foundation" "qsearch"
+.TH qsearch "1" "Feb 2019" "Gentoo Foundation" "qsearch"
 .SH NAME
 qsearch \- search pkgname/desc
 .SH SYNOPSIS

diff --git a/man/qsize.1 b/man/qsize.1
index d2ea494..88bffe4 100644
--- a/man/qsize.1
+++ b/man/qsize.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do

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

2019-02-28 Thread Fabian Groffen
commit: 51d8de0e2c01a7f23d06eb2cda8599ccd0159938
Author: Fabian Groffen  gentoo  org>
AuthorDate: Thu Feb 28 09:38:45 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Thu Feb 28 09:38:45 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=51d8de0e

mkman: drop Assignee suggestion

Usage of a generic alias is no longer allowed (for reasons beyond my
understanding), and I don't want to put my own email here, so rely on
bugwranglers to make the bugs end up with some assignee.

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

 man/mkman.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/man/mkman.py b/man/mkman.py
index bd3111c..f578305 100755
--- a/man/mkman.py
+++ b/man/mkman.py
@@ -50,8 +50,7 @@ TEMPLATE = r""".\" generated by mkman.py, please do NOT edit!
 .SH "REPORTING BUGS"
 Please report bugs via http://bugs.gentoo.org/
 .br
-Product: Portage Development; Component: Tools, Assignee:
-portage-ut...@gentoo.org
+Product: Portage Development; Component: Tools
 .SH AUTHORS
 .nf
 %(authors)s



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

2019-02-28 Thread Fabian Groffen
commit: 3bc514d70090fab825e74eb4f8e28a858bd528ba
Author: Fabian Groffen  gentoo  org>
AuthorDate: Thu Feb 28 09:40:57 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Thu Feb 28 09:40:57 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=3bc514d7

man: regen after Assignee removal

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

 man/q.1| 3 +--
 man/qatom.1| 3 +--
 man/qcache.1   | 3 +--
 man/qcheck.1   | 3 +--
 man/qdepends.1 | 3 +--
 man/qfile.1| 3 +--
 man/qgrep.1| 3 +--
 man/qlist.1| 3 +--
 man/qlop.1 | 5 ++---
 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/qxpak.1| 3 +--
 17 files changed, 18 insertions(+), 35 deletions(-)

diff --git a/man/q.1 b/man/q.1
index a5eebb8..c9867c6 100644
--- a/man/q.1
+++ b/man/q.1
@@ -62,8 +62,7 @@ Print version and exit.
 .SH "REPORTING BUGS"
 Please report bugs via http://bugs.gentoo.org/
 .br
-Product: Portage Development; Component: Tools, Assignee:
-portage-ut...@gentoo.org
+Product: Portage Development; Component: Tools
 .SH AUTHORS
 .nf
 Ned Ludd 

diff --git a/man/qatom.1 b/man/qatom.1
index d83e6e1..4860957 100644
--- a/man/qatom.1
+++ b/man/qatom.1
@@ -88,8 +88,7 @@ Print version and exit.
 .SH "REPORTING BUGS"
 Please report bugs via http://bugs.gentoo.org/
 .br
-Product: Portage Development; Component: Tools, Assignee:
-portage-ut...@gentoo.org
+Product: Portage Development; Component: Tools
 .SH AUTHORS
 .nf
 Ned Ludd 

diff --git a/man/qcache.1 b/man/qcache.1
index c5c80b8..a94e5dd 100644
--- a/man/qcache.1
+++ b/man/qcache.1
@@ -54,8 +54,7 @@ Print version and exit.
 .SH "REPORTING BUGS"
 Please report bugs via http://bugs.gentoo.org/
 .br
-Product: Portage Development; Component: Tools, Assignee:
-portage-ut...@gentoo.org
+Product: Portage Development; Component: Tools
 .SH AUTHORS
 .nf
 Ned Ludd 

diff --git a/man/qcheck.1 b/man/qcheck.1
index ac93cbb..f394418 100644
--- a/man/qcheck.1
+++ b/man/qcheck.1
@@ -54,8 +54,7 @@ Print version and exit.
 .SH "REPORTING BUGS"
 Please report bugs via http://bugs.gentoo.org/
 .br
-Product: Portage Development; Component: Tools, Assignee:
-portage-ut...@gentoo.org
+Product: Portage Development; Component: Tools
 .SH AUTHORS
 .nf
 Ned Ludd 

diff --git a/man/qdepends.1 b/man/qdepends.1
index 0273999..f5c8c01 100644
--- a/man/qdepends.1
+++ b/man/qdepends.1
@@ -111,8 +111,7 @@ dependency is expressed.
 .SH "REPORTING BUGS"
 Please report bugs via http://bugs.gentoo.org/
 .br
-Product: Portage Development; Component: Tools, Assignee:
-portage-ut...@gentoo.org
+Product: Portage Development; Component: Tools
 .SH AUTHORS
 .nf
 Ned Ludd 

diff --git a/man/qfile.1 b/man/qfile.1
index 5b8411e..c7f7054 100644
--- a/man/qfile.1
+++ b/man/qfile.1
@@ -206,8 +206,7 @@ rm -rf "${tmpdir}"
 .SH "REPORTING BUGS"
 Please report bugs via http://bugs.gentoo.org/
 .br
-Product: Portage Development; Component: Tools, Assignee:
-portage-ut...@gentoo.org
+Product: Portage Development; Component: Tools
 .SH AUTHORS
 .nf
 Ned Ludd 

diff --git a/man/qgrep.1 b/man/qgrep.1
index d062e99..f446c13 100644
--- a/man/qgrep.1
+++ b/man/qgrep.1
@@ -79,8 +79,7 @@ Print version and exit.
 .SH "REPORTING BUGS"
 Please report bugs via http://bugs.gentoo.org/
 .br
-Product: Portage Development; Component: Tools, Assignee:
-portage-ut...@gentoo.org
+Product: Portage Development; Component: Tools
 .SH AUTHORS
 .nf
 Ned Ludd 

diff --git a/man/qlist.1 b/man/qlist.1
index 07275e5..c2c585c 100644
--- a/man/qlist.1
+++ b/man/qlist.1
@@ -77,8 +77,7 @@ Print version and exit.
 .SH "REPORTING BUGS"
 Please report bugs via http://bugs.gentoo.org/
 .br
-Product: Portage Development; Component: Tools, Assignee:
-portage-ut...@gentoo.org
+Product: Portage Development; Component: Tools
 .SH AUTHORS
 .nf
 Ned Ludd 

diff --git a/man/qlop.1 b/man/qlop.1
index 46a6f94..4769ecd 100644
--- a/man/qlop.1
+++ b/man/qlop.1
@@ -46,7 +46,7 @@ Calculate average merge, unmerge or sync time.  This is the 
average
 time for all occurrences found respecting any date limits.
 .TP
 \fB\-H\fR, \fB\-\-human\fR
-Print elaspsed time in human readable format.  This form uses
+Print elapssed time in human readable format.  This form uses
 minutes, hours and days instead of just seconds.
 .TP
 \fB\-m\fR, \fB\-\-merge\fR
@@ -119,8 +119,7 @@ Print version and exit.
 .SH "REPORTING BUGS"
 Please report bugs via http://bugs.gentoo.org/
 .br
-Product: Portage Development; Component: Tools, Assignee:
-portage-ut...@gentoo.org
+Product: Portage Development; Component: Tools
 .SH AUTHORS
 .nf
 Ned Ludd 

diff --git a/man/qmerge.1 b/man/qmerge.1
index da36e75..0391d5a 100644
--- a/man/qmerge.1
+++ b/man/qmerge.1
@@ -65,8 +65,7 @@ Print version and exit.
 .SH "REPORTING BUGS"
 Please report bugs via http://bugs.gentoo.org/
 .br
-Product: Portage Development; Component: Tools, Assignee:
-portage-ut.

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

2019-02-28 Thread Fabian Groffen
commit: 01d4f8ae5983bdab35c146fe6facef57cce6870e
Author: Fabian Groffen  gentoo  org>
AuthorDate: Thu Feb 28 18:48:55 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Thu Feb 28 18:48:55 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=01d4f8ae

man: regenerate qlop.1 after options change

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

 man/qlop.1 | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/man/qlop.1 b/man/qlop.1
index 4769ecd..407c9ea 100644
--- a/man/qlop.1
+++ b/man/qlop.1
@@ -49,6 +49,9 @@ time for all occurrences found respecting any date limits.
 Print elapssed time in human readable format.  This form uses
 minutes, hours and days instead of just seconds.
 .TP
+\fB\-M\fR, \fB\-\-machine\fR
+Print elapsed time as seconds with no formatting.
+.TP
 \fB\-m\fR, \fB\-\-merge\fR
 Show merge history.
 .TP



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

2019-02-28 Thread Fabian Groffen
commit: 951a8711a59b1a7d49125f5f5214ff1ae9e50074
Author: Fabian Groffen  gentoo  org>
AuthorDate: Thu Feb 28 19:27:12 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Thu Feb 28 19:27:12 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=951a8711

qfile: drop non-functional --exact option

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

 man/qfile.1 |  3 ---
 qfile.c | 11 ++-
 2 files changed, 2 insertions(+), 12 deletions(-)

diff --git a/man/qfile.1 b/man/qfile.1
index c7f7054..6bf07c0 100644
--- a/man/qfile.1
+++ b/man/qfile.1
@@ -27,9 +27,6 @@ List orphan files.
 \fB\-x\fR \fI\fR, \fB\-\-exclude\fR \fI\fR
 Don't look in package  (used with --orphans).
 .TP
-\fB\-e\fR, \fB\-\-exact\fR
-Exact match (used with --exclude).
-.TP
 \fB\-\-root\fR \fI\fR
 Set the ROOT env var.
 .TP

diff --git a/qfile.c b/qfile.c
index 285277b..6e1cb0a 100644
--- a/qfile.c
+++ b/qfile.c
@@ -8,14 +8,13 @@
 
 #ifdef APPLET_qfile
 
-#define QFILE_FLAGS "beoRx:S" COMMON_FLAGS
+#define QFILE_FLAGS "boRx:S" COMMON_FLAGS
 static struct option const qfile_long_opts[] = {
{"slots",   no_argument, NULL, 'S'},
{"root-prefix", no_argument, NULL, 'R'},
{"basename",no_argument, NULL, 'b'},
{"orphans", no_argument, NULL, 'o'},
{"exclude",  a_argument, NULL, 'x'},
-   {"exact",   no_argument, NULL, 'e'},
COMMON_LONG_OPTS
 };
 static const char * const qfile_opts_help[] = {
@@ -24,7 +23,6 @@ static const char * const qfile_opts_help[] = {
"Match any component of the path",
"List orphan files",
"Don't look in package  (used with --orphans)",
-   "Exact match (used with --exclude)",
COMMON_OPTS_HELP
 };
 #define qfile_usage(ret) usage(ret, QFILE_FLAGS, qfile_long_opts, 
qfile_opts_help, NULL, lookup_applet_idx("qfile"))
@@ -56,7 +54,6 @@ struct qfile_opt_state {
depend_atom *exclude_atom;
bool slotted;
bool basename;
-   bool exact;
bool orphans;
bool assume_root_prefix;
 };
@@ -224,7 +221,7 @@ static int qfile_cb(q_vdb_pkg_ctx *pkg_ctx, void *priv)
} else
slot[0] = '\0';
printf("%s%s/%s%s%s%s", BOLD, atom->CATEGORY, 
BLUE,
-   (state->exact ? pkg_ctx->name : 
atom->PN),
+   (verbose ? pkg_ctx->name : atom->PN),
slot, NORM);
if (quiet)
puts("");
@@ -402,7 +399,6 @@ int qfile_main(int argc, char **argv)
.buflen = _Q_PATH_MAX,
.slotted = false,
.basename = false,
-   .exact = false,
.orphans = false,
.assume_root_prefix = false,
};
@@ -414,7 +410,6 @@ int qfile_main(int argc, char **argv)
COMMON_GETOPTS_CASES(qfile)
case 'S': state.slotted = true; break;
case 'b': state.basename = true; break;
-   case 'e': state.exact = true; break;
case 'o': state.orphans = true; break;
case 'R': state.assume_root_prefix = true; break;
case 'x':
@@ -429,8 +424,6 @@ int qfile_main(int argc, char **argv)
break;
}
}
-   if (!state.exact && verbose)
-   state.exact = true;
if (argc == optind)
qfile_usage(EXIT_FAILURE);
 



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

2018-05-18 Thread Fabian Groffen
commit: 93d6bb6e36d0559322c06508302d39a4db2ce272
Author: Fabian Groffen  gentoo  org>
AuthorDate: Fri May 18 10:14:02 2018 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Fri May 18 10:14:02 2018 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=93d6bb6e

man/qfile.1: regenerate after author change

 man/qfile.1 | 17 -
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/man/qfile.1 b/man/qfile.1
index ff92897..729b561 100644
--- a/man/qfile.1
+++ b/man/qfile.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qfile "1" "Apr 2018" "Gentoo Foundation" "qfile"
+.TH qfile "1" "May 2018" "Gentoo Foundation" "qfile"
 .SH NAME
 qfile \- list all pkgs owning files
 .SH SYNOPSIS
@@ -50,16 +50,17 @@ Print this help and exit.
 .TP
 \fB\-V\fR, \fB\-\-version\fR
 Print version and exit.
-.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
@@ -71,7 +72,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
@@ -202,10 +203,6 @@ tar tjf "${tarbz2}" \\
| qfile -e -f - -x ${categ}/${pn}:${slot}
 rm -rf "${tmpdir}"
 .PP
-.SH "ADDITIONAL CONTRIBUTORS"
-.nf
-TGL degrenier[at]easyconnect.fr
-.fi
 .SH "REPORTING BUGS"
 Please report bugs via http://bugs.gentoo.org/
 .br
@@ -215,6 +212,7 @@ portage-ut...@gentoo.org
 .nf
 Ned Ludd 
 Mike Frysinger 
+TGL 
 .fi
 .SH "SEE ALSO"
 .BR q (1),
@@ -230,5 +228,6 @@ Mike Frysinger 
 .BR qsearch (1),
 .BR qsize (1),
 .BR qtbz2 (1),
+.BR qtegrity (1),
 .BR quse (1),
 .BR qxpak (1)



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

2018-05-18 Thread Fabian Groffen
commit: 41c8ebc7eb8c1e517bd191736f4ef3ac66ab34e0
Author: Fabian Groffen  gentoo  org>
AuthorDate: Fri May 18 11:34:45 2018 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Fri May 18 11:34:45 2018 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=41c8ebc7

mkman: add myself as author

 man/mkman.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/man/mkman.py b/man/mkman.py
index 7089320..bd3111c 100755
--- a/man/mkman.py
+++ b/man/mkman.py
@@ -33,6 +33,7 @@ def FindApplets():
 COMMON_AUTHORS = [
 'Ned Ludd ',
 'Mike Frysinger ',
+'Fabian Groffen ',
 ]
 TEMPLATE = r""".\" generated by mkman.py, please do NOT edit!
 .TH %(applet)s "1" "%(date)s" "Gentoo Foundation" "%(applet)s"



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

2018-05-18 Thread Fabian Groffen
commit: 56ab601781a95b1172cbcf957ef706bbc021116a
Author: Fabian Groffen  gentoo  org>
AuthorDate: Fri May 18 11:35:26 2018 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Fri May 18 11:35:26 2018 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=56ab6017

man: regenerate

 man/q.1| 1 +
 man/qatom.1| 1 +
 man/qcache.1   | 1 +
 man/qcheck.1   | 1 +
 man/qdepends.1 | 1 +
 man/qfile.1| 1 +
 man/qgrep.1| 1 +
 man/qlist.1| 1 +
 man/qlop.1 | 1 +
 man/qmerge.1   | 1 +
 man/qpkg.1 | 1 +
 man/qsearch.1  | 1 +
 man/qsize.1| 1 +
 man/qtbz2.1| 1 +
 man/qtegrity.1 | 1 +
 man/quse.1 | 1 +
 man/qxpak.1| 1 +
 17 files changed, 17 insertions(+)

diff --git a/man/q.1 b/man/q.1
index 80c3d0a..b88dd4c 100644
--- a/man/q.1
+++ b/man/q.1
@@ -69,6 +69,7 @@ portage-ut...@gentoo.org
 .nf
 Ned Ludd 
 Mike Frysinger 
+Fabian Groffen 
 .fi
 .SH "SEE ALSO"
 .BR qatom (1),

diff --git a/man/qatom.1 b/man/qatom.1
index dd44038..f1c985b 100644
--- a/man/qatom.1
+++ b/man/qatom.1
@@ -94,6 +94,7 @@ portage-ut...@gentoo.org
 .nf
 Ned Ludd 
 Mike Frysinger 
+Fabian Groffen 
 .fi
 .SH "SEE ALSO"
 .BR q (1),

diff --git a/man/qcache.1 b/man/qcache.1
index acbaa24..fd8a620 100644
--- a/man/qcache.1
+++ b/man/qcache.1
@@ -60,6 +60,7 @@ portage-ut...@gentoo.org
 .nf
 Ned Ludd 
 Mike Frysinger 
+Fabian Groffen 
 .fi
 .SH "SEE ALSO"
 .BR q (1),

diff --git a/man/qcheck.1 b/man/qcheck.1
index e52e2e3..f6f1d26 100644
--- a/man/qcheck.1
+++ b/man/qcheck.1
@@ -60,6 +60,7 @@ portage-ut...@gentoo.org
 .nf
 Ned Ludd 
 Mike Frysinger 
+Fabian Groffen 
 .fi
 .SH "SEE ALSO"
 .BR q (1),

diff --git a/man/qdepends.1 b/man/qdepends.1
index c0032fa..2e1aab2 100644
--- a/man/qdepends.1
+++ b/man/qdepends.1
@@ -114,6 +114,7 @@ portage-ut...@gentoo.org
 .nf
 Ned Ludd 
 Mike Frysinger 
+Fabian Groffen 
 .fi
 .SH "SEE ALSO"
 .BR q (1),

diff --git a/man/qfile.1 b/man/qfile.1
index 729b561..6916628 100644
--- a/man/qfile.1
+++ b/man/qfile.1
@@ -212,6 +212,7 @@ portage-ut...@gentoo.org
 .nf
 Ned Ludd 
 Mike Frysinger 
+Fabian Groffen 
 TGL 
 .fi
 .SH "SEE ALSO"

diff --git a/man/qgrep.1 b/man/qgrep.1
index 40e4999..0cc0831 100644
--- a/man/qgrep.1
+++ b/man/qgrep.1
@@ -85,6 +85,7 @@ portage-ut...@gentoo.org
 .nf
 Ned Ludd 
 Mike Frysinger 
+Fabian Groffen 
 .fi
 .SH "SEE ALSO"
 .BR q (1),

diff --git a/man/qlist.1 b/man/qlist.1
index 905c0be..96b201b 100644
--- a/man/qlist.1
+++ b/man/qlist.1
@@ -83,6 +83,7 @@ portage-ut...@gentoo.org
 .nf
 Ned Ludd 
 Mike Frysinger 
+Fabian Groffen 
 .fi
 .SH "SEE ALSO"
 .BR q (1),

diff --git a/man/qlop.1 b/man/qlop.1
index 10e2394..8def1f2 100644
--- a/man/qlop.1
+++ b/man/qlop.1
@@ -89,6 +89,7 @@ portage-ut...@gentoo.org
 .nf
 Ned Ludd 
 Mike Frysinger 
+Fabian Groffen 
 .fi
 .SH "SEE ALSO"
 .BR q (1),

diff --git a/man/qmerge.1 b/man/qmerge.1
index fb94de6..56c79e9 100644
--- a/man/qmerge.1
+++ b/man/qmerge.1
@@ -71,6 +71,7 @@ portage-ut...@gentoo.org
 .nf
 Ned Ludd 
 Mike Frysinger 
+Fabian Groffen 
 .fi
 .SH "SEE ALSO"
 .BR q (1),

diff --git a/man/qpkg.1 b/man/qpkg.1
index 4738026..b5691b1 100644
--- a/man/qpkg.1
+++ b/man/qpkg.1
@@ -51,6 +51,7 @@ portage-ut...@gentoo.org
 .nf
 Ned Ludd 
 Mike Frysinger 
+Fabian Groffen 
 TGL 
 .fi
 .SH "SEE ALSO"

diff --git a/man/qsearch.1 b/man/qsearch.1
index e3e93a6..f3ae1f5 100644
--- a/man/qsearch.1
+++ b/man/qsearch.1
@@ -59,6 +59,7 @@ portage-ut...@gentoo.org
 .nf
 Ned Ludd 
 Mike Frysinger 
+Fabian Groffen 
 TGL 
 .fi
 .SH "SEE ALSO"

diff --git a/man/qsize.1 b/man/qsize.1
index cd1a664..d2ea494 100644
--- a/man/qsize.1
+++ b/man/qsize.1
@@ -60,6 +60,7 @@ portage-ut...@gentoo.org
 .nf
 Ned Ludd 
 Mike Frysinger 
+Fabian Groffen 
 .fi
 .SH "SEE ALSO"
 .BR q (1),

diff --git a/man/qtbz2.1 b/man/qtbz2.1
index d21c804..b356d53 100644
--- a/man/qtbz2.1
+++ b/man/qtbz2.1
@@ -55,6 +55,7 @@ portage-ut...@gentoo.org
 .nf
 Ned Ludd 
 Mike Frysinger 
+Fabian Groffen 
 .fi
 .SH "SEE ALSO"
 .BR q (1),

diff --git a/man/qtegrity.1 b/man/qtegrity.1
index 76ed731..2ba896c 100644
--- a/man/qtegrity.1
+++ b/man/qtegrity.1
@@ -60,6 +60,7 @@ portage-ut...@gentoo.org
 .nf
 Ned Ludd 
 Mike Frysinger 
+Fabian Groffen 
 Sam Besselink
 .fi
 .SH "SEE ALSO"

diff --git a/man/quse.1 b/man/quse.1
index 28b1a33..c8d9f72 100644
--- a/man/quse.1
+++ b/man/quse.1
@@ -63,6 +63,7 @@ portage-ut...@gentoo.org
 .nf
 Ned Ludd 
 Mike Frysinger 
+Fabian Groffen 
 Sam Besselink
 .fi
 .SH "SEE ALSO"

diff --git a/man/qxpak.1 b/man/qxpak.1
index 6c27a5b..1866c28 100644
--- a/man/qxpak.1
+++ b/man/qxpak.1
@@ -51,6 +51,7 @@ portage-ut...@gentoo.org
 .nf
 Ned Ludd 
 Mike Frysinger 
+Fabian Groffen 
 TGL 
 .fi
 .SH "SEE ALSO"



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

2018-05-18 Thread Fabian Groffen
commit: 3ed4ea7795c32374ba77674d98cecf8e8bc0ff03
Author: Fabian Groffen  gentoo  org>
AuthorDate: Fri May 18 11:15:12 2018 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Fri May 18 11:15:12 2018 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=3ed4ea77

man: regenerate for release

 man/q.1| 4 +++-
 man/qatom.1| 3 ++-
 man/qcache.1   | 3 ++-
 man/qcheck.1   | 3 ++-
 man/qdepends.1 | 3 ++-
 man/qgrep.1| 3 ++-
 man/qlist.1| 3 ++-
 man/qlop.1 | 3 ++-
 man/qmerge.1   | 3 ++-
 man/qpkg.1 | 4 +++-
 man/qsearch.1  | 4 +++-
 man/qsize.1| 3 ++-
 man/qtbz2.1| 3 ++-
 man/quse.1 | 4 +++-
 man/qxpak.1| 4 +++-
 15 files changed, 35 insertions(+), 15 deletions(-)

diff --git a/man/q.1 b/man/q.1
index c47c177..80c3d0a 100644
--- a/man/q.1
+++ b/man/q.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH q "1" "Apr 2018" "Gentoo Foundation" "q"
+.TH q "1" "May 2018" "Gentoo Foundation" "q"
 .SH NAME
 q \- invoke a portage utility applet
 .SH SYNOPSIS
@@ -58,6 +58,7 @@ Print version and exit.
 qtbz2  : manipulate tbz2 packages
  quse: find pkgs using useflags
 qxpak  : manipulate xpak archives
+ qtegrity  : verify files with IMA
 .fi
 .SH "REPORTING BUGS"
 Please report bugs via http://bugs.gentoo.org/
@@ -83,5 +84,6 @@ Mike Frysinger 
 .BR qsearch (1),
 .BR qsize (1),
 .BR qtbz2 (1),
+.BR qtegrity (1),
 .BR quse (1),
 .BR qxpak (1)

diff --git a/man/qatom.1 b/man/qatom.1
index aeb9629..dd44038 100644
--- a/man/qatom.1
+++ b/man/qatom.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qatom "1" "Apr 2018" "Gentoo Foundation" "qatom"
+.TH qatom "1" "May 2018" "Gentoo Foundation" "qatom"
 .SH NAME
 qatom \- split atom strings
 .SH SYNOPSIS
@@ -109,5 +109,6 @@ Mike Frysinger 
 .BR qsearch (1),
 .BR qsize (1),
 .BR qtbz2 (1),
+.BR qtegrity (1),
 .BR quse (1),
 .BR qxpak (1)

diff --git a/man/qcache.1 b/man/qcache.1
index fe2ef07..acbaa24 100644
--- a/man/qcache.1
+++ b/man/qcache.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qcache "1" "Apr 2018" "Gentoo Foundation" "qcache"
+.TH qcache "1" "May 2018" "Gentoo Foundation" "qcache"
 .SH NAME
 qcache \- search the metadata cache
 .SH SYNOPSIS
@@ -75,5 +75,6 @@ Mike Frysinger 
 .BR qsearch (1),
 .BR qsize (1),
 .BR qtbz2 (1),
+.BR qtegrity (1),
 .BR quse (1),
 .BR qxpak (1)

diff --git a/man/qcheck.1 b/man/qcheck.1
index 2351ed3..e52e2e3 100644
--- a/man/qcheck.1
+++ b/man/qcheck.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qcheck "1" "Apr 2018" "Gentoo Foundation" "qcheck"
+.TH qcheck "1" "May 2018" "Gentoo Foundation" "qcheck"
 .SH NAME
 qcheck \- verify integrity of installed packages
 .SH SYNOPSIS
@@ -75,5 +75,6 @@ Mike Frysinger 
 .BR qsearch (1),
 .BR qsize (1),
 .BR qtbz2 (1),
+.BR qtegrity (1),
 .BR quse (1),
 .BR qxpak (1)

diff --git a/man/qdepends.1 b/man/qdepends.1
index c51a02d..c0032fa 100644
--- a/man/qdepends.1
+++ b/man/qdepends.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qdepends "1" "Apr 2018" "Gentoo Foundation" "qdepends"
+.TH qdepends "1" "May 2018" "Gentoo Foundation" "qdepends"
 .SH NAME
 qdepends \- show dependency info
 .SH SYNOPSIS
@@ -129,5 +129,6 @@ Mike Frysinger 
 .BR qsearch (1),
 .BR qsize (1),
 .BR qtbz2 (1),
+.BR qtegrity (1),
 .BR quse (1),
 .BR qxpak (1)

diff --git a/man/qgrep.1 b/man/qgrep.1
index bd140b3..40e4999 100644
--- a/man/qgrep.1
+++ b/man/qgrep.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qgrep "1" "Apr 2018" "Gentoo Foundation" "qgrep"
+.TH qgrep "1" "May 2018" "Gentoo Foundation" "qgrep"
 .SH NAME
 qgrep \- grep in ebuilds
 .SH SYNOPSIS
@@ -100,5 +100,6 @@ Mike Frysinger 
 .BR qsearch (1),
 .BR qsize (1),
 .BR qtbz2 (1),
+.BR qtegrity (1),
 .BR quse (1),
 .BR qxpak (1)

diff --git a/man/qlist.1 b/man/qlist.1
index f7dd847..905c0be 100644
--- a/man/qlist.1
+++ b/man/qlist.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qlist "1" "Apr 2018" "Gentoo Foundation" "qlist"
+.TH qlist "1" "May 2018" "Gentoo Foundation" "qlist"
 .SH NAME
 qlist \- list files owned by pkgname
 .SH SYNOPSIS
@@ -98,5 +98,6 @@ Mike Frysinger 
 .BR qsearch (1),
 .BR qsize (1),
 .BR qtbz2 (1),
+.BR qtegrity (1),
 .BR quse (1),
 .BR qxpak (1)

diff --git a/man/qlop.1 b/man/qlop.1
index 18c05fb..10e2394 100644
--- a/man/qlop.1
+++ b/man/qlop.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qlop "1" "Apr 2018" "Gentoo Foundation" "qlop"
+.TH qlop "1" "May 2018" "Gentoo Foundation" "qlop"
 .SH NAME
 qlop \- emerge log analyzer
 .SH SYNOPSIS
@@ -104,5 +104,6 @@ Mike Frysinger 
 .BR qsearch (1),
 .BR qsize (1),
 .BR qtbz2 (1),
+.BR qtegrity (1),
 .BR quse (1),
 .BR qxpak (1)

diff --git a/man/qmerge.1 b/man/qmerge.1
index f66908e..fb94de6 100644
--- a/man/qmerge.1
+++ b/man/qmerge.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qmerge "1" "A

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

2018-03-31 Thread Fabian Groffen
commit: fe42f2a99297fed36720e71ba2ed77cf7a9da804
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sat Mar 31 19:04:20 2018 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sat Mar 31 19:04:20 2018 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=fe42f2a9

man/qlop: add some more/better documentation

Bug: https://bugs.gentoo.org/335453
Bug: https://bugs.gentoo.org/367199

 man/qlop.1 | 40 +++-
 1 file changed, 23 insertions(+), 17 deletions(-)

diff --git a/man/qlop.1 b/man/qlop.1
index f8f0cdd..70fb411 100644
--- a/man/qlop.1
+++ b/man/qlop.1
@@ -1,57 +1,63 @@
-.TH qlop "1" "Mar 2016" "Gentoo Foundation" "qlop"
+.TH qlop "1" "Mar 2018" "Gentoo Foundation" "qlop"
 .SH NAME
 qlop \- emerge log analyzer
 .SH SYNOPSIS
 .B qlop
 \fI[opts] \fR
 .SH DESCRIPTION
-
+qlop reads from $EMERGE_LOG_DIR/emerge.log and tries to extract
+information about merges, unmerges and syncs.  For packages, it can
+calculate average merge times or just list them.
 .SH OPTIONS
 .TP
 \fB\-g\fR, \fB\-\-gauge\fR
-Gauge number of times a package has been merged
+Gauge number of times a package has been merged.  This shows the merge
+time for each individual merge of package.
 .TP
 \fB\-t\fR, \fB\-\-time\fR
-Calculate merge time for a specific package
+Calculate merge time for a specific package.  This is the average time
+for all merges of package.
 .TP
 \fB\-H\fR, \fB\-\-human\fR
-Print seconds in human readable format (needs -t)
+Print seconds in human readable format (needs -t), using minutes, hours
+and days instead of just seconds.
 .TP
 \fB\-l\fR, \fB\-\-list\fR
-Show merge history
+Show merge history.
 .TP
 \fB\-u\fR, \fB\-\-unlist\fR
-Show unmerge history
+Show unmerge history.
 .TP
 \fB\-s\fR, \fB\-\-sync\fR
-Show sync history
+Show sync history.
 .TP
 \fB\-c\fR, \fB\-\-current\fR
-Show current emerging packages
+Show current emerging packages.  This relies on FEATURES=sandbox in
+order to detect running merges.
 .TP
 \fB\-d\fR \fI\fR, \fB\-\-date\fR \fI\fR
-Limit selection to this time (1st -d is start, 2nd -d is end)
+Limit selection to this time (1st -d is start, 2nd -d is end).
 .TP
 \fB\-f\fR \fI\fR, \fB\-\-logfile\fR \fI\fR
-Read emerge logfile instead of $EMERGE_LOG_DIR/emerge.log
+Read emerge logfile instead of $EMERGE_LOG_DIR/emerge.log.
 .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 and revisions.
 .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/



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

2018-04-01 Thread Fabian Groffen
commit: 684a8118721c28690b74fbdc3e74b351e799ffd8
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sun Apr  1 12:39:17 2018 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sun Apr  1 12:39:17 2018 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=684a8118

man/mkman: add header, allow argument description override

 man/mkman.py | 29 -
 1 file changed, 24 insertions(+), 5 deletions(-)

diff --git a/man/mkman.py b/man/mkman.py
index 0751b92..8444311 100755
--- a/man/mkman.py
+++ b/man/mkman.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # -*- coding: utf-8 -*-
 
 """Generate man pages for the q applets"""
@@ -14,6 +14,7 @@ import os
 import re
 import subprocess
 import sys
+import yaml
 
 
 MKMAN_DIR = os.path.realpath(os.path.join(__file__, '..'))
@@ -33,7 +34,8 @@ COMMON_AUTHORS = [
 'Ned Ludd ',
 'Mike Frysinger ',
 ]
-TEMPLATE = r""".TH %(applet)s "1" "%(date)s" "Gentoo Foundation" "%(applet)s"
+TEMPLATE = r""".\" generated by mkman.py, please do NOT edit!
+.TH %(applet)s "1" "%(date)s" "Gentoo Foundation" "%(applet)s"
 .SH NAME
 %(applet)s \- %(short_desc)s
 .SH SYNOPSIS
@@ -47,7 +49,8 @@ TEMPLATE = r""".TH %(applet)s "1" "%(date)s" "Gentoo 
Foundation" "%(applet)s"
 .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
 %(authors)s
@@ -74,7 +77,15 @@ def MkMan(applets, applet, output):
 description = ''
 desc_file = os.path.join(FRAGS_DIR, '%s.desc' % applet)
 if os.path.exists(desc_file):
-description = open(desc_file).read().rstrip()
+fh = open(desc_file)
+description = fh.read().rstrip()
+fh.close()
+
+optdescs = []
+desc_file = os.path.join(FRAGS_DIR, '%s.optdesc.yaml' % applet)
+if os.path.exists(desc_file):
+with open(desc_file) as fh:
+optdescs = yaml.load(fh)
 
 # Extract all the options
 options = []
@@ -89,6 +100,11 @@ def MkMan(applets, applet, output):
 flags += [option[0].rstrip(',')]
 option.pop(0)
 
+optdesc = None
+for x in flags:
+if x.lstrip('-') in optdescs:
+optdesc = optdescs[x.lstrip('-')].strip()
+
 if option[0] in ('', '[arg]'):
 flags = [r'\fB%s\fR \fI%s\fR' % (x, option[0]) for x in flags]
 option.pop(0)
@@ -98,10 +114,13 @@ def MkMan(applets, applet, output):
 assert option[0] == '*', 'help line for %s is broken: %r' % 
(applet, option)
 option.pop(0)
 
+if not optdesc:
+optdesc = ' '.join(option).rstrip('.') + '.'
+
 options += [
 '.TP',
 ', '.join(flags).replace('-', r'\-'),
-' '.join(option),
+optdesc,
 ]
 break
 



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

2018-04-03 Thread Fabian Groffen
commit: ac708664ba64def5168a827e937401150809606d
Author: Fabian Groffen  gentoo  org>
AuthorDate: Tue Apr  3 19:59:44 2018 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Tue Apr  3 19:59:44 2018 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=ac708664

man: regen remaining manpages

 man/q.1  | 26 ++
 man/qcache.1 | 32 +---
 man/qcheck.1 | 34 ++
 man/qpkg.1   |  2 +-
 4 files changed, 50 insertions(+), 44 deletions(-)

diff --git a/man/q.1 b/man/q.1
index 0f8f367..c47c177 100644
--- a/man/q.1
+++ b/man/q.1
@@ -1,4 +1,5 @@
-.TH q "1" "Mar 2016" "Gentoo Foundation" "q"
+.\" generated by mkman.py, please do NOT edit!
+.TH q "1" "Apr 2018" "Gentoo Foundation" "q"
 .SH NAME
 q \- invoke a portage utility applet
 .SH SYNOPSIS
@@ -9,34 +10,34 @@ q \- invoke a portage utility applet
 .SH OPTIONS
 .TP
 \fB\-i\fR, \fB\-\-install\fR
-Install symlinks for applets
+Install symlinks for applets.
 .TP
 \fB\-r\fR \fI[arg]\fR, \fB\-\-reinitialize\fR \fI[arg]\fR
-Reinitialize ebuild cache
+Reinitialize ebuild cache.
 .TP
 \fB\-m\fR \fI[arg]\fR, \fB\-\-metacache\fR \fI[arg]\fR
-Reinitialize metadata cache
+Reinitialize metadata cache.
 .TP
 \fB\-M\fR \fI\fR, \fB\-\-modpath\fR \fI\fR
-Module path
+Module path.
 .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 APPLETS
 .nf
 .B This applet also has sub applets:
@@ -61,7 +62,8 @@ Print version and exit
 .SH "REPORTING BUGS"
 Please report bugs via http://bugs.gentoo.org/
 .br
-Product: Portage Development; Component: Tools
+Product: Portage Development; Component: Tools, Assignee:
+portage-ut...@gentoo.org
 .SH AUTHORS
 .nf
 Ned Ludd 

diff --git a/man/qcache.1 b/man/qcache.1
index 81ae2fa..fe2ef07 100644
--- a/man/qcache.1
+++ b/man/qcache.1
@@ -1,4 +1,5 @@
-.TH qcache "1" "Mar 2016" "Gentoo Foundation" "qcache"
+.\" generated by mkman.py, please do NOT edit!
+.TH qcache "1" "Apr 2018" "Gentoo Foundation" "qcache"
 .SH NAME
 qcache \- search the metadata cache
 .SH SYNOPSIS
@@ -9,51 +10,52 @@ qcache \- search the metadata cache
 .SH OPTIONS
 .TP
 \fB\-p\fR \fI\fR, \fB\-\-matchpkg\fR \fI\fR
-match pkgname
+match pkgname.
 .TP
 \fB\-c\fR \fI\fR, \fB\-\-matchcat\fR \fI\fR
-match catname
+match catname.
 .TP
 \fB\-i\fR, \fB\-\-imlate\fR
-list packages that can be marked stable on a given arch
+list packages that can be marked stable on a given arch.
 .TP
 \fB\-d\fR, \fB\-\-dropped\fR
-list packages that have dropped keywords on a version bump on a given arch
+list packages that have dropped keywords on a version bump on a given arch.
 .TP
 \fB\-t\fR, \fB\-\-testing\fR
-list packages that have ~arch versions, but no stable versions on a given arch
+list packages that have ~arch versions, but no stable versions on a given arch.
 .TP
 \fB\-s\fR, \fB\-\-stats\fR
-display statistics about the portage tree
+display statistics about the portage tree.
 .TP
 \fB\-a\fR, \fB\-\-all\fR
-list packages that have at least one version keyworded for on a given arch
+list packages that have at least one version keyworded for on a given arch.
 .TP
 \fB\-n\fR, \fB\-\-not\fR
 list packages that aren't keyworded on a given arch.
 .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 

diff --git a/man/qcheck.1 b/man/qcheck.1
index ed90c86..2351ed3 100644
--- a/man/qcheck.1
+++ b/man/qcheck.1
@@ -1,4 +1,5 @@
-.TH qcheck "1" "Mar 2016" "Gentoo Foundation" "qcheck"
+.\" generated by mkman.py, please do NOT edit!
+.TH qcheck "1" "Apr 2018" "Gentoo Foundation" "qcheck"
 .SH NAME
 qcheck \- verify integrity of installed packages
 .SH SYNOPSIS
@@ -9,51 +10,52 @@ qcheck \- verify integrity of installed packages
 .SH OPTIONS
 .TP
 \fB\-s\fR \fI\fR, \fB\-\-skip\fR \fI\fR
-Ignore files matching the regular expression 
+Ignore files matching the regular expression

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

2014-03-10 Thread Mike Frysinger
commit: 6bc6b925108cdfaed498ebf507ac592721b357b5
Author: Mike Frysinger  gentoo  org>
AuthorDate: Tue Mar 11 04:47:33 2014 +
Commit: Mike Frysinger  gentoo  org>
CommitDate: Tue Mar 11 04:47:33 2014 +
URL:
http://git.overlays.gentoo.org/gitweb/?p=proj/portage-utils.git;a=commit;h=6bc6b925

man: regenerate

---
 man/q.1|  5 -
 man/qatom.1|  5 -
 man/qcache.1   |  5 -
 man/qcheck.1   |  5 -
 man/qdepends.1 | 24 ++--
 man/qfile.1|  5 -
 man/qgrep.1|  5 -
 man/qlist.1| 13 -
 man/qlop.1 |  5 -
 man/qmerge.1   |  8 +++-
 man/qpkg.1 |  5 -
 man/qsearch.1  |  5 -
 man/qsize.1|  5 -
 man/qtbz2.1|  5 -
 man/quse.1 |  5 -
 man/qxpak.1|  5 -
 16 files changed, 89 insertions(+), 21 deletions(-)

diff --git a/man/q.1 b/man/q.1
index 59aa68d..322e1af 100644
--- a/man/q.1
+++ b/man/q.1
@@ -1,4 +1,4 @@
-.TH q "1" "Sep 2013" "Gentoo Foundation" "q"
+.TH q "1" "Mar 2014" "Gentoo Foundation" "q"
 .SH NAME
 q \- invoke a portage utility applet
 .SH SYNOPSIS
@@ -20,6 +20,9 @@ Reinitialize metadata cache
 \fB\-M\fR \fI\fR, \fB\-\-modpath\fR \fI\fR
 Module path
 .TP
+\fB\-\-root\fR \fI\fR
+Set the ROOT env var
+.TP
 \fB\-v\fR, \fB\-\-verbose\fR
 Make a lot of noise
 .TP

diff --git a/man/qatom.1 b/man/qatom.1
index 934546d..b4bc8ce 100644
--- a/man/qatom.1
+++ b/man/qatom.1
@@ -1,4 +1,4 @@
-.TH qatom "1" "Sep 2013" "Gentoo Foundation" "qatom"
+.TH qatom "1" "Mar 2014" "Gentoo Foundation" "qatom"
 .SH NAME
 qatom \- split atom strings
 .SH SYNOPSIS
@@ -11,6 +11,9 @@ qatom \- split atom strings
 \fB\-c\fR, \fB\-\-compare\fR
 Compare two atoms
 .TP
+\fB\-\-root\fR \fI\fR
+Set the ROOT env var
+.TP
 \fB\-v\fR, \fB\-\-verbose\fR
 Make a lot of noise
 .TP

diff --git a/man/qcache.1 b/man/qcache.1
index 549777d..1f46e4b 100644
--- a/man/qcache.1
+++ b/man/qcache.1
@@ -1,4 +1,4 @@
-.TH qcache "1" "Sep 2013" "Gentoo Foundation" "qcache"
+.TH qcache "1" "Mar 2014" "Gentoo Foundation" "qcache"
 .SH NAME
 qcache \- search the metadata cache
 .SH SYNOPSIS
@@ -32,6 +32,9 @@ list packages that have at least one version keyworded for on 
a given arch
 \fB\-n\fR, \fB\-\-not\fR
 list packages that aren't keyworded on a given arch.
 .TP
+\fB\-\-root\fR \fI\fR
+Set the ROOT env var
+.TP
 \fB\-v\fR, \fB\-\-verbose\fR
 Make a lot of noise
 .TP

diff --git a/man/qcheck.1 b/man/qcheck.1
index a830023..3633311 100644
--- a/man/qcheck.1
+++ b/man/qcheck.1
@@ -1,4 +1,4 @@
-.TH qcheck "1" "Sep 2013" "Gentoo Foundation" "qcheck"
+.TH qcheck "1" "Mar 2014" "Gentoo Foundation" "qcheck"
 .SH NAME
 qcheck \- verify integrity of installed packages
 .SH SYNOPSIS
@@ -38,6 +38,9 @@ Ignore files in CONFIG_PROTECT-ed paths
 \fB\-p\fR, \fB\-\-prelink\fR
 Undo prelink when calculating checksums
 .TP
+\fB\-\-root\fR \fI\fR
+Set the ROOT env var
+.TP
 \fB\-v\fR, \fB\-\-verbose\fR
 Make a lot of noise
 .TP

diff --git a/man/qdepends.1 b/man/qdepends.1
index 2014c3f..3b316a0 100644
--- a/man/qdepends.1
+++ b/man/qdepends.1
@@ -1,4 +1,4 @@
-.TH qdepends "1" "Sep 2013" "Gentoo Foundation" "qdepends"
+.TH qdepends "1" "Mar 2014" "Gentoo Foundation" "qdepends"
 .SH NAME
 qdepends \- show dependency info
 .SH SYNOPSIS
@@ -13,6 +13,9 @@ By default, it will tell you the build time dependencies only 
(DEPEND).
 
 Currently, qdepends will only query installed packages.  There is no support 
for
 querying packages not yet installed (the \fBequery\fR(1) tool can do that).
+
+If there is no answer to your query (i.e. you've asked for a package that is 
not
+installed, or a version that does not match), then you will get back no output.
 .SH OPTIONS
 .TP
 \fB\-d\fR, \fB\-\-depend\fR
@@ -39,6 +42,9 @@ Show all DEPEND info
 \fB\-f\fR, \fB\-\-format\fR
 Pretty format specified depend strings
 .TP
+\fB\-\-root\fR \fI\fR
+Set the ROOT env var
+.TP
 \fB\-v\fR, \fB\-\-verbose\fR
 Make a lot of noise
 .TP
@@ -71,4 +77,18 @@ Ned Ludd 
 Mike Frysinger 
 .fi
 .SH "SEE ALSO"
-
+.BR q (1),
+.BR qatom (1),
+.BR qcache (1),
+.BR qcheck (1),
+.BR qfile (1),
+.BR qgrep (1),
+.BR qlist (1),
+.BR qlop (1),
+.BR qmerge (1),
+.BR qpkg (1),
+.BR qsearch (1),
+.BR qsize (1),
+.BR qtbz2 (1),
+.BR quse (1),
+.BR qxpak (1)

diff --git a/man/qfile.1 b/man/qfile.1
index a651a95..83dacfb 100644
--- a/man/qfile.1
+++ b/man/qfile.1
@@ -1,4 +1,4 @@
-.TH qfile "1" "Sep 2013" "Gentoo Foundation" "qfile"
+.TH qfile "1" "Mar 2014" "Gentoo Foundation" "qfile"
 .SH NAME
 qfile \- list all pkgs owning files
 .SH SYNOPSIS
@@ -32,6 +32,9 @@ Don't look in package  (used with --orphans)
 \fB\-e\fR, \fB\-\-exact\fR
 Exact match (used with --exclude)
 .TP
+\fB\-\-root\fR \fI\fR
+Set the ROOT env var
+.TP
 \fB\-v\fR, \fB\-\-verbose\fR
 Make a lot of noise
 .TP

diff --git a/man/qgrep.1 b/man/qgrep.1
index 6858b70..1ff4797 100644
--- a/man/qgrep.1
+++ b/man/qgrep.1
@@ -1,4 +1,4 @@
-.TH qgrep "1" "Sep 2013" "Gentoo Foundation" "qgrep"
+.TH qgrep "1" "Mar 2014" "Gentoo Foun

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

2016-02-04 Thread Mike Frysinger
commit: d63a4b1b586b4a1f5f6d841af582bb7fd1bcecff
Author: Mike Frysinger  gentoo  org>
AuthorDate: Thu Feb  4 17:56:41 2016 +
Commit: Mike Frysinger  gentoo  org>
CommitDate: Thu Feb  4 17:56:41 2016 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=d63a4b1b

man: get mkman.py working under py2 & py3

 man/mkman.py | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/man/mkman.py b/man/mkman.py
index cd0fa7a..1ec8584 100755
--- a/man/mkman.py
+++ b/man/mkman.py
@@ -1,4 +1,5 @@
 #!/usr/bin/python
+# -*- coding: utf-8 -*-
 
 """Generate man pages for the q applets"""
 
@@ -25,7 +26,7 @@ Q = os.path.join(TOPDIR, 'q')
 def FindApplets():
 """Return a list of all supported applets"""
 applets = os.path.join(TOPDIR, 'applets.sh')
-return subprocess.check_output([applets]).splitlines()
+return subprocess.check_output([applets]).decode('ascii').splitlines()
 
 
 COMMON_AUTHORS = [
@@ -61,7 +62,7 @@ def MkMan(applets, applet, output):
 
 # Extract the main use string and description:
 # Usage: q: invoke a portage utility applet
-ahelp = subprocess.check_output([Q, applet, '--help'])
+ahelp = subprocess.check_output([Q, applet, '--help']).decode('ascii')
 lines = ahelp.splitlines()
 m = re.search(r'^Usage: %s (.*) : (.*)' % applet, ahelp)
 usage = m.group(1)
@@ -77,7 +78,7 @@ def MkMan(applets, applet, output):
 
 # Extract all the options
 options = []
-for line, i in zip(lines, xrange(len(lines))):
+for line, i in zip(lines, range(len(lines))):
 if not line.startswith('Options: '):
 continue
 



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

2016-03-27 Thread Mike Frysinger
commit: f27b1c430a13ed45dba638f2390e6a22f7199f8f
Author: Mike Frysinger  gentoo  org>
AuthorDate: Sun Mar 27 16:42:58 2016 +
Commit: Mike Frysinger  gentoo  org>
CommitDate: Sun Mar 27 16:42:58 2016 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=f27b1c43

usage: handle optional args, and auto-align display

Since --help is not performance sensitive, add a bit of logic to auto
align the width of the help columns.

 main.c   | 24 
 man/mkman.py |  4 ++--
 2 files changed, 22 insertions(+), 6 deletions(-)

diff --git a/main.c b/main.c
index d366bef..e9bacda 100644
--- a/main.c
+++ b/main.c
@@ -117,7 +117,11 @@ void no_colors(void)
 static void usage(int status, const char *flags, struct option const opts[],
   const char * const help[], int blabber)
 {
-   unsigned long i;
+   const char opt_arg[] = "[arg]";
+   const char a_arg[] = "";
+   size_t a_arg_len = strlen(a_arg) + 1;
+   size_t i, optlen;
+
if (status != EXIT_SUCCESS)
dup2(STDERR_FILENO, STDOUT_FILENO);
if (blabber == 0) {
@@ -140,6 +144,15 @@ static void usage(int status, const char *flags, struct 
option const opts[],
if (module_name != NULL)
printf("%sLoaded module:%s\n%s%8s%s %s%s\n", GREEN, NORM, 
YELLOW, module_name, NORM, DKBLUE, NORM);
 
+   /* Prescan the --long opt length to auto-align. */
+   optlen = 0;
+   for (i = 0; opts[i].name; ++i) {
+   size_t l = strlen(opts[i].name);
+   if (opts[i].has_arg != no_argument)
+   l += a_arg_len;
+   optlen = MAX(l, optlen);
+   }
+
printf("\n%sOptions:%s -[%s]\n", GREEN, NORM, flags);
for (i = 0; opts[i].name; ++i) {
/* this assert is a life saver when adding new applets. */
@@ -153,11 +166,14 @@ static void usage(int status, const char *flags, struct 
option const opts[],
 
/* then the long flag + help text */
if (opts[i].has_arg == no_argument)
-   printf("--%-15s%s*%s %s\n", opts[i].name,
+   printf("--%-*s %s*%s %s\n", (int)optlen, opts[i].name,
RED, NORM, _(help[i]));
else
-   printf("--%-8s %s%s %s*%s %s\n", opts[i].name,
-   DKBLUE, NORM, RED, NORM, _(help[i]));
+   printf("--%s %s%s%s%*s %s*%s %s\n",
+   opts[i].name,
+   DKBLUE, (opts[i].has_arg == a_argument ? a_arg 
: opt_arg), NORM,
+   (int)(optlen - strlen(opts[i].name) - 
a_arg_len), "",
+   RED, NORM, _(help[i]));
}
exit(status);
 }

diff --git a/man/mkman.py b/man/mkman.py
index 1ec8584..0751b92 100755
--- a/man/mkman.py
+++ b/man/mkman.py
@@ -89,8 +89,8 @@ def MkMan(applets, applet, output):
 flags += [option[0].rstrip(',')]
 option.pop(0)
 
-if option[0] == '':
-flags = [r'\fB%s\fR \fI\fR' % x for x in flags]
+if option[0] in ('', '[arg]'):
+flags = [r'\fB%s\fR \fI%s\fR' % (x, option[0]) for x in flags]
 option.pop(0)
 else:
 flags = [r'\fB%s\fR' % x for x in flags]



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

2016-03-27 Thread Mike Frysinger
commit: d81fc0710ae12ce026053163370ab3dac5c1b1a5
Author: Mike Frysinger  gentoo  org>
AuthorDate: Mon Mar 28 03:53:50 2016 +
Commit: Mike Frysinger  gentoo  org>
CommitDate: Mon Mar 28 03:53:50 2016 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=d81fc071

usage: add an extended text section

Many applets now are so complicated that a single line of text isn't
sufficient to describe all of its capabilities/nuances.  Allow them
to pass in an arbitrary string of data to contain examples.

 main.c | 13 -
 man/qatom.1|  4 ++--
 man/qcache.1   |  4 ++--
 man/qcheck.1   |  4 ++--
 man/qdepends.1 |  4 ++--
 man/qfile.1|  4 ++--
 man/qgrep.1|  4 ++--
 man/qlist.1|  4 ++--
 man/qlop.1 |  2 +-
 man/qmerge.1   |  4 ++--
 man/qpkg.1 |  4 ++--
 man/qsearch.1  |  4 ++--
 man/qsize.1|  4 ++--
 man/qtbz2.1|  4 ++--
 man/quse.1 |  4 ++--
 man/qxpak.1|  4 ++--
 q.c|  2 +-
 qatom.c|  2 +-
 qcache.c   |  2 +-
 qcheck.c   |  2 +-
 qdepends.c |  2 +-
 qfile.c|  2 +-
 qglsa.c|  2 +-
 qgrep.c|  2 +-
 qlist.c|  2 +-
 qlop.c |  9 -
 qmerge.c   |  2 +-
 qpkg.c |  2 +-
 qsearch.c  |  2 +-
 qsize.c|  2 +-
 qtbz2.c|  2 +-
 quse.c |  2 +-
 qxpak.c|  2 +-
 template.c |  2 +-
 34 files changed, 62 insertions(+), 52 deletions(-)

diff --git a/main.c b/main.c
index 0834756..a50b451 100644
--- a/main.c
+++ b/main.c
@@ -115,7 +115,7 @@ void no_colors(void)
 
 /* display usage and exit */
 static void usage(int status, const char *flags, struct option const opts[],
-  const char * const help[], int blabber)
+  const char * const help[], const char *desc, int blabber)
 {
const char opt_arg[] = "[arg]";
const char a_arg[] = "";
@@ -136,10 +136,13 @@ static void usage(int status, const char *flags, struct 
option const opts[],
DKBLUE, applets[i].opts, NORM,
RED, NORM, _(applets[i].desc));
} else if (blabber > 0) {
-   printf("%sUsage:%s %s%s%s  %s%s%s %s:%s %s\n", 
GREEN, NORM,
-   YELLOW, applets[blabber].name, NORM,
-   DKBLUE, applets[blabber].opts, NORM,
-   RED, NORM, _(applets[blabber].desc));
+   printf("%sUsage:%s %s%s%s [opts] %s%s%s %s:%s %s\n",
+   GREEN, NORM,
+   YELLOW, applets[blabber].name, NORM,
+   DKBLUE, applets[blabber].opts, NORM,
+   RED, NORM, _(applets[blabber].desc));
+   if (desc)
+   printf("\n%s\n", desc);
}
if (module_name != NULL)
printf("%sLoaded module:%s\n%s%8s%s %s%s\n", GREEN, NORM, 
YELLOW, module_name, NORM, DKBLUE, NORM);

diff --git a/man/qatom.1 b/man/qatom.1
index 42991a5..4a30343 100644
--- a/man/qatom.1
+++ b/man/qatom.1
@@ -1,9 +1,9 @@
-.TH qatom "1" "Feb 2016" "Gentoo Foundation" "qatom"
+.TH qatom "1" "Mar 2016" "Gentoo Foundation" "qatom"
 .SH NAME
 qatom \- split atom strings
 .SH SYNOPSIS
 .B qatom
-\fI \fR
+\fI[opts] \fR
 .SH DESCRIPTION
 
 .SH OPTIONS

diff --git a/man/qcache.1 b/man/qcache.1
index 1f46e4b..81ae2fa 100644
--- a/man/qcache.1
+++ b/man/qcache.1
@@ -1,9 +1,9 @@
-.TH qcache "1" "Mar 2014" "Gentoo Foundation" "qcache"
+.TH qcache "1" "Mar 2016" "Gentoo Foundation" "qcache"
 .SH NAME
 qcache \- search the metadata cache
 .SH SYNOPSIS
 .B qcache
-\fI  \fR
+\fI[opts]  \fR
 .SH DESCRIPTION
 
 .SH OPTIONS

diff --git a/man/qcheck.1 b/man/qcheck.1
index b686662..ed90c86 100644
--- a/man/qcheck.1
+++ b/man/qcheck.1
@@ -1,9 +1,9 @@
-.TH qcheck "1" "Feb 2016" "Gentoo Foundation" "qcheck"
+.TH qcheck "1" "Mar 2016" "Gentoo Foundation" "qcheck"
 .SH NAME
 qcheck \- verify integrity of installed packages
 .SH SYNOPSIS
 .B qcheck
-\fI \fR
+\fI[opts] \fR
 .SH DESCRIPTION
 
 .SH OPTIONS

diff --git a/man/qdepends.1 b/man/qdepends.1
index 3b316a0..a0cac5b 100644
--- a/man/qdepends.1
+++ b/man/qdepends.1
@@ -1,9 +1,9 @@
-.TH qdepends "1" "Mar 2014" "Gentoo Foundation" "qdepends"
+.TH qdepends "1" "Mar 2016" "Gentoo Foundation" "qdepends"
 .SH NAME
 qdepends \- show dependency info
 .SH SYNOPSIS
 .B qdepends
-\fI \fR
+\fI[opts] \fR
 .SH DESCRIPTION
 The qdepends applet has a couple different modes.  Normally it is geared 
towards
 answering the queries "what does package X depend on" and "what packages depend

diff --git a/man/qfile.1 b/man/qfile.1
index 54823cd..e57e8e3 100644
--- a/man/qfile.1
+++ b/man/qfile.1
@@ -1,9 +1,9 @@
-.TH qfile "1" "Feb 2016" "Gentoo Foundation" "qfile"
+.TH qfile "1" "Mar 2016" "Gentoo Foundation" "qfile"
 .SH NAME
 qfile \- list all pkgs owning files
 .SH SYNOPSIS
 .B qfile
-\fI \fR
+\fI[opts] \fR
 .SH DESCRIPTION
 
 .SH OPTIONS

diff --git a/man/qg

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

2016-06-19 Thread Mike Frysinger
commit: 3040132ef330e83c1a04f05eda333c79ae4868a8
Author: Mike Frysinger  gentoo  org>
AuthorDate: Mon Jun 20 03:10:38 2016 +
Commit: Mike Frysinger  gentoo  org>
CommitDate: Mon Jun 20 03:10:38 2016 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=3040132e

man: drop qfile --from docs (part 2)

Have to regen the man page after updating its fragment.

 man/qfile.1 | 63 +
 1 file changed, 1 insertion(+), 62 deletions(-)

diff --git a/man/qfile.1 b/man/qfile.1
index e57e8e3..5bd58c7 100644
--- a/man/qfile.1
+++ b/man/qfile.1
@@ -1,4 +1,4 @@
-.TH qfile "1" "Mar 2016" "Gentoo Foundation" "qfile"
+.TH qfile "1" "Jun 2016" "Gentoo Foundation" "qfile"
 .SH NAME
 qfile \- list all pkgs owning files
 .SH SYNOPSIS
@@ -148,67 +148,6 @@ Sure, the same differences hold when querying for orphan 
files:
$ ROOT=/mnt qfile -Ro /mnt/bin/*
/mnt/bin/dostuff.sh
 .fi
-.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
 .SH "SEARCHING FOR FILE COLLISIONS"
 .PP
 A last option of \fBqfile\fP is \fB\-\-exclude\fP (\fB\-x\fP), which will makes



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

2016-02-22 Thread Mike Frysinger
commit: dcec34fcf04c0399efc466adf770d60dc145129f
Author: Mike Frysinger  gentoo  org>
AuthorDate: Mon Feb 22 17:49:25 2016 +
Commit: Mike Frysinger  gentoo  org>
CommitDate: Mon Feb 22 17:49:25 2016 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=dcec34fc

qsize: change interface to operate on atoms

We also drop the --all flag as it's now the default behavior.
If no atoms are specified, we just check everything.

 man/qsize.1 |  5 +
 qsize.c | 49 -
 2 files changed, 33 insertions(+), 21 deletions(-)

diff --git a/man/qsize.1 b/man/qsize.1
index ca6a352..af32869 100644
--- a/man/qsize.1
+++ b/man/qsize.1
@@ -1,4 +1,4 @@
-.TH qsize "1" "Mar 2014" "Gentoo Foundation" "qsize"
+.TH qsize "1" "Feb 2016" "Gentoo Foundation" "qsize"
 .SH NAME
 qsize \- calculate size usage
 .SH SYNOPSIS
@@ -11,9 +11,6 @@ qsize \- calculate size usage
 \fB\-f\fR, \fB\-\-filesystem\fR
 Show size used on disk
 .TP
-\fB\-a\fR, \fB\-\-all\fR
-Size all installed packages
-.TP
 \fB\-s\fR, \fB\-\-sum\fR
 Include a summary
 .TP

diff --git a/qsize.c b/qsize.c
index 3a11842..7a40141 100644
--- a/qsize.c
+++ b/qsize.c
@@ -8,10 +8,9 @@
 
 #ifdef APPLET_qsize
 
-#define QSIZE_FLAGS "fasSmkbi:" COMMON_FLAGS
+#define QSIZE_FLAGS "fsSmkbi:" COMMON_FLAGS
 static struct option const qsize_long_opts[] = {
{"filesystem", no_argument, NULL, 'f'},
-   {"all",no_argument, NULL, 'a'},
{"sum",no_argument, NULL, 's'},
{"sum-only",   no_argument, NULL, 'S'},
{"megabytes",  no_argument, NULL, 'm'},
@@ -22,7 +21,6 @@ static struct option const qsize_long_opts[] = {
 };
 static const char * const qsize_opts_help[] = {
"Show size used on disk",
-   "Size all installed packages",
"Include a summary",
"Show just the summary",
"Display size in megabytes",
@@ -39,7 +37,6 @@ int qsize_main(int argc, char **argv)
q_vdb_cat_ctx *cat_ctx;
q_vdb_pkg_ctx *pkg_ctx;
size_t i;
-   char search_all = 0;
struct stat st;
char fs_size = 0, summary = 0, summary_only = 0;
size_t num_all_files, num_all_nonfiles, num_all_ignored;
@@ -50,13 +47,14 @@ int qsize_main(int argc, char **argv)
size_t buflen;
char *buf;
char filename[_Q_PATH_MAX], *filename_root;
+   depend_atom *atom;
+   DECLARE_ARRAY(atoms);
DECLARE_ARRAY(ignore_regexp);
 
while ((i = GETOPT_LONG(QSIZE, qsize, "")) != -1) {
switch (i) {
COMMON_GETOPTS_CASES(qsize)
case 'f': fs_size = 1; break;
-   case 'a': search_all = 1; break;
case 's': summary = 1; break;
case 'S': summary = summary_only = 1; break;
case 'm': disp_units = MEGABYTE; str_disp_units = "MiB"; break;
@@ -70,8 +68,16 @@ int qsize_main(int argc, char **argv)
}
}
}
-   if ((argc == optind) && !search_all)
-   qsize_usage(EXIT_FAILURE);
+
+   argc -= optind;
+   argv += optind;
+   for (i = 0; i < argc; ++i) {
+   atom = atom_explode(argv[i]);
+   if (!atom)
+   warn("invalid atom: %s", argv[i]);
+   else
+   xarraypush_ptr(atoms, atom);
+   }
 
num_all_bytes = num_all_files = num_all_nonfiles = num_all_ignored = 0;
 
@@ -91,18 +97,24 @@ int qsize_main(int argc, char **argv)
while ((pkg_ctx = q_vdb_next_pkg(cat_ctx))) {
const char *pkgname = pkg_ctx->name;
FILE *fp;
+   bool showit = false;
+
/* see if this cat/pkg is requested */
-   if (!search_all) {
-   for (i = optind; i < argc; ++i) {
-   snprintf(buf, buflen, "%s/%s", catname, 
pkgname);
-   if (rematch(argv[i], buf, REG_EXTENDED) 
== 0)
+   if (array_cnt(atoms)) {
+   depend_atom *qatom;
+
+   snprintf(buf, buflen, "%s/%s", catname, 
pkgname);
+   qatom = atom_explode(buf);
+   array_for_each(atoms, i, atom)
+   if (atom_compare(atom, qatom) == EQUAL) 
{
+   showit = true;
break;
-   if (rematch(argv[i], pkgname, 
REG_EXTENDED) == 0)
-   break;
-   }
-   if (i == argc)
-   goto next_pkg;
-   }
+   }
+   atom_implode(qatom);
+  

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

2016-02-22 Thread Mike Frysinger
commit: 1dbce6aec3b91f9efb13df94c5a8e5c33ea65a4c
Author: Mike Frysinger  gentoo  org>
AuthorDate: Mon Feb 22 18:31:41 2016 +
Commit: Mike Frysinger  gentoo  org>
CommitDate: Mon Feb 22 18:31:41 2016 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=1dbce6ae

man: regen manpages

 man/qatom.1  | 5 -
 man/qfile.1  | 8 +---
 man/qlist.1  | 4 ++--
 man/qlop.1   | 4 ++--
 man/qmerge.1 | 5 +
 5 files changed, 10 insertions(+), 16 deletions(-)

diff --git a/man/qatom.1 b/man/qatom.1
index b4bc8ce..42991a5 100644
--- a/man/qatom.1
+++ b/man/qatom.1
@@ -1,4 +1,4 @@
-.TH qatom "1" "Mar 2014" "Gentoo Foundation" "qatom"
+.TH qatom "1" "Feb 2016" "Gentoo Foundation" "qatom"
 .SH NAME
 qatom \- split atom strings
 .SH SYNOPSIS
@@ -8,6 +8,9 @@ qatom \- split atom strings
 
 .SH OPTIONS
 .TP
+\fB\-F\fR \fI\fR, \fB\-\-format\fR \fI\fR
+Custom output format (default: %{CATEGORY} %{PN} %{PV} %[PR] %[SLOT] %[pfx] 
%[sfx])
+.TP
 \fB\-c\fR, \fB\-\-compare\fR
 Compare two atoms
 .TP

diff --git a/man/qfile.1 b/man/qfile.1
index 83dacfb..54823cd 100644
--- a/man/qfile.1
+++ b/man/qfile.1
@@ -1,4 +1,4 @@
-.TH qfile "1" "Mar 2014" "Gentoo Foundation" "qfile"
+.TH qfile "1" "Feb 2016" "Gentoo Foundation" "qfile"
 .SH NAME
 qfile \- list all pkgs owning files
 .SH SYNOPSIS
@@ -14,12 +14,6 @@ Display installed packages with slots
 \fB\-R\fR, \fB\-\-root\-prefix\fR
 Assume arguments are already prefixed by $ROOT
 .TP
-\fB\-f\fR \fI\fR, \fB\-\-from\fR \fI\fR
-Read arguments from file  ("-" for stdin)
-.TP
-\fB\-m\fR \fI\fR, \fB\-\-max\-args\fR \fI\fR
-Treat from file arguments by groups of  (defaults to 5000)
-.TP
 \fB\-b\fR, \fB\-\-basename\fR
 Match any component of the path
 .TP

diff --git a/man/qlist.1 b/man/qlist.1
index eee563d..eedc2cd 100644
--- a/man/qlist.1
+++ b/man/qlist.1
@@ -1,4 +1,4 @@
-.TH qlist "1" "Mar 2014" "Gentoo Foundation" "qlist"
+.TH qlist "1" "Feb 2016" "Gentoo Foundation" "qlist"
 .SH NAME
 qlist \- list files owned by pkgname
 .SH SYNOPSIS
@@ -12,7 +12,7 @@ qlist \- list files owned by pkgname
 Just show installed packages
 .TP
 \fB\-S\fR, \fB\-\-slots\fR
-Display installed packages with slots
+Display installed packages with slots (use twice for subslots)
 .TP
 \fB\-R\fR, \fB\-\-repo\fR
 Display installed packages with repository

diff --git a/man/qlop.1 b/man/qlop.1
index 26ef7b5..6e645a8 100644
--- a/man/qlop.1
+++ b/man/qlop.1
@@ -1,4 +1,4 @@
-.TH qlop "1" "Mar 2014" "Gentoo Foundation" "qlop"
+.TH qlop "1" "Feb 2016" "Gentoo Foundation" "qlop"
 .SH NAME
 qlop \- emerge log analyzer
 .SH SYNOPSIS
@@ -30,7 +30,7 @@ Show sync history
 Show current emerging packages
 .TP
 \fB\-f\fR \fI\fR, \fB\-\-logfile\fR \fI\fR
-Read emerge logfile instead of /var/log/emerge.log
+Read emerge logfile instead of $EMERGE_LOG_DIR/emerge.log
 .TP
 \fB\-\-root\fR \fI\fR
 Set the ROOT env var

diff --git a/man/qmerge.1 b/man/qmerge.1
index 558a810..df928f1 100644
--- a/man/qmerge.1
+++ b/man/qmerge.1
@@ -1,4 +1,4 @@
-.TH qmerge "1" "Mar 2014" "Gentoo Foundation" "qmerge"
+.TH qmerge "1" "Feb 2016" "Gentoo Foundation" "qmerge"
 .SH NAME
 qmerge \- fetch and merge binary package
 .SH SYNOPSIS
@@ -35,9 +35,6 @@ Don't prompt before overwriting
 \fB\-O\fR, \fB\-\-nodeps\fR
 Don't merge dependencies
 .TP
-\fB\-5\fR, \fB\-\-nomd5\fR
-Don't verify MD5 digest of files
-.TP
 \fB\-\-debug\fR
 Run shell funcs with `set -x`
 .TP



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

2022-05-26 Thread Fabian Groffen
commit: d301ed27e28417f185c374a044cfabeb32beb607
Author: Fabian Groffen  gentoo  org>
AuthorDate: Thu May 26 14:32:32 2022 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Thu May 26 14:32:32 2022 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=d301ed27

qdepends: add --resolve flag to lookup depstrings

This doesn't respect keywords or masks, but with installed packages
shows which packages currently match the deps as expressed

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

 man/qdepends.1 | 11 ++-
 qdepends.c | 51 +++
 2 files changed, 45 insertions(+), 17 deletions(-)

diff --git a/man/qdepends.1 b/man/qdepends.1
index 0690f16..5e5b00a 100644
--- a/man/qdepends.1
+++ b/man/qdepends.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qdepends "1" "Feb 2021" "Gentoo Foundation" "qdepends"
+.TH qdepends "1" "May 2022" "Gentoo Foundation" "qdepends"
 .SH NAME
 qdepends \- show dependency info
 .SH SYNOPSIS
@@ -68,6 +68,9 @@ Search installed packages using VDB.
 \fB\-t\fR, \fB\-\-tree\fR
 Search available ebuilds in the tree.
 .TP
+\fB\-U\fR, \fB\-\-use\fR
+Apply profile USE-flags to conditional deps.
+.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
@@ -82,6 +85,9 @@ e.g.\ the DEPEND= part is skipped.
 \fB\-S\fR, \fB\-\-pretty\fR
 Pretty format specified depend strings.
 .TP
+\fB\-R\fR, \fB\-\-resolve\fR
+Resolve found dependencies to package versions.
+.TP
 \fB\-\-root\fR \fI\fR
 Set the ROOT env var.
 .TP
@@ -97,6 +103,9 @@ Suppress DEPEND= output for \fB\-f\fR.  Only print the 
matching atom for \fB\-Q\
 \fB\-C\fR, \fB\-\-nocolor\fR
 Don't output color.
 .TP
+\fB\-\-color\fR
+Force color in output.
+.TP
 \fB\-h\fR, \fB\-\-help\fR
 Print this help and exit.
 .TP

diff --git a/qdepends.c b/qdepends.c
index f1bc3ad..bd7c379 100644
--- a/qdepends.c
+++ b/qdepends.c
@@ -22,7 +22,7 @@
 #include "xasprintf.h"
 #include "xregex.h"
 
-#define QDEPENDS_FLAGS "drpbQitUF:S" COMMON_FLAGS
+#define QDEPENDS_FLAGS "drpbQitUF:SR" COMMON_FLAGS
 static struct option const qdepends_long_opts[] = {
{"depend",no_argument, NULL, 'd'},
{"rdepend",   no_argument, NULL, 'r'},
@@ -34,6 +34,7 @@ static struct option const qdepends_long_opts[] = {
{"use",   no_argument, NULL, 'U'},
{"format", a_argument, NULL, 'F'},
{"pretty",no_argument, NULL, 'S'},
+   {"resolve",   no_argument, NULL, 'R'},
COMMON_LONG_OPTS
 };
 static const char * const qdepends_opts_help[] = {
@@ -47,20 +48,23 @@ static const char * const qdepends_opts_help[] = {
"Apply profile USE-flags to conditional deps",
"Print matched atom using given format string",
"Pretty format specified depend strings",
+   "Resolve found dependencies to package versions",
COMMON_OPTS_HELP
 };
 #define qdepends_usage(ret) usage(ret, QDEPENDS_FLAGS, qdepends_long_opts, 
qdepends_opts_help, NULL, lookup_applet_idx("qdepends"))
 
 /* structures / types / etc ... */
 struct qdepends_opt_state {
-   unsigned int qmode;
-   array_t *atoms;
-   array_t *deps;
-   set *udeps;
-   char *depend;
-   size_t depend_len;
-   const char *format;
-   tree_ctx *vdb;
+   unsigned int  qmode;
+   array_t  *atoms;
+   array_t  *deps;
+   set  *udeps;
+   char *depend;
+   size_tdepend_len;
+   const char   *format;
+   char  resolve:1;
+   tree_ctx *vdb;
+   tree_ctx *rtree;
 };
 
 #define QMODE_DEPEND (1<<0)
@@ -174,6 +178,10 @@ qdepends_results_cb(tree_pkg_ctx *pkg_ctx, void *priv)
continue;
}
 
+   /* try and resolve expressions to real package atoms */
+   if (state->resolve)
+   dep_resolve_tree(dep_tree, state->rtree);
+
if (state->qmode & QMODE_TREE &&
!(state->qmode & QMODE_REVERSE) &&
verbose)
@@ -301,12 +309,14 @@ int qdepends_main(int argc, char **argv)
DECLARE_ARRAY(atoms);
DECLARE_ARRAY(deps);
struct qdepends_opt_state state = {
-   .atoms = atoms,
-   .deps = deps,
-   .udeps = create_set(),
-   .qmode = 0,
-   .format = "%[CATEGORY]%[PF]",
-   .vdb = NULL,
+   .atoms   = atoms,
+   .deps= deps,
+   .udeps   = create_set(),
+   .qmode   = 0,
+   .format  = "%[CATEGORY]%[PF]",
+   .resolve = false,
+   .vdb = NULL,
+   .rtree   = NULL,
};
size_t i;
int ret;
@@ -328,6 +338,7 @@ int qdepends_main(int argc, char **argv)
case 't': state.qmode

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

2021-02-17 Thread Fabian Groffen
commit: 307939315330f631f9f526f8560a2ce09605fc9c
Author: Fabian Groffen  gentoo  org>
AuthorDate: Wed Feb 17 20:19:58 2021 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Wed Feb 17 20:19:58 2021 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=30793931

qwhich: add applet to show paths to packages

e.g. to find the ebuild dir of bash in thw tree:
% qwhich -dt bash

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

 Makefile.am  |   3 +
 man/qwhich.1 |  79 +
 qwhich.c | 190 +++
 3 files changed, 272 insertions(+)

diff --git a/Makefile.am b/Makefile.am
index ceded24..cf578f4 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -23,6 +23,7 @@ APPLETS = \
qsize \
qtbz2 \
quse \
+   qwhich \
qxpak \
$(NULL)
 
@@ -42,6 +43,7 @@ dist_man_MANS = \
man/qsize.1 \
man/qtbz2.1 \
man/quse.1 \
+   man/qwhich.1 \
man/qxpak.1 \
$(NULL)
 
@@ -63,6 +65,7 @@ q_SOURCES = \
qsize.c \
qtbz2.c \
quse.c \
+   qwhich.c \
qxpak.c \
$(NULL)
 q_CPPFLAGS = \

diff --git a/man/qwhich.1 b/man/qwhich.1
new file mode 100644
index 000..dce52c2
--- /dev/null
+++ b/man/qwhich.1
@@ -0,0 +1,79 @@
+.\" generated by mkman.py, please do NOT edit!
+.TH qwhich "1" "Feb 2021" "Gentoo Foundation" "qwhich"
+.SH NAME
+qwhich \- find path to pkg
+.SH SYNOPSIS
+.B qwhich
+\fI[opts] \fR
+.SH DESCRIPTION
+
+.SH OPTIONS
+.TP
+\fB\-I\fR, \fB\-\-vdb\fR
+Look in VDB (installed packages).
+.TP
+\fB\-b\fR, \fB\-\-binpkg\fR
+Look at binary packages.
+.TP
+\fB\-t\fR, \fB\-\-tree\fR
+Look in main tree and overlays.
+.TP
+\fB\-p\fR, \fB\-\-pretty\fR
+Print (pretty) atom instead of path for use with -F.
+.TP
+\fB\-d\fR, \fB\-\-dir\fR
+Print directory instead of path.
+.TP
+\fB\-f\fR, \fB\-\-first\fR
+Stop searching after first match.
+.TP
+\fB\-F\fR \fI\fR, \fB\-\-format\fR \fI\fR
+Print matched using given format string.
+.TP
+\fB\-\-root\fR \fI\fR
+Set the ROOT env var.
+.TP
+\fB\-v\fR, \fB\-\-verbose\fR
+Report full package versions, emit more elaborate output.
+.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 "REPORTING BUGS"
+Please report bugs via http://bugs.gentoo.org/
+.br
+Product: Portage Development; Component: Tools
+.SH AUTHORS
+.nf
+Ned Ludd 
+Mike Frysinger 
+Fabian Groffen 
+.fi
+.SH "SEE ALSO"
+.BR q (1),
+.BR qatom (1),
+.BR qcheck (1),
+.BR qdepends (1),
+.BR qfile (1),
+.BR qgrep (1),
+.BR qkeyword (1),
+.BR qlist (1),
+.BR qlop (1),
+.BR qmanifest (1),
+.BR qmerge (1),
+.BR qpkg (1),
+.BR qsearch (1),
+.BR qsize (1),
+.BR qtbz2 (1),
+.BR qtegrity (1),
+.BR quse (1),
+.BR qxpak (1)

diff --git a/qwhich.c b/qwhich.c
new file mode 100644
index 000..3a0c791
--- /dev/null
+++ b/qwhich.c
@@ -0,0 +1,190 @@
+/*
+ * Copyright 2021 Gentoo Foundation
+ * Distributed under the terms of the GNU General Public License v2
+ *
+ * Copyright 2021- Fabian Groffen  - 
+ */
+
+#include "main.h"
+#include "applets.h"
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "atom.h"
+#include "tree.h"
+
+#define QWHICH_FLAGS "IbtpdfF:" COMMON_FLAGS
+static struct option const qwhich_long_opts[] = {
+   {"vdb",  no_argument, NULL, 'I'},
+   {"binpkg",   no_argument, NULL, 'b'},
+   {"tree", no_argument, NULL, 't'},
+   {"pretty",   no_argument, NULL, 'p'},
+   {"dir",  no_argument, NULL, 'd'},
+   {"first",no_argument, NULL, 'f'},
+   {"format",a_argument, NULL, 'F'},
+   COMMON_LONG_OPTS
+};
+static const char * const qwhich_opts_help[] = {
+   "Look in VDB (installed packages)",
+   "Look at binary packages",
+   "Look in main tree and overlays",
+   "Print (pretty) atom instead of path for use with -F",
+   "Print directory instead of path",
+   "Stop searching after first match",
+   "Print matched using given format string",
+   COMMON_OPTS_HELP
+};
+static const char qwhich_desc[] = "";
+#define qwhich_usage(ret) \
+   usage(ret, QWHICH_FLAGS, qwhich_long_opts, qwhich_opts_help, 
qwhich_desc, lookup_applet_idx("qwhich"))
+
+struct qwhich_mode {
+   char do_vdb:1;
+   char do_binpkg:1;
+   char do_tree:1;
+   char print_atom:1;
+   char print_path:1;
+   char match_first:1;
+   const char *fmt;
+};
+
+int qwhich_main(int argc, char **argv)
+{
+   depend_atom *atom;
+   DECLARE_ARRAY(atoms);
+   DECLARE_ARRAY(trees);
+   struct qwhich_mode m;
+   struct tree_match_ctx *tmc;
+   struct tree_match_ctx *tmcw;
+   size_t i;
+   size_t j;
+   char *overlay;
+   size_t n;
+   int ret;
+   tree_ctx *t;
+   int repol

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

2020-11-29 Thread Fabian Groffen
commit: 5fd373fadbdf3f0bc2733f4c6fee4fab71f76e69
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sun Nov 29 09:28:40 2020 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sun Nov 29 09:28:40 2020 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=5fd373fa

man: regenerate after alignment fix

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

 man/q.1 | 36 ++--
 man/qatom.1 |  2 +-
 man/qcheck.1|  2 +-
 man/qdepends.1  |  2 +-
 man/qfile.1 |  2 +-
 man/qgrep.1 |  2 +-
 man/qkeyword.1  |  2 +-
 man/qlist.1 |  2 +-
 man/qlop.1  | 15 +--
 man/qmanifest.1 |  2 +-
 man/qmerge.1|  2 +-
 man/qpkg.1  |  2 +-
 man/qsearch.1   |  2 +-
 man/qsize.1 |  2 +-
 man/qtbz2.1 |  2 +-
 man/qtegrity.1  |  2 +-
 man/quse.1  |  2 +-
 man/qxpak.1 |  2 +-
 18 files changed, 47 insertions(+), 36 deletions(-)

diff --git a/man/q.1 b/man/q.1
index 21a09b3..d98c3c3 100644
--- a/man/q.1
+++ b/man/q.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH q "1" "Dec 2019" "Gentoo Foundation" "q"
+.TH q "1" "Nov 2020" "Gentoo Foundation" "q"
 .SH NAME
 q \- invoke a portage utility applet
 .SH SYNOPSIS
@@ -58,24 +58,24 @@ Print version and exit.
 .SH APPLETS
 .nf
 .B This applet also has sub applets:
-q   : virtual applet
-qatom: split atom strings
-   qcheck: verify integrity of installed packages
- qdepends: show dependency info
-qfile   : list all pkgs owning files
-qgrep  [pkg ...]: grep in ebuilds
- qkeyword   : list packages based on keywords
-qlist: list files owned by pkgname
- qlop: emerge log analyzer
+ q   : virtual applet
+ qatom: split atom strings
+qcheck: verify integrity of installed packages
+  qdepends: show dependency info
+ qfile   : list all pkgs owning files
+ qgrep  [pkg ...]: grep in ebuilds
+  qkeyword   : list packages based on keywords
+ qlist: list files owned by pkgname
+  qlop: emerge log analyzer
  qmanifest  : verify or generate thick Manifest files
-   qmerge   : fetch and merge binary package
- qpkg  : create or manipulate Gentoo binpkgs
-  qsearch  : search pkgname/desc
-qsize: calculate size usage
-qtbz2  : manipulate tbz2 packages
- qtegrity  : verify files with IMA
- quse: find pkgs using useflags
-qxpak  : manipulate xpak archives
+qmerge   : fetch and merge binary package
+  qpkg  : create or manipulate Gentoo binpkgs
+   qsearch  : search pkgname/desc
+ qsize: calculate size usage
+ qtbz2  : manipulate tbz2 packages
+  qtegrity  : verify files with IMA
+  quse: find pkgs using useflags
+ qxpak  : manipulate xpak archives
 .fi
 .SH "REPORTING BUGS"
 Please report bugs via http://bugs.gentoo.org/

diff --git a/man/qatom.1 b/man/qatom.1
index 9ebb9a0..d8c7cd6 100644
--- a/man/qatom.1
+++ b/man/qatom.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qatom "1" "May 2020" "Gentoo Foundation" "qatom"
+.TH qatom "1" "Nov 2020" "Gentoo Foundation" "qatom"
 .SH NAME
 qatom \- split atom strings
 .SH SYNOPSIS

diff --git a/man/qcheck.1 b/man/qcheck.1
index a48c7f3..2473513 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 2019" "Gentoo Foundation" "qcheck"
+.TH qcheck "1" "Nov 2020" "Gentoo Foundation" "qcheck"
 .SH NAME
 qcheck \- verify integrity of installed packages
 .SH SYNOPSIS

diff --git a/man/qdepends.1 b/man/qdepends.1
index e8d1648..0eb7ba3 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 2019" "Gentoo Foundation" "qdepends"
+.TH qdepends "1" "Nov 2020" "Gentoo Foundation" "qdepends"
 .SH NAME
 qdepends \- show dependency info
 .SH SYNOPSIS

diff --git a/man/qfile.1 b/man/qfile.1
index 7caa459..ffe0968 100644
--- a/man/qfile.1
+++ b/man/qfile.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qfile "1" "May 2020" "Gentoo Foundation" "qfile"
+.TH qfile "1" "Nov 2020" "Gentoo Foundation" "qfile"
 .SH NAME
 qfile \- list all pkgs owning files
 .SH SYNOPSIS

diff --git a/man/qgrep.1 b/man/qgrep.1
index 2d73f4c..70d7eba 100644
--- a/man/qgrep.1
+++ b/man/qgrep.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qgrep "1" "Jan 2020" "Gentoo Foundation" "qgrep"
+.TH qgrep "1" "Nov 2020" "Gentoo Foundation" "qgrep"
 .SH NAME
 qgrep \- grep in ebuilds
 .SH SYNOPSIS

diff --git a/man/qkeyword.1 b/man/qkeyword.1
index 5a26218..d18bea6 100644
--- a/man/qkeyword.1
+++ b/man/qkeyword.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qkeyword "1" "Dec 2019" "Gentoo Foundation" "qkeyword"
+.TH qkeyword "1" "Nov 2020" "Gentoo Foundat

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

2019-09-10 Thread Fabian Groffen
commit: 3dc607a8a6cfd3bafbc2f10d9a7c3aae90c3a757
Author: Fabian Groffen  gentoo  org>
AuthorDate: Tue Sep 10 18:21:51 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Tue Sep 10 18:21:51 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=3dc607a8

qlop: add mode to print last run in a similar way like emerge(1) does

For example, the output could be like this, showing upgrade information:

% ./qlop -E -t
  U  app-shells/bash-5.0_p11 [5.0_p9-r0]: 2′38″
  U  app-admin/eselect-1.4.15 [1.4.14-r0]: 19s
  U  sys-libs/talloc-2.3.0 [2.2.0-r0]: 1′56″
  U  app-portage/prefix-toolkit-5 [4-r0]: 10s
  U  dev-python/cryptography-2.7 [2.6.1-r0]: 1′59″
  U  net-dns/bind-tools-9.14.5 [9.14.4-r0]: 4′17″
 R   dev-python/sphinxcontrib-applehelp-1.0.1: 28s
 R   dev-python/sphinxcontrib-devhelp-1.0.1: 27s
 R   dev-python/sphinxcontrib-jsmath-1.0.1: 25s
 R   dev-python/sphinxcontrib-htmlhelp-1.0.2: 28s
 R   dev-python/sphinxcontrib-serializinghtml-1.1.3: 28s
 R   dev-python/sphinxcontrib-qthelp-1.0.2: 28s
  U  dev-python/sphinx-2.0.1 [1.7.5-r1]: 1′13″
  U  net-mail/notmuch-0.29.1-r1 [0.28.4-r0]: 1′00″

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

 man/qlop.1 |  5 -
 qlop.c | 49 -
 2 files changed, 52 insertions(+), 2 deletions(-)

diff --git a/man/qlop.1 b/man/qlop.1
index baa5bf5..de1e525 100644
--- a/man/qlop.1
+++ b/man/qlop.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qlop "1" "Jul 2019" "Gentoo Foundation" "qlop"
+.TH qlop "1" "Sep 2019" "Gentoo Foundation" "qlop"
 .SH NAME
 qlop \- emerge log analyzer
 .SH SYNOPSIS
@@ -65,6 +65,9 @@ Show autoclean unmerge history.
 \fB\-s\fR, \fB\-\-sync\fR
 Show sync history.
 .TP
+\fB\-E\fR, \fB\-\-emerge\fR
+Show last merge like how emerge(1) -v would show it.
+.TP
 \fB\-e\fR, \fB\-\-endtime\fR
 Report time at which the operation finished (iso started).
 .TP

diff --git a/qlop.c b/qlop.c
index 243c8b6..3cc3367 100644
--- a/qlop.c
+++ b/qlop.c
@@ -24,7 +24,7 @@
 
 #define QLOP_DEFAULT_LOGFILE "emerge.log"
 
-#define QLOP_FLAGS "ctaHMmuUslerd:f:w:F:" COMMON_FLAGS
+#define QLOP_FLAGS "ctaHMmuUsElerd:f:w:F:" COMMON_FLAGS
 static struct option const qlop_long_opts[] = {
{"summary",   no_argument, NULL, 'c'},
{"time",  no_argument, NULL, 't'},
@@ -35,6 +35,7 @@ static struct option const qlop_long_opts[] = {
{"unmerge",   no_argument, NULL, 'u'},
{"autoclean", no_argument, NULL, 'U'},
{"sync",  no_argument, NULL, 's'},
+   {"emerge",no_argument, NULL, 'E'},
{"endtime",   no_argument, NULL, 'e'},
{"running",   no_argument, NULL, 'r'},
{"date",   a_argument, NULL, 'd'},
@@ -54,6 +55,7 @@ static const char * const qlop_opts_help[] = {
"Show unmerge history",
"Show autoclean unmerge history",
"Show sync history",
+   "Show last merge like how emerge(1) -v would show it",
"Report time at which the operation finished (iso started)",
"Show current emerging packages",
"Limit selection to this time (1st -d is start, 2nd -d is end)",
@@ -85,6 +87,7 @@ struct qlop_mode {
char do_machine:1;
char do_endtime:1;
char show_lastmerge:1;
+   char show_emerge:1;
const char *fmt;
 };
 
@@ -334,6 +337,7 @@ static int do_emerge_log(
time_t elapsed;
depend_atom *atom;
depend_atom *atomw;
+   depend_atom *upgrade_atom = NULL;
DECLARE_ARRAY(merge_matches);
DECLARE_ARRAY(merge_averages);
DECLARE_ARRAY(unmerge_matches);
@@ -638,6 +642,34 @@ static int do_emerge_log(
flags->do_time 
? ": " : "",
flags->do_time ?

fmt_elapsedtime(flags, elapsed) : "");
+   } else if (flags->show_emerge) {
+   int state = NOT_EQUAL;
+   if (upgrade_atom != NULL)
+   state = 
atom_compare(pkgw->atom, upgrade_atom);
+   switch (state) {
+   /* "NRUD " */
+   case EQUAL:
+   printf(" %sR%s  
 ", YELLOW, NORM);
+   break;
+   case NOT_EQUAL:
+   printf("%sN%s   
 ", GREEN, NORM);
+   break;
+   case NEWER:
+   

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

2019-11-09 Thread Fabian Groffen
commit: 57e49de5c210c8def6f4957a6f94a62c60f98e52
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sat Nov  9 10:11:04 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sat Nov  9 10:11:04 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=57e49de5

q: add option to print envvars, much like portageq envvar

Option -e to q will dump the env variables used by portage-utils.

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

 main.c  | 86 +++--
 main.h  | 23 +++---
 man/q.1 |  7 --
 q.c | 59 +++-
 4 files changed, 118 insertions(+), 57 deletions(-)

diff --git a/main.c b/main.c
index 0b827fc..f8ba7af 100644
--- a/main.c
+++ b/main.c
@@ -393,19 +393,6 @@ strincr_var(const char *name, const char *s, char **value, 
size_t *value_len)
/* we should sort here */
 }
 
-typedef enum { _Q_BOOL, _Q_STR, _Q_ISTR } var_types;
-typedef struct {
-   const char *name;
-   const size_t name_len;
-   const var_types type;
-   union {
-   char **s;
-   bool *b;
-   } value;
-   size_t value_len;
-   const char *default_value;
-} env_vars;
-
 static env_vars *
 get_portage_env_var(env_vars *vars, const char *name)
 {
@@ -619,49 +606,48 @@ read_portage_profile(const char *configroot, const char 
*profile, env_vars vars[
free(profile_file);
 }
 
-static void
-initialize_portage_env(void)
-{
-   size_t i;
-   const char *s;
-
-   bool nocolor = 0;
-
-   env_vars *var;
-   env_vars vars_to_read[] = {
+static bool nocolor = 0;
+env_vars vars_to_read[] = {
 #define _Q_EV(t, V, set, lset, d) \
-   { \
-   .name = #V, \
-   .name_len = strlen(#V), \
-   .type = _Q_##t, \
-   set, \
-   lset, \
-   .default_value = d, \
-   },
+{ \
+   .name = #V, \
+   .name_len = strlen(#V), \
+   .type = _Q_##t, \
+   set, \
+   lset, \
+   .default_value = d, \
+},
 #define _Q_EVS(t, V, v, d) _Q_EV(t, V, .value.s = &v, .value_len = strlen(d), 
d)
 #define _Q_EVB(t, V, v, d) _Q_EV(t, V, .value.b = &v, .value_len = 0, d)
 
-   _Q_EVS(STR,  ROOT,portroot,"/")
-   _Q_EVS(STR,  ACCEPT_LICENSE,  accept_license,  "")
-   _Q_EVS(ISTR, INSTALL_MASK,install_mask,"")
-   _Q_EVS(ISTR, PKG_INSTALL_MASK,pkg_install_mask,"")
-   _Q_EVS(STR,  ARCH,portarch,"")
-   _Q_EVS(ISTR, CONFIG_PROTECT,  config_protect,  "/etc")
-   _Q_EVS(ISTR, CONFIG_PROTECT_MASK, config_protect_mask, "")
-   _Q_EVB(BOOL, NOCOLOR, nocolor, 0)
-   _Q_EVS(ISTR, FEATURES,features,"")
-   _Q_EVS(STR,  EPREFIX, eprefix, 
CONFIG_EPREFIX)
-   _Q_EVS(STR,  EMERGE_LOG_DIR,  portlogdir,  
CONFIG_EPREFIX "var/log")
-   _Q_EVS(STR,  PORTDIR, main_overlay,
CONFIG_EPREFIX "var/db/repos/gentoo")
-   _Q_EVS(STR,  PORTAGE_BINHOST, binhost, 
DEFAULT_PORTAGE_BINHOST)
-   _Q_EVS(STR,  PORTAGE_TMPDIR,  port_tmpdir, 
CONFIG_EPREFIX "var/tmp/portage/")
-   _Q_EVS(STR,  PKGDIR,  pkgdir,  
CONFIG_EPREFIX "var/cache/binpkgs/")
-   _Q_EVS(STR,  Q_VDB,   portvdb, 
CONFIG_EPREFIX "var/db/pkg")
-   _Q_EVS(STR,  Q_EDB,   portedb, 
CONFIG_EPREFIX "var/cache/edb")
-   { NULL, 0, _Q_BOOL, { NULL }, 0, NULL, }
+   _Q_EVS(STR,  ROOT,portroot,"/")
+   _Q_EVS(STR,  ACCEPT_LICENSE,  accept_license,  "")
+   _Q_EVS(ISTR, INSTALL_MASK,install_mask,"")
+   _Q_EVS(ISTR, PKG_INSTALL_MASK,pkg_install_mask,"")
+   _Q_EVS(STR,  ARCH,portarch,"")
+   _Q_EVS(ISTR, CONFIG_PROTECT,  config_protect,  "/etc")
+   _Q_EVS(ISTR, CONFIG_PROTECT_MASK, config_protect_mask, "")
+   _Q_EVB(BOOL, NOCOLOR, nocolor, 0)
+   _Q_EVS(ISTR, FEATURES,features,"")
+   _Q_EVS(STR,  EPREFIX, eprefix, CONFIG_EPREFIX)
+   _Q_EVS(STR,  EMERGE_LOG_DIR,  portlogdir,  CONFIG_EPREFIX 
"var/log")
+   _Q_EVS(STR,  PORTDIR, main_overlay,CONFIG_EPREFIX 
"var/db/repos/gentoo")
+   _Q_EVS(STR,  PORTAGE_BINHOST, binhost, 
DEFAULT_PORTAGE_BINHOST)
+   _Q_EVS(STR,  PORTAGE_TMPDIR,  port_tmpdir, CONFIG_EPREFIX 
"var/tmp/portage/")
+   _Q_EVS(STR,  PKGDIR,  pkgdir,  CONFIG_EPREFIX 
"var/cache/binpkgs/")
+   _Q_E

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

2019-12-14 Thread Fabian Groffen
commit: e5ff6caad2f4b848f77e6de82c866fa42aba30ae
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sat Dec 14 16:56:39 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sat Dec 14 16:56:39 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=e5ff6caa

qkeyword: add modes to list just list latest stable/testing

This functionality combined with -F allows usage with e.g. Puppet
providers.

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

 man/qkeyword.1 | 23 +++-
 qkeyword.c | 84 +-
 2 files changed, 81 insertions(+), 26 deletions(-)

diff --git a/man/qkeyword.1 b/man/qkeyword.1
index c43fa61..34beb18 100644
--- a/man/qkeyword.1
+++ b/man/qkeyword.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qkeyword "1" "Nov 2019" "Gentoo Foundation" "qkeyword"
+.TH qkeyword "1" "Dec 2019" "Gentoo Foundation" "qkeyword"
 .SH NAME
 qkeyword \- list packages based on keywords
 .SH SYNOPSIS
@@ -32,22 +32,31 @@ match catname.
 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.
+list packages that can be marked stable for .
 .TP
 \fB\-d\fR, \fB\-\-dropped\fR
-list packages that have dropped keywords on a version bump on a given arch.
+list packages that have dropped keywords for .
 .TP
-\fB\-t\fR, \fB\-\-testing\fR
-list packages that have ~arch versions, but no stable versions on a given arch.
+\fB\-t\fR, \fB\-\-needsstable\fR
+list packages that have ~arch versions, but no stable versions for .
 .TP
 \fB\-s\fR, \fB\-\-stats\fR
 display statistics about the portage tree.
 .TP
 \fB\-a\fR, \fB\-\-all\fR
-list packages that have at least one version keyworded for on a given arch.
+list packages that have at least one version keyworded for .
 .TP
 \fB\-n\fR, \fB\-\-not\fR
-list packages that aren't keyworded on a given arch.
+list packages that aren't keyworded for .
+.TP
+\fB\-S\fR, \fB\-\-stable\fR
+list latest stable version per package for .
+.TP
+\fB\-T\fR, \fB\-\-testing\fR
+list latest testing version per package for .
+.TP
+\fB\-F\fR \fI\fR, \fB\-\-format\fR \fI\fR
+Print latest atom using given format string.
 .TP
 \fB\-\-root\fR \fI\fR
 Set the ROOT env var.

diff --git a/qkeyword.c b/qkeyword.c
index 4c6c759..4a55b6a 100644
--- a/qkeyword.c
+++ b/qkeyword.c
@@ -28,29 +28,35 @@
 /* Required portage-utils stuff */
 //
 
-#define QKEYWORD_FLAGS "p:c:m:idtans" COMMON_FLAGS
+#define QKEYWORD_FLAGS "p:c:m:idtsanSTF:" 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'},
-   {"stats",   no_argument, NULL, 's'},
-   {"all", no_argument, NULL, 'a'},
-   {"not", no_argument, NULL, 'n'},
+   {"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'},
+   {"needsstable", no_argument, NULL, 't'},
+   {"stats",   no_argument, NULL, 's'},
+   {"all", no_argument, NULL, 'a'},
+   {"not", no_argument, NULL, 'n'},
+   {"stable",  no_argument, NULL, 'S'},
+   {"testing", no_argument, NULL, 'T'},
+   {"format",   a_argument, NULL, 'F'},
COMMON_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",
+   "list packages that can be marked stable for ",
+   "list packages that have dropped keywords for ",
+   "list packages that have ~arch versions, but no stable versions for 
",
"display statistics about the portage tree",
-   "list packages that have at least one version keyworded for on a given 
arch",
-   "list packages that aren't keyworded on a given arch.",
+   "list packages that have at least one version keyworded for ",
+   "list packages that aren't keyworded for ",
+   "list latest stable version per package for ",
+   "list latest testing version per package for ",
+   "Print latest atom using given format string",
COMMON_OPTS_HELP
 };
 #define qkeyword_usage(ret) usage(ret, QKEYWORD_FLAGS, qkeyword_long_opts, 
qkeyword_opts_help, NULL, lookup_ap

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

2019-09-28 Thread Fabian Groffen
commit: ea7f00529fa689a6624f6b26b5d3b7197f4fbfd5
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sat Sep 28 13:18:31 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sat Sep 28 13:18:31 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=ea7f0052

qpkg: don't emit hypothetical messages when real work has been done

drop the "would be" part of how many bytes were freed when we're not
pretending

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

 applets.h  | 2 +-
 man/qpkg.1 | 4 ++--
 qpkg.c | 8 +---
 3 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/applets.h b/applets.h
index 520ff23..364f457 100644
--- a/applets.h
+++ b/applets.h
@@ -82,7 +82,7 @@ static const struct applet_t {
{"qmanifest", qmanifest_main, "", "verify or generate 
thick Manifest files"},
 #endif
{"qmerge",qmerge_main,"",  "fetch and merge 
binary package"},
-   {"qpkg",  qpkg_main,  "", "manipulate Gentoo 
binpkgs"},
+   {"qpkg",  qpkg_main,  "", "create or manipulate 
Gentoo binpkgs"},
{"qsearch",   qsearch_main,   "", "search pkgname/desc"},
{"qsize", qsize_main, "",   "calculate size 
usage"},
{"qtbz2", qtbz2_main, "", "manipulate tbz2 
packages"},

diff --git a/man/qpkg.1 b/man/qpkg.1
index c471ea1..161a8bb 100644
--- a/man/qpkg.1
+++ b/man/qpkg.1
@@ -1,7 +1,7 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qpkg "1" "Jul 2019" "Gentoo Foundation" "qpkg"
+.TH qpkg "1" "Sep 2019" "Gentoo Foundation" "qpkg"
 .SH NAME
-qpkg \- manipulate Gentoo binpkgs
+qpkg \- create or manipulate Gentoo binpkgs
 .SH SYNOPSIS
 .B qpkg
 \fI[opts] \fR

diff --git a/qpkg.c b/qpkg.c
index 0ac6e92..947ff84 100644
--- a/qpkg.c
+++ b/qpkg.c
@@ -171,8 +171,9 @@ qpkg_clean(char *dirp)
disp_units = KILOBYTE;
if ((num_all_bytes / KILOBYTE) > 1000)
disp_units = MEGABYTE;
-   qprintf(" %s*%s Total space that would be freed in packages "
-   "directory: %s%s %ciB%s\n", GREEN, NORM, RED,
+   qprintf(" %s*%s Total space %sfreed in packages "
+   "directory: %s%s %ciB%s\n", GREEN, NORM,
+   pretend ? "that would be " : "", RED,
make_human_readable_str(num_all_bytes, 1, disp_units),
disp_units == MEGABYTE ? 'M' : 'K', NORM);
 
@@ -297,10 +298,11 @@ qpkg_make(depend_atom *atom)
xpak_create(AT_FDCWD, tbz2, 1, xpak_argv, 1, verbose);
 
stat(tbz2, &st);
+   xpaksize = st.st_size - xpaksize;
 
/* save tbz2 tail: STOP */
fp = fopen(tbz2, "a");
-   WRITE_BE_INT32(buf, st.st_size - xpaksize);
+   WRITE_BE_INT32(buf, xpaksize);
fwrite(buf, 1, 4, fp);
fwrite("STOP", 1, 4, fp);
fclose(fp);



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

2019-09-29 Thread Fabian Groffen
commit: ab19f86cb43061a7efa42ec2c3058abf69d72851
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sun Sep 29 12:18:00 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sun Sep 29 12:18:00 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=ab19f86c

man: update qfile page for new -P option

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

 man/qfile.1 | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/man/qfile.1 b/man/qfile.1
index 33dfbee..083641e 100644
--- a/man/qfile.1
+++ b/man/qfile.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qfile "1" "Jul 2019" "Gentoo Foundation" "qfile"
+.TH qfile "1" "Sep 2019" "Gentoo Foundation" "qfile"
 .SH NAME
 qfile \- list all pkgs owning files
 .SH SYNOPSIS
@@ -55,6 +55,9 @@ List orphan files.
 \fB\-x\fR \fI\fR, \fB\-\-exclude\fR \fI\fR
 Don't look in package  (used with --orphans).
 .TP
+\fB\-P\fR, \fB\-\-skip\-plibreg\fR
+Don't look in the prunelib registry.
+.TP
 \fB\-\-root\fR \fI\fR
 Set the ROOT env var.
 .TP



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

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

man: regen

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

 man/qatom.1 |  2 +-
 man/qcheck.1|  2 +-
 man/qdepends.1  |  2 +-
 man/qfile.1 |  2 +-
 man/qgrep.1 |  2 +-
 man/qkeyword.1  |  2 +-
 man/qlist.1 | 11 ++-
 man/qlop.1  |  2 +-
 man/qmanifest.1 |  2 +-
 man/qmerge.1|  2 +-
 man/qpkg.1  |  2 +-
 man/qsearch.1   |  2 +-
 man/qsize.1 |  2 +-
 man/qtbz2.1 |  2 +-
 man/qtegrity.1  |  2 +-
 man/quse.1  |  2 +-
 man/qxpak.1 |  2 +-
 17 files changed, 22 insertions(+), 21 deletions(-)

diff --git a/man/qatom.1 b/man/qatom.1
index ab6cfb3..6254912 100644
--- a/man/qatom.1
+++ b/man/qatom.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qatom "1" "Jul 2019" "Gentoo Foundation" "qatom"
+.TH qatom "1" "Nov 2019" "Gentoo Foundation" "qatom"
 .SH NAME
 qatom \- split atom strings
 .SH SYNOPSIS

diff --git a/man/qcheck.1 b/man/qcheck.1
index fce6b42..a48c7f3 100644
--- a/man/qcheck.1
+++ b/man/qcheck.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qcheck "1" "Jul 2019" "Gentoo Foundation" "qcheck"
+.TH qcheck "1" "Nov 2019" "Gentoo Foundation" "qcheck"
 .SH NAME
 qcheck \- verify integrity of installed packages
 .SH SYNOPSIS

diff --git a/man/qdepends.1 b/man/qdepends.1
index 8b0ad69..e8d1648 100644
--- a/man/qdepends.1
+++ b/man/qdepends.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qdepends "1" "Jul 2019" "Gentoo Foundation" "qdepends"
+.TH qdepends "1" "Nov 2019" "Gentoo Foundation" "qdepends"
 .SH NAME
 qdepends \- show dependency info
 .SH SYNOPSIS

diff --git a/man/qfile.1 b/man/qfile.1
index 083641e..7501311 100644
--- a/man/qfile.1
+++ b/man/qfile.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qfile "1" "Sep 2019" "Gentoo Foundation" "qfile"
+.TH qfile "1" "Nov 2019" "Gentoo Foundation" "qfile"
 .SH NAME
 qfile \- list all pkgs owning files
 .SH SYNOPSIS

diff --git a/man/qgrep.1 b/man/qgrep.1
index f3a5c2d..e414ba4 100644
--- a/man/qgrep.1
+++ b/man/qgrep.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qgrep "1" "Jul 2019" "Gentoo Foundation" "qgrep"
+.TH qgrep "1" "Nov 2019" "Gentoo Foundation" "qgrep"
 .SH NAME
 qgrep \- grep in ebuilds
 .SH SYNOPSIS

diff --git a/man/qkeyword.1 b/man/qkeyword.1
index a191d72..c43fa61 100644
--- a/man/qkeyword.1
+++ b/man/qkeyword.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qkeyword "1" "Jul 2019" "Gentoo Foundation" "qkeyword"
+.TH qkeyword "1" "Nov 2019" "Gentoo Foundation" "qkeyword"
 .SH NAME
 qkeyword \- list packages based on keywords
 .SH SYNOPSIS

diff --git a/man/qlist.1 b/man/qlist.1
index 2fd9575..676ee96 100644
--- a/man/qlist.1
+++ b/man/qlist.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qlist "1" "Jul 2019" "Gentoo Foundation" "qlist"
+.TH qlist "1" "Nov 2019" "Gentoo Foundation" "qlist"
 .SH NAME
 qlist \- list files owned by pkgname
 .SH SYNOPSIS
@@ -11,13 +11,17 @@ 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.
 .SH OPTIONS
 .TP
 \fB\-I\fR, \fB\-\-installed\fR
 Instead of listing the contents of a package, just print the package
 name if the package is currently installed.
 .TP
+\fB\-k\fR, \fB\-\-binpkgs\fR
+Operate on binary packages instead of installed packges.
+.TP
 \fB\-S\fR, \fB\-\-slots\fR
 Display installed packages with slots (use twice for subslots).
 .TP
@@ -40,9 +44,6 @@ Show /usr/lib/debug and /usr/src/debug files.
 \fB\-e\fR, \fB\-\-exact\fR
 Exact match (only CAT/PN or PN without PV).
 .TP
-\fB\-a\fR, \fB\-\-all\fR
-Show every installed package.
-.TP
 \fB\-d\fR, \fB\-\-dir\fR
 Only show directories.
 .TP

diff --git a/man/qlop.1 b/man/qlop.1
index 58efd09..1b63edd 100644
--- a/man/qlop.1
+++ b/man/qlop.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qlop "1" "Oct 2019" "Gentoo Foundation" "qlop"
+.TH qlop "1" "Nov 2019" "Gentoo Foundation" "qlop"
 .SH NAME
 qlop \- emerge log analyzer
 .SH SYNOPSIS

diff --git a/man/qmanifest.1 b/man/qmanifest.1
index 5d00bd3..6f6ab04 100644
--- a/man/qmanifest.1
+++ b/man/qmanifest.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qmanifest "1" "Jul 2019" "Gentoo Foundation" "qmanifest"
+.TH qmanifest "1" "Nov 2019" "Gentoo Foundation" "qmanifest"
 .SH NAME
 qmanifest \- verify or generate thick Manifest files
 .SH 

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

2019-11-24 Thread Fabian Groffen
commit: abbfff8553d8e99d71d71054e81a7f21d6479221
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sun Nov 24 12:26:47 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sun Nov 24 12:26:47 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=abbfff85

main: overhaul profile/config reading somewhat

- track where values come from, expose using -v (with q -[oe])
- follow repo-prefixed profiles in parent files (non-PMS feature?)
- read usr/share/portage/config/repos.conf for repo defaults

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

 applets.h |   1 +
 main.c| 397 --
 main.h|   1 +
 man/q.1   |   6 +-
 q.c   |  20 +++-
 5 files changed, 254 insertions(+), 171 deletions(-)

diff --git a/applets.h b/applets.h
index 364f457..e7b81f4 100644
--- a/applets.h
+++ b/applets.h
@@ -168,6 +168,7 @@ extern char *features;
 extern char *install_mask;
 extern DEFINE_ARRAY(overlays);
 extern DEFINE_ARRAY(overlay_names);
+extern DEFINE_ARRAY(overlay_src);
 extern char *main_overlay;
 extern int twidth;
 

diff --git a/main.c b/main.c
index e236934..081d72a 100644
--- a/main.c
+++ b/main.c
@@ -44,6 +44,7 @@ char *features;
 char *install_mask;
 DECLARE_ARRAY(overlays);
 DECLARE_ARRAY(overlay_names);
+DECLARE_ARRAY(overlay_src);
 
 static char *portarch;
 static char *portedb;
@@ -248,96 +249,6 @@ makeargv(const char *string, int *argc, char ***argv)
free(q);
 }
 
-/* Handle a single file in the repos.conf format. */
-static void
-read_one_repos_conf(const char *repos_conf)
-{
-   int nsec;
-   char *conf;
-   const char *main_repo, *repo, *path;
-   dictionary *dict;
-
-   if (getenv("DEBUG"))
-   fprintf(stderr, "  parse %s\n", repos_conf);
-
-   dict = iniparser_load(repos_conf);
-
-   main_repo = iniparser_getstring(dict, "DEFAULT:main-repo", NULL);
-
-   nsec = iniparser_getnsec(dict);
-   while (nsec-- > 0) {
-   repo = iniparser_getsecname(dict, nsec);
-   if (!strcmp(repo, "DEFAULT"))
-   continue;
-
-   xasprintf(&conf, "%s:location", repo);
-   path = iniparser_getstring(dict, conf, NULL);
-   if (path) {
-   void *ele = xarraypush_str(overlays, path);
-   xarraypush_str(overlay_names, repo);
-   if (main_repo && !strcmp(repo, main_repo))
-   main_overlay = ele;
-   }
-   free(conf);
-   }
-
-   iniparser_freedict(dict);
-}
-
-/* Handle a possible directory of files. */
-static void
-read_repos_conf(const char *configroot, const char *repos_conf)
-{
-   char *top_conf, *sub_conf;
-   int i, count;
-   struct dirent **confs;
-
-   xasprintf(&top_conf, "%s%s", configroot, repos_conf);
-   if (getenv("DEBUG"))
-   fprintf(stderr, "repos.conf.d scanner %s\n", top_conf);
-   count = scandir(top_conf, &confs, NULL, alphasort);
-   if (count == -1) {
-   if (errno == ENOTDIR)
-   read_one_repos_conf(top_conf);
-   } else {
-   for (i = 0; i < count; ++i) {
-   const char *name = confs[i]->d_name;
-
-   if (name[0] == '.' || name[0] == '\0')
-   continue;
-
-   /* Exclude backup files (aka files with ~ as postfix). 
*/
-   if (name[strlen(name) - 1] == '~')
-   continue;
-
-#ifdef DT_UNKNOWN
-   if (confs[i]->d_type != DT_UNKNOWN &&
-   confs[i]->d_type != DT_REG &&
-   confs[i]->d_type != DT_LNK)
-   continue;
-#endif
-
-   xasprintf(&sub_conf, "%s/%s", top_conf, name);
-
-#ifdef DT_UNKNOWN
-   if (confs[i]->d_type != DT_REG)
-#endif
-   {
-   struct stat st;
-   if (stat(sub_conf, &st) || 
!S_ISREG(st.st_mode)) {
-   free(sub_conf);
-   continue;
-   }
-   }
-
-   read_one_repos_conf(sub_conf);
-   free(sub_conf);
-   }
-   scandir_free(confs, count);
-   }
-   free(top_conf);
-}
-
 static void
 strincr_var(const char *name, const char *s, char **value, size_t *value_len)
 {
@@ -406,19 +317,33 @@ get_portage_env_var(env_vars *vars, const char *name)
 }
 
 static void
-set_portage_env_var(env_vars *var, const char *value)
+set_portage_env_var(env_vars *var, const char *value, const char *src)
 {
switch (var->type) {
case _Q_BOOL:
*var->value.b = 1;
+   free(var->src);
+   var->src 

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

2019-10-27 Thread Fabian Groffen
commit: c9d7b9de78f1488827cb516bf61a54df28a750ab
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sun Oct 27 12:19:06 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sun Oct 27 12:19:06 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=c9d7b9de

qlop: take two at implementing currently running merges

Probe /proc filesystem for running merges, and use the atoms found there
to select the packages to list.  In addition, prune any operations that
started > 10 days ago so there will be some sort of convergence.

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

 main.c |   3 +-
 man/qlop.1 |   4 +-
 qlop.c | 175 ++---
 3 files changed, 173 insertions(+), 9 deletions(-)

diff --git a/main.c b/main.c
index 5d4c4cd..0b827fc 100644
--- a/main.c
+++ b/main.c
@@ -501,7 +501,8 @@ read_portage_env_file(const char *configroot, const char 
*file, env_vars vars[])
source_len = strlen(sfile);
 
if (buflen <= source_len + file_path_len)
-   buf = xrealloc(buf, buflen = source_len 
+ file_path_len + 1);
+   buf = xrealloc(buf,
+   buflen = source_len + 
file_path_len + 1);
memmove(buf + file_path_len, buf + 7, 
source_len + 1);
memcpy(buf, file, file_path_len);
sfile = buf;

diff --git a/man/qlop.1 b/man/qlop.1
index de1e525..58efd09 100644
--- a/man/qlop.1
+++ b/man/qlop.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qlop "1" "Sep 2019" "Gentoo Foundation" "qlop"
+.TH qlop "1" "Oct 2019" "Gentoo Foundation" "qlop"
 .SH NAME
 qlop \- emerge log analyzer
 .SH SYNOPSIS
@@ -51,7 +51,7 @@ Print elapssed time in human readable format.  This form uses
 minutes, hours and days instead of just seconds.
 .TP
 \fB\-M\fR, \fB\-\-machine\fR
-Print elapsed time as seconds with no formatting.
+Print start/elapsed time as seconds with no formatting.
 .TP
 \fB\-m\fR, \fB\-\-merge\fR
 Show merge history.

diff --git a/qlop.c b/qlop.c
index 7a93656..6cb2c04 100644
--- a/qlop.c
+++ b/qlop.c
@@ -16,9 +16,11 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "atom.h"
 #include "eat_file.h"
+#include "scandirat.h"
 #include "set.h"
 #include "xarray.h"
 #include "xasprintf.h"
@@ -51,7 +53,7 @@ static const char * const qlop_opts_help[] = {
"Print time taken to complete action",
"Print average time taken to complete action",
"Print elapsed time in human readable format (use with -t or -a)",
-   "Print elapsed time as seconds with no formatting",
+   "Print start/elapsed time as seconds with no formatting",
"Show merge history",
"Show unmerge history",
"Show autoclean unmerge history",
@@ -201,10 +203,15 @@ parse_date(const char *sdate, time_t *t)
 static char _date_buf[48];
 static char *fmt_date(struct qlop_mode *flags, time_t ts, time_t te)
 {
-   time_t t;
+   time_t t = flags->do_endtime ? te : ts;
+
+   if (flags->do_machine)
+   snprintf(_date_buf, sizeof(_date_buf),
+   "%zd", (size_t)t);
+   else
+   strftime(_date_buf, sizeof(_date_buf),
+   "%Y-%m-%dT%H:%M:%S", localtime(&t));
 
-   t = flags->do_endtime ? te : ts;
-   strftime(_date_buf, sizeof(_date_buf), "%Y-%m-%dT%H:%M:%S", 
localtime(&t));
return _date_buf;
 }
 
@@ -336,6 +343,21 @@ New format:
 1550953125:  >>> unmerge success: app-admin/pwgen-2.08
 1550953125:  *** exiting successfully.
 1550953125:  *** terminating.
+
+
+Currently running merges can be found in the /proc filesystem:
+- Linux: readlink(/proc//fd/X)
+- Solaris: readlink(/proc//path/X)
+from here a file should be there that points to the build.log file
+$CAT/$P/work/build.log.  If so, it's running for $CAT/$P.
+This requires being the portage user though, or root.
+
+Should there be no /proc, we can deduce from the log whether a package
+is being emerged, if and only if, there are no parallel merges, and
+portage never got interrupted in a way where it could not write its
+interruption to the log.  Unfortunately these scenarios happen a lot.
+As such, we can try to remedy this somewhat by using a rule of thumb
+that currently merging packages need to be withinin the last 10 days.
 */
 static int do_emerge_log(
const char *log,
@@ -463,6 +485,7 @@ static int do_emerge_log(
tbegin = last_merge;
tend = tstart;
}
+
/* loop over lines searching for atoms */
while (fgets(buf, sizeof(buf), fp) != NULL) {
if ((p = strchr(buf, ':')) == NULL)
@@ -821,11 +844,19 @@ static int do_emerge_log(
}
fclose(f

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

2020-11-29 Thread Fabian Groffen
commit: 5fd373fadbdf3f0bc2733f4c6fee4fab71f76e69
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sun Nov 29 09:28:40 2020 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sun Nov 29 09:28:40 2020 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=5fd373fa

man: regenerate after alignment fix

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

 man/q.1 | 36 ++--
 man/qatom.1 |  2 +-
 man/qcheck.1|  2 +-
 man/qdepends.1  |  2 +-
 man/qfile.1 |  2 +-
 man/qgrep.1 |  2 +-
 man/qkeyword.1  |  2 +-
 man/qlist.1 |  2 +-
 man/qlop.1  | 15 +--
 man/qmanifest.1 |  2 +-
 man/qmerge.1|  2 +-
 man/qpkg.1  |  2 +-
 man/qsearch.1   |  2 +-
 man/qsize.1 |  2 +-
 man/qtbz2.1 |  2 +-
 man/qtegrity.1  |  2 +-
 man/quse.1  |  2 +-
 man/qxpak.1 |  2 +-
 18 files changed, 47 insertions(+), 36 deletions(-)

diff --git a/man/q.1 b/man/q.1
index 21a09b3..d98c3c3 100644
--- a/man/q.1
+++ b/man/q.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH q "1" "Dec 2019" "Gentoo Foundation" "q"
+.TH q "1" "Nov 2020" "Gentoo Foundation" "q"
 .SH NAME
 q \- invoke a portage utility applet
 .SH SYNOPSIS
@@ -58,24 +58,24 @@ Print version and exit.
 .SH APPLETS
 .nf
 .B This applet also has sub applets:
-q   : virtual applet
-qatom: split atom strings
-   qcheck: verify integrity of installed packages
- qdepends: show dependency info
-qfile   : list all pkgs owning files
-qgrep  [pkg ...]: grep in ebuilds
- qkeyword   : list packages based on keywords
-qlist: list files owned by pkgname
- qlop: emerge log analyzer
+ q   : virtual applet
+ qatom: split atom strings
+qcheck: verify integrity of installed packages
+  qdepends: show dependency info
+ qfile   : list all pkgs owning files
+ qgrep  [pkg ...]: grep in ebuilds
+  qkeyword   : list packages based on keywords
+ qlist: list files owned by pkgname
+  qlop: emerge log analyzer
  qmanifest  : verify or generate thick Manifest files
-   qmerge   : fetch and merge binary package
- qpkg  : create or manipulate Gentoo binpkgs
-  qsearch  : search pkgname/desc
-qsize: calculate size usage
-qtbz2  : manipulate tbz2 packages
- qtegrity  : verify files with IMA
- quse: find pkgs using useflags
-qxpak  : manipulate xpak archives
+qmerge   : fetch and merge binary package
+  qpkg  : create or manipulate Gentoo binpkgs
+   qsearch  : search pkgname/desc
+ qsize: calculate size usage
+ qtbz2  : manipulate tbz2 packages
+  qtegrity  : verify files with IMA
+  quse: find pkgs using useflags
+ qxpak  : manipulate xpak archives
 .fi
 .SH "REPORTING BUGS"
 Please report bugs via http://bugs.gentoo.org/

diff --git a/man/qatom.1 b/man/qatom.1
index 9ebb9a0..d8c7cd6 100644
--- a/man/qatom.1
+++ b/man/qatom.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qatom "1" "May 2020" "Gentoo Foundation" "qatom"
+.TH qatom "1" "Nov 2020" "Gentoo Foundation" "qatom"
 .SH NAME
 qatom \- split atom strings
 .SH SYNOPSIS

diff --git a/man/qcheck.1 b/man/qcheck.1
index a48c7f3..2473513 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 2019" "Gentoo Foundation" "qcheck"
+.TH qcheck "1" "Nov 2020" "Gentoo Foundation" "qcheck"
 .SH NAME
 qcheck \- verify integrity of installed packages
 .SH SYNOPSIS

diff --git a/man/qdepends.1 b/man/qdepends.1
index e8d1648..0eb7ba3 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 2019" "Gentoo Foundation" "qdepends"
+.TH qdepends "1" "Nov 2020" "Gentoo Foundation" "qdepends"
 .SH NAME
 qdepends \- show dependency info
 .SH SYNOPSIS

diff --git a/man/qfile.1 b/man/qfile.1
index 7caa459..ffe0968 100644
--- a/man/qfile.1
+++ b/man/qfile.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qfile "1" "May 2020" "Gentoo Foundation" "qfile"
+.TH qfile "1" "Nov 2020" "Gentoo Foundation" "qfile"
 .SH NAME
 qfile \- list all pkgs owning files
 .SH SYNOPSIS

diff --git a/man/qgrep.1 b/man/qgrep.1
index 2d73f4c..70d7eba 100644
--- a/man/qgrep.1
+++ b/man/qgrep.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qgrep "1" "Jan 2020" "Gentoo Foundation" "qgrep"
+.TH qgrep "1" "Nov 2020" "Gentoo Foundation" "qgrep"
 .SH NAME
 qgrep \- grep in ebuilds
 .SH SYNOPSIS

diff --git a/man/qkeyword.1 b/man/qkeyword.1
index 5a26218..d18bea6 100644
--- a/man/qkeyword.1
+++ b/man/qkeyword.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qkeyword "1" "Dec 2019" "Gentoo Foundation" "qkeyword"
+.TH qkeyword "1" "Nov 2020" "Gentoo Foundat

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

2020-05-16 Thread Fabian Groffen
commit: ae5f28c57d2552786d813f44608cc74baf5fbf6d
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sat May 16 13:05:54 2020 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sat May 16 13:05:54 2020 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=ae5f28c5

qatom: add -s switch to strictly emulate a call to atom_compare

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

 man/qatom.1 |  5 -
 qatom.c | 29 -
 2 files changed, 24 insertions(+), 10 deletions(-)

diff --git a/man/qatom.1 b/man/qatom.1
index 4f6ccf2..9ebb9a0 100644
--- a/man/qatom.1
+++ b/man/qatom.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qatom "1" "Jan 2020" "Gentoo Foundation" "qatom"
+.TH qatom "1" "May 2020" "Gentoo Foundation" "qatom"
 .SH NAME
 qatom \- split atom strings
 .SH SYNOPSIS
@@ -67,6 +67,9 @@ The package suffices, currently that is just the asterisk.
 \fB\-c\fR, \fB\-\-compare\fR
 Compare two atoms.
 .TP
+\fB\-s\fR, \fB\-\-scompare\fR
+Compare two atoms in the given order data, query.
+.TP
 \fB\-p\fR, \fB\-\-print\fR
 Print reconstructed atom.
 .TP

diff --git a/qatom.c b/qatom.c
index 59f7392..1c1c50e 100644
--- a/qatom.c
+++ b/qatom.c
@@ -15,10 +15,11 @@
 
 #define QATOM_FORMAT "%{CATEGORY} %{PN} %{PV} %[PR] %[SLOT] %[pfx] %[sfx]"
 
-#define QATOM_FLAGS "F:cpl" COMMON_FLAGS
+#define QATOM_FLAGS "F:cspl" COMMON_FLAGS
 static struct option const qatom_long_opts[] = {
{"format", a_argument, NULL, 'F'},
{"compare",   no_argument, NULL, 'c'},
+   {"scompare",  no_argument, NULL, 's'},
{"print", no_argument, NULL, 'p'},
{"lookup",no_argument, NULL, 'l'},
COMMON_LONG_OPTS
@@ -26,6 +27,7 @@ static struct option const qatom_long_opts[] = {
 static const char * const qatom_opts_help[] = {
"Custom output format (default: " QATOM_FORMAT ")",
"Compare two atoms",
+   "Compare two atoms in the given order data, query",
"Print reconstructed atom",
"Lookup atom in tree",
COMMON_OPTS_HELP
@@ -34,7 +36,13 @@ static const char * const qatom_opts_help[] = {
 
 int qatom_main(int argc, char **argv)
 {
-   enum qatom_atom { _EXPLODE=0, _COMPARE, _PRINT, _LOOKUP } action = 
_EXPLODE;
+   enum qatom_atom {
+   _EXPLODE = 0,
+   _COMPARE,
+   _SCOMPARE,
+   _PRINT,
+   _LOOKUP
+   } action = _EXPLODE;
const char *format = QATOM_FORMAT;
depend_atom *atom;
depend_atom *atomc;
@@ -43,10 +51,11 @@ int qatom_main(int argc, char **argv)
 
while ((i = GETOPT_LONG(QATOM, qatom, "")) != -1) {
switch (i) {
-   case 'F': format = optarg;   break;
-   case 'c': action = _COMPARE; break;
-   case 'p': action = _PRINT;   break;
-   case 'l': action = _LOOKUP;  break;
+   case 'F': format = optarg;break;
+   case 'c': action = _COMPARE;  break;
+   case 's': action = _SCOMPARE; break;
+   case 'p': action = _PRINT;break;
+   case 'l': action = _LOOKUP;   break;
COMMON_GETOPTS_CASES(qatom)
}
}
@@ -54,7 +63,7 @@ int qatom_main(int argc, char **argv)
if (argc == optind)
qatom_usage(EXIT_FAILURE);
 
-   if (action == _COMPARE && (argc - optind) % 2)
+   if ((action == _COMPARE || action == _SCOMPARE) && (argc - optind) % 2)
err("compare needs even number of arguments");
 
if (action == _LOOKUP) {
@@ -71,7 +80,8 @@ int qatom_main(int argc, char **argv)
}
 
switch (action) {
-   case _COMPARE: {
+   case _COMPARE:
+   case _SCOMPARE: {
int r;
 
i++;
@@ -81,7 +91,8 @@ int qatom_main(int argc, char **argv)
break;
}
 
-   if (atomc->blocker != ATOM_BL_NONE ||
+   if (action == _SCOMPARE ||
+   atomc->blocker != ATOM_BL_NONE ||
atomc->pfx_op != ATOM_OP_NONE ||
atomc->sfx_op != ATOM_OP_NONE ||
(atomc->CATEGORY == NULL &&



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

2022-05-26 Thread Fabian Groffen
commit: d301ed27e28417f185c374a044cfabeb32beb607
Author: Fabian Groffen  gentoo  org>
AuthorDate: Thu May 26 14:32:32 2022 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Thu May 26 14:32:32 2022 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=d301ed27

qdepends: add --resolve flag to lookup depstrings

This doesn't respect keywords or masks, but with installed packages
shows which packages currently match the deps as expressed

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

 man/qdepends.1 | 11 ++-
 qdepends.c | 51 +++
 2 files changed, 45 insertions(+), 17 deletions(-)

diff --git a/man/qdepends.1 b/man/qdepends.1
index 0690f16..5e5b00a 100644
--- a/man/qdepends.1
+++ b/man/qdepends.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qdepends "1" "Feb 2021" "Gentoo Foundation" "qdepends"
+.TH qdepends "1" "May 2022" "Gentoo Foundation" "qdepends"
 .SH NAME
 qdepends \- show dependency info
 .SH SYNOPSIS
@@ -68,6 +68,9 @@ Search installed packages using VDB.
 \fB\-t\fR, \fB\-\-tree\fR
 Search available ebuilds in the tree.
 .TP
+\fB\-U\fR, \fB\-\-use\fR
+Apply profile USE-flags to conditional deps.
+.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
@@ -82,6 +85,9 @@ e.g.\ the DEPEND= part is skipped.
 \fB\-S\fR, \fB\-\-pretty\fR
 Pretty format specified depend strings.
 .TP
+\fB\-R\fR, \fB\-\-resolve\fR
+Resolve found dependencies to package versions.
+.TP
 \fB\-\-root\fR \fI\fR
 Set the ROOT env var.
 .TP
@@ -97,6 +103,9 @@ Suppress DEPEND= output for \fB\-f\fR.  Only print the 
matching atom for \fB\-Q\
 \fB\-C\fR, \fB\-\-nocolor\fR
 Don't output color.
 .TP
+\fB\-\-color\fR
+Force color in output.
+.TP
 \fB\-h\fR, \fB\-\-help\fR
 Print this help and exit.
 .TP

diff --git a/qdepends.c b/qdepends.c
index f1bc3ad..bd7c379 100644
--- a/qdepends.c
+++ b/qdepends.c
@@ -22,7 +22,7 @@
 #include "xasprintf.h"
 #include "xregex.h"
 
-#define QDEPENDS_FLAGS "drpbQitUF:S" COMMON_FLAGS
+#define QDEPENDS_FLAGS "drpbQitUF:SR" COMMON_FLAGS
 static struct option const qdepends_long_opts[] = {
{"depend",no_argument, NULL, 'd'},
{"rdepend",   no_argument, NULL, 'r'},
@@ -34,6 +34,7 @@ static struct option const qdepends_long_opts[] = {
{"use",   no_argument, NULL, 'U'},
{"format", a_argument, NULL, 'F'},
{"pretty",no_argument, NULL, 'S'},
+   {"resolve",   no_argument, NULL, 'R'},
COMMON_LONG_OPTS
 };
 static const char * const qdepends_opts_help[] = {
@@ -47,20 +48,23 @@ static const char * const qdepends_opts_help[] = {
"Apply profile USE-flags to conditional deps",
"Print matched atom using given format string",
"Pretty format specified depend strings",
+   "Resolve found dependencies to package versions",
COMMON_OPTS_HELP
 };
 #define qdepends_usage(ret) usage(ret, QDEPENDS_FLAGS, qdepends_long_opts, 
qdepends_opts_help, NULL, lookup_applet_idx("qdepends"))
 
 /* structures / types / etc ... */
 struct qdepends_opt_state {
-   unsigned int qmode;
-   array_t *atoms;
-   array_t *deps;
-   set *udeps;
-   char *depend;
-   size_t depend_len;
-   const char *format;
-   tree_ctx *vdb;
+   unsigned int  qmode;
+   array_t  *atoms;
+   array_t  *deps;
+   set  *udeps;
+   char *depend;
+   size_tdepend_len;
+   const char   *format;
+   char  resolve:1;
+   tree_ctx *vdb;
+   tree_ctx *rtree;
 };
 
 #define QMODE_DEPEND (1<<0)
@@ -174,6 +178,10 @@ qdepends_results_cb(tree_pkg_ctx *pkg_ctx, void *priv)
continue;
}
 
+   /* try and resolve expressions to real package atoms */
+   if (state->resolve)
+   dep_resolve_tree(dep_tree, state->rtree);
+
if (state->qmode & QMODE_TREE &&
!(state->qmode & QMODE_REVERSE) &&
verbose)
@@ -301,12 +309,14 @@ int qdepends_main(int argc, char **argv)
DECLARE_ARRAY(atoms);
DECLARE_ARRAY(deps);
struct qdepends_opt_state state = {
-   .atoms = atoms,
-   .deps = deps,
-   .udeps = create_set(),
-   .qmode = 0,
-   .format = "%[CATEGORY]%[PF]",
-   .vdb = NULL,
+   .atoms   = atoms,
+   .deps= deps,
+   .udeps   = create_set(),
+   .qmode   = 0,
+   .format  = "%[CATEGORY]%[PF]",
+   .resolve = false,
+   .vdb = NULL,
+   .rtree   = NULL,
};
size_t i;
int ret;
@@ -328,6 +338,7 @@ int qdepends_main(int argc, char **argv)
case 't': state.qmode

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

2019-10-27 Thread Fabian Groffen
commit: c9d7b9de78f1488827cb516bf61a54df28a750ab
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sun Oct 27 12:19:06 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sun Oct 27 12:19:06 2019 +
URL:https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=c9d7b9de

qlop: take two at implementing currently running merges

Probe /proc filesystem for running merges, and use the atoms found there
to select the packages to list.  In addition, prune any operations that
started > 10 days ago so there will be some sort of convergence.

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

 main.c |   3 +-
 man/qlop.1 |   4 +-
 qlop.c | 175 ++---
 3 files changed, 173 insertions(+), 9 deletions(-)

diff --git a/main.c b/main.c
index 5d4c4cd..0b827fc 100644
--- a/main.c
+++ b/main.c
@@ -501,7 +501,8 @@ read_portage_env_file(const char *configroot, const char 
*file, env_vars vars[])
source_len = strlen(sfile);
 
if (buflen <= source_len + file_path_len)
-   buf = xrealloc(buf, buflen = source_len 
+ file_path_len + 1);
+   buf = xrealloc(buf,
+   buflen = source_len + 
file_path_len + 1);
memmove(buf + file_path_len, buf + 7, 
source_len + 1);
memcpy(buf, file, file_path_len);
sfile = buf;

diff --git a/man/qlop.1 b/man/qlop.1
index de1e525..58efd09 100644
--- a/man/qlop.1
+++ b/man/qlop.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qlop "1" "Sep 2019" "Gentoo Foundation" "qlop"
+.TH qlop "1" "Oct 2019" "Gentoo Foundation" "qlop"
 .SH NAME
 qlop \- emerge log analyzer
 .SH SYNOPSIS
@@ -51,7 +51,7 @@ Print elapssed time in human readable format.  This form uses
 minutes, hours and days instead of just seconds.
 .TP
 \fB\-M\fR, \fB\-\-machine\fR
-Print elapsed time as seconds with no formatting.
+Print start/elapsed time as seconds with no formatting.
 .TP
 \fB\-m\fR, \fB\-\-merge\fR
 Show merge history.

diff --git a/qlop.c b/qlop.c
index 7a93656..6cb2c04 100644
--- a/qlop.c
+++ b/qlop.c
@@ -16,9 +16,11 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "atom.h"
 #include "eat_file.h"
+#include "scandirat.h"
 #include "set.h"
 #include "xarray.h"
 #include "xasprintf.h"
@@ -51,7 +53,7 @@ static const char * const qlop_opts_help[] = {
"Print time taken to complete action",
"Print average time taken to complete action",
"Print elapsed time in human readable format (use with -t or -a)",
-   "Print elapsed time as seconds with no formatting",
+   "Print start/elapsed time as seconds with no formatting",
"Show merge history",
"Show unmerge history",
"Show autoclean unmerge history",
@@ -201,10 +203,15 @@ parse_date(const char *sdate, time_t *t)
 static char _date_buf[48];
 static char *fmt_date(struct qlop_mode *flags, time_t ts, time_t te)
 {
-   time_t t;
+   time_t t = flags->do_endtime ? te : ts;
+
+   if (flags->do_machine)
+   snprintf(_date_buf, sizeof(_date_buf),
+   "%zd", (size_t)t);
+   else
+   strftime(_date_buf, sizeof(_date_buf),
+   "%Y-%m-%dT%H:%M:%S", localtime(&t));
 
-   t = flags->do_endtime ? te : ts;
-   strftime(_date_buf, sizeof(_date_buf), "%Y-%m-%dT%H:%M:%S", 
localtime(&t));
return _date_buf;
 }
 
@@ -336,6 +343,21 @@ New format:
 1550953125:  >>> unmerge success: app-admin/pwgen-2.08
 1550953125:  *** exiting successfully.
 1550953125:  *** terminating.
+
+
+Currently running merges can be found in the /proc filesystem:
+- Linux: readlink(/proc//fd/X)
+- Solaris: readlink(/proc//path/X)
+from here a file should be there that points to the build.log file
+$CAT/$P/work/build.log.  If so, it's running for $CAT/$P.
+This requires being the portage user though, or root.
+
+Should there be no /proc, we can deduce from the log whether a package
+is being emerged, if and only if, there are no parallel merges, and
+portage never got interrupted in a way where it could not write its
+interruption to the log.  Unfortunately these scenarios happen a lot.
+As such, we can try to remedy this somewhat by using a rule of thumb
+that currently merging packages need to be withinin the last 10 days.
 */
 static int do_emerge_log(
const char *log,
@@ -463,6 +485,7 @@ static int do_emerge_log(
tbegin = last_merge;
tend = tstart;
}
+
/* loop over lines searching for atoms */
while (fgets(buf, sizeof(buf), fp) != NULL) {
if ((p = strchr(buf, ':')) == NULL)
@@ -821,11 +844,19 @@ static int do_emerge_log(
}
fclose(f

  1   2   3   4   5   6   7   8   9   >