commit: 5674671e9d7e0e1251561d81a1154dd5d92e60ec Author: Fabian Groffen <grobian <AT> gentoo <DOT> org> AuthorDate: Tue Feb 5 13:47:59 2019 +0000 Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org> CommitDate: Tue Feb 5 13:50:23 2019 +0000 URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=5674671e
qdepends: add support for BDEPEND Bug: https://bugs.gentoo.org/674936 Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org> man/include/qdepends.optdesc.yaml | 8 ++++---- man/qdepends.1 | 13 ++++++++----- qdepends.c | 15 ++++++++++++--- 3 files changed, 24 insertions(+), 12 deletions(-) diff --git a/man/include/qdepends.optdesc.yaml b/man/include/qdepends.optdesc.yaml index 51b1cc7..5d786f3 100644 --- a/man/include/qdepends.optdesc.yaml +++ b/man/include/qdepends.optdesc.yaml @@ -1,13 +1,13 @@ all: | - Show *DEPEND, alias for \fB\-drp\fR. + Show *DEPEND, alias for \fB\-drpb\fR. key: | Advanced option to allow querying the VDB. This option overrides - \fB\-d\fR, \fB\-r\fR, \fB\-p\fR or \fB\-a\fR. \fI<arg>\fR can be - any key from Portage's VDB, e.g.\ any file from + \fB\-d\fR, \fB\-r\fR, \fB\-p\fR, \fB\-b\fR or \fB\-a\fR. + \fI<arg>\fR can be any key from Portage's VDB, e.g.\ any file from var/db/pkg/<cat>/<pkg>/. query: | Query reverse deps. This basically reverses the search to any - package that references \fI<arg>\fR in DEPEND, RDEPEND or PDEPEND. + package that references \fI<arg>\fR in DEPEND, RDEPEND, PDEPEND or BDEPEND. This can be useful to find consumers of a given package, e.g.\ to search for packages that have \fIlogwatch\fR in their DEPEND. name-only: | diff --git a/man/qdepends.1 b/man/qdepends.1 index 2e1aab2..0273999 100644 --- a/man/qdepends.1 +++ b/man/qdepends.1 @@ -1,5 +1,5 @@ .\" generated by mkman.py, please do NOT edit! -.TH qdepends "1" "May 2018" "Gentoo Foundation" "qdepends" +.TH qdepends "1" "Feb 2019" "Gentoo Foundation" "qdepends" .SH NAME qdepends \- show dependency info .SH SYNOPSIS @@ -32,15 +32,18 @@ Show RDEPEND info. \fB\-p\fR, \fB\-\-pdepend\fR Show PDEPEND info. .TP +\fB\-b\fR, \fB\-\-bdepend\fR +Show BDEPEND info. +.TP \fB\-k\fR \fI<arg>\fR, \fB\-\-key\fR \fI<arg>\fR Advanced option to allow querying the VDB. This option overrides -\fB\-d\fR, \fB\-r\fR, \fB\-p\fR or \fB\-a\fR. \fI<arg>\fR can be -any key from Portage's VDB, e.g.\ any file from +\fB\-d\fR, \fB\-r\fR, \fB\-p\fR, \fB\-b\fR or \fB\-a\fR. +\fI<arg>\fR can be any key from Portage's VDB, e.g.\ any file from var/db/pkg/<cat>/<pkg>/. .TP \fB\-Q\fR \fI<arg>\fR, \fB\-\-query\fR \fI<arg>\fR Query reverse deps. This basically reverses the search to any -package that references \fI<arg>\fR in DEPEND, RDEPEND or PDEPEND. +package that references \fI<arg>\fR in DEPEND, RDEPEND, PDEPEND or BDEPEND. This can be useful to find consumers of a given package, e.g.\ to search for packages that have \fIlogwatch\fR in their DEPEND. .TP @@ -48,7 +51,7 @@ search for packages that have \fIlogwatch\fR in their DEPEND. Only show category/package, instead of category/package-version. .TP \fB\-a\fR, \fB\-\-all\fR -Show *DEPEND, alias for \fB\-drp\fR. +Show *DEPEND, alias for \fB\-drpb\fR. .TP \fB\-f\fR, \fB\-\-format\fR Pretty-print DEPEND declaration to be used in an ebuild. This diff --git a/qdepends.c b/qdepends.c index e6b9bcf..92ae57b 100644 --- a/qdepends.c +++ b/qdepends.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2018 Gentoo Authors + * Copyright 2005-2019 Gentoo Authors * Distributed under the terms of the GNU General Public License v2 * * Copyright 2005-2010 Ned Ludd - <so...@gentoo.org> @@ -9,11 +9,12 @@ #ifdef APPLET_qdepends -#define QDEPENDS_FLAGS "drpafNk:Q:" COMMON_FLAGS +#define QDEPENDS_FLAGS "drpbafNk:Q:" COMMON_FLAGS static struct option const qdepends_long_opts[] = { {"depend", no_argument, NULL, 'd'}, {"rdepend", no_argument, NULL, 'r'}, {"pdepend", no_argument, NULL, 'p'}, + {"bdepend", no_argument, NULL, 'b'}, {"key", a_argument, NULL, 'k'}, {"query", a_argument, NULL, 'Q'}, {"name-only", no_argument, NULL, 'N'}, @@ -25,6 +26,7 @@ static const char * const qdepends_opts_help[] = { "Show DEPEND info (default)", "Show RDEPEND info", "Show PDEPEND info", + "Show BDEPEND info", "User defined vdb key", "Query reverse deps", "Only show package name", @@ -639,7 +641,13 @@ int qdepends_main(int argc, char **argv) bool do_format = false; const char *query = NULL; const char *depend_file; - const char *depend_files[] = { "DEPEND", "RDEPEND", "PDEPEND", NULL, NULL }; + const char *depend_files[] = { + /* 0 */ "DEPEND", + /* 1 */ "RDEPEND", + /* 2 */ "PDEPEND", + /* 3 */ "BDEPEND", + /* 4 */ NULL + }; depend_file = depend_files[0]; @@ -650,6 +658,7 @@ int qdepends_main(int argc, char **argv) case 'd': depend_file = depend_files[0]; break; case 'r': depend_file = depend_files[1]; break; case 'p': depend_file = depend_files[2]; break; + case 'b': depend_file = depend_files[3]; break; case 'k': depend_file = optarg; break; case 'a': depend_file = NULL; break; case 'Q': query = optarg; break;