Gentoo Archives: gentoo-commits

From: Fabian Groffen <grobian@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/portage-utils:master commit in: /, man/include/, man/
Date: Mon, 08 Apr 2019 09:02:28
Message-Id: 1554713781.692759d4e74b958dff78f86a53a3b56f4920a980.grobian@gentoo
1 commit: 692759d4e74b958dff78f86a53a3b56f4920a980
2 Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
3 AuthorDate: Mon Apr 8 08:56:21 2019 +0000
4 Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
5 CommitDate: Mon Apr 8 08:56:21 2019 +0000
6 URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=692759d4
7
8 qdepends: update manpage for rewrite
9
10 Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>
11
12 man/include/qdepends-05-examples.include | 20 +++-----
13 man/include/qdepends.desc | 33 ++++++++++----
14 man/include/qdepends.optdesc.yaml | 11 +++--
15 man/qdepends.1 | 78 ++++++++++++++++----------------
16 qdepends.c | 6 +--
17 5 files changed, 79 insertions(+), 69 deletions(-)
18
19 diff --git a/man/include/qdepends-05-examples.include b/man/include/qdepends-05-examples.include
20 index 04fb92f..d3eac01 100644
21 --- a/man/include/qdepends-05-examples.include
22 +++ b/man/include/qdepends-05-examples.include
23 @@ -1,25 +1,19 @@
24 .SH "EXAMPLES"
25 For finding out what a particular package depends on for building, you could do:
26 .nf
27 - $ \fIqdepends nano\fR
28 + $ \fIqdepends -d nano\fR
29 app-editors/nano-2.3.2: >=sys-libs/ncurses-5.9-r1[unicode] sys-apps/file ...
30 .fi
31 This tells us that we have \fIapp-editors/nano-2.3.2\fR installed and it depends
32 on ncurses (among other things).
33 -
34 -Searching for packages that actually have nano in their RDEPEND:
35 +.P
36 +Searching for packages that actually depend on logrotate:
37 .nf
38 - $ \fIqdepends -rQ nano\fR
39 - virtual/editor-0
40 + $ \fIqdepends -qQ logrotate\fR
41 + sys-apps/portage-2.3.18: !<app-admin/logrotate-3.8.0
42 .fi
43 -Tells us that \fIvirtual/editor\fR depends on nano. However, if we
44 -wanted to know in what way a package specifically depends on another
45 -package, one can use \fB\-v\fR.
46 -.nf
47 - $ \fIqdepends -vrQ logrotate\fR
48 - sys-apps/portage-2.3.18: >=app-admin/logrotate-3.8.0
49 -.fi
50 -This way we can see there is a specific dependency expressed here. If
51 +The \fB-q\fR flag suppresses the entire list of dependencies here, so we
52 +can quickly see what specific dependency is expressed here. If
53 the above had used \fI<logrotate-3\fR, for example, no matches would be
54 returned. Not using any specifiers allows to reveal in what way a
55 dependency is expressed.
56
57 diff --git a/man/include/qdepends.desc b/man/include/qdepends.desc
58 index 0143847..070032e 100644
59 --- a/man/include/qdepends.desc
60 +++ b/man/include/qdepends.desc
61 @@ -1,15 +1,30 @@
62 The
63 .I qdepends
64 -applet has a couple different modes. Normally it is geared towards
65 -answering the queries "what does package X depend on" and "what packages depend
66 -on X". Both can further be classified into build, run, and post dependencies.
67 -
68 -By default, it will tell you the build time dependencies only (DEPEND).
69 -
70 +applet has two different modes, forward and reverse dependency querying.
71 +Default operation is forward mode, answering the queries "what does
72 +package X depend on", while reverse mode answers "what packages depend
73 +on X". Both modes can be further specified into build (DEPEND), run
74 +(RDEPEND), post (PDEPEND) and EAPI7's BDEPEND dependencies.
75 +.P
76 +By default, \fIqdepends\fR returns the unique set of atoms that match
77 +all dependency variables. To split this out per variable, use \fB-v\fR
78 +option.
79 +.P
80 Currently,
81 .I qdepends
82 will only query installed packages. There is no support for
83 querying packages not yet installed (see \fBequery\fR(1) for that).
84 -
85 -If there is no answer to your query (i.e. you've asked for a package that is not
86 -installed, or a version that does not match), then you will get back no output.
87 +.P
88 +If there is no answer to your query (i.e. you've asked for a package
89 +that is not installed, or a version that does not match), then you will
90 +get empty output.
91 +.P
92 +After version \fB0.74\fR of portage-utils, \fIqdepends\fR was changed
93 +considerably to be more consistent and more advanced. Most notably,
94 +this has changed default output for reverse mode (\fB-Q\fR). Instead of
95 +just displaying the package name, like for forward mode, all
96 +dependencies for the package are shown. When colours are enabled, the
97 +matched atom is highlighted in the list. In addition to just querying
98 +DEPEND, the default mode changed to query all DEPEND-variables, and
99 +return the unique atoms found in them. Automatic regular expression
100 +match support was removed.
101
102 diff --git a/man/include/qdepends.optdesc.yaml b/man/include/qdepends.optdesc.yaml
103 index 5d786f3..f317227 100644
104 --- a/man/include/qdepends.optdesc.yaml
105 +++ b/man/include/qdepends.optdesc.yaml
106 @@ -16,14 +16,15 @@ format: |
107 Pretty-print DEPEND declaration to be used in an ebuild. This
108 option initiates a very different mode of operation. Instead of
109 printing searching through packages, it constructs a multi-line
110 - statement in with shell syntax, to be used in an ebuild. Each
111 + statement with shell syntax, to be used in an ebuild. Each
112 argument is turned into a separate DEPEND variable declaration. You
113 need to quote dependency strings in order for them to be printed as
114 a single dependency declaration. When used with the \fB\-q\fR
115 option, only the pretty-printed dependency declaration is printed,
116 e.g.\ the DEPEND= part is skipped.
117 verbose: |
118 - When in reverse dep mode, print the package or packages that matched
119 - the query from the dependency line being searched. This includes
120 - specifiers and versions.
121 -quiet: Suppress DEPEND= output for \fB\-f\fR.
122 + Pretty-print atoms output, per DEPEND-variable. This is much like
123 + the \fB-f\fR option, but uses as input the dependency info from the
124 + matches.
125 +quiet: Suppress DEPEND= output for \fB\-f\fR. Only print the matching
126 + atom for \fB\-Q\fR.
127
128 diff --git a/man/qdepends.1 b/man/qdepends.1
129 index f5c8c01..dcaef0c 100644
130 --- a/man/qdepends.1
131 +++ b/man/qdepends.1
132 @@ -1,5 +1,5 @@
133 .\" generated by mkman.py, please do NOT edit!
134 -.TH qdepends "1" "Feb 2019" "Gentoo Foundation" "qdepends"
135 +.TH qdepends "1" "Apr 2019" "Gentoo Foundation" "qdepends"
136 .SH NAME
137 qdepends \- show dependency info
138 .SH SYNOPSIS
139 @@ -8,23 +8,38 @@ qdepends \- show dependency info
140 .SH DESCRIPTION
141 The
142 .I qdepends
143 -applet has a couple different modes. Normally it is geared towards
144 -answering the queries "what does package X depend on" and "what packages depend
145 -on X". Both can further be classified into build, run, and post dependencies.
146 -
147 -By default, it will tell you the build time dependencies only (DEPEND).
148 -
149 +applet has two different modes, forward and reverse dependency querying.
150 +Default operation is forward mode, answering the queries "what does
151 +package X depend on", while reverse mode answers "what packages depend
152 +on X". Both modes can be further specified into build (DEPEND), run
153 +(RDEPEND), post (PDEPEND) and EAPI7's BDEPEND dependencies.
154 +.P
155 +By default, \fIqdepends\fR returns the unique set of atoms that match
156 +all dependency variables. To split this out per variable, use \fB-v\fR
157 +option.
158 +.P
159 Currently,
160 .I qdepends
161 will only query installed packages. There is no support for
162 querying packages not yet installed (see \fBequery\fR(1) for that).
163 -
164 -If there is no answer to your query (i.e. you've asked for a package that is not
165 -installed, or a version that does not match), then you will get back no output.
166 +.P
167 +If there is no answer to your query (i.e. you've asked for a package
168 +that is not installed, or a version that does not match), then you will
169 +get empty output.
170 +.P
171 +After version \fB0.74\fR of portage-utils, \fIqdepends\fR was changed
172 +considerably to be more consistent and more advanced. Most notably,
173 +this has changed default output for reverse mode (\fB-Q\fR). Instead of
174 +just displaying the package name, like for forward mode, all
175 +dependencies for the package are shown. When colours are enabled, the
176 +matched atom is highlighted in the list. In addition to just querying
177 +DEPEND, the default mode changed to query all DEPEND-variables, and
178 +return the unique atoms found in them. Automatic regular expression
179 +match support was removed.
180 .SH OPTIONS
181 .TP
182 \fB\-d\fR, \fB\-\-depend\fR
183 -Show DEPEND info (default).
184 +Show DEPEND info.
185 .TP
186 \fB\-r\fR, \fB\-\-rdepend\fR
187 Show RDEPEND info.
188 @@ -35,13 +50,7 @@ Show PDEPEND info.
189 \fB\-b\fR, \fB\-\-bdepend\fR
190 Show BDEPEND info.
191 .TP
192 -\fB\-k\fR \fI<arg>\fR, \fB\-\-key\fR \fI<arg>\fR
193 -Advanced option to allow querying the VDB. This option overrides
194 -\fB\-d\fR, \fB\-r\fR, \fB\-p\fR, \fB\-b\fR or \fB\-a\fR.
195 -\fI<arg>\fR can be any key from Portage's VDB, e.g.\ any file from
196 -var/db/pkg/<cat>/<pkg>/.
197 -.TP
198 -\fB\-Q\fR \fI<arg>\fR, \fB\-\-query\fR \fI<arg>\fR
199 +\fB\-Q\fR, \fB\-\-query\fR
200 Query reverse deps. This basically reverses the search to any
201 package that references \fI<arg>\fR in DEPEND, RDEPEND, PDEPEND or BDEPEND.
202 This can be useful to find consumers of a given package, e.g.\ to
203 @@ -50,14 +59,11 @@ search for packages that have \fIlogwatch\fR in their DEPEND.
204 \fB\-N\fR, \fB\-\-name\-only\fR
205 Only show category/package, instead of category/package-version.
206 .TP
207 -\fB\-a\fR, \fB\-\-all\fR
208 -Show *DEPEND, alias for \fB\-drpb\fR.
209 -.TP
210 \fB\-f\fR, \fB\-\-format\fR
211 Pretty-print DEPEND declaration to be used in an ebuild. This
212 option initiates a very different mode of operation. Instead of
213 printing searching through packages, it constructs a multi-line
214 -statement in with shell syntax, to be used in an ebuild. Each
215 +statement with shell syntax, to be used in an ebuild. Each
216 argument is turned into a separate DEPEND variable declaration. You
217 need to quote dependency strings in order for them to be printed as
218 a single dependency declaration. When used with the \fB\-q\fR
219 @@ -68,12 +74,12 @@ e.g.\ the DEPEND= part is skipped.
220 Set the ROOT env var.
221 .TP
222 \fB\-v\fR, \fB\-\-verbose\fR
223 -When in reverse dep mode, print the package or packages that matched
224 -the query from the dependency line being searched. This includes
225 -specifiers and versions.
226 +Pretty-print atoms output, per DEPEND-variable. This is much like
227 +the \fB-f\fR option, but uses as input the dependency info from the
228 +matches.
229 .TP
230 \fB\-q\fR, \fB\-\-quiet\fR
231 -Suppress DEPEND= output for \fB\-f\fR.
232 +Suppress DEPEND= output for \fB\-f\fR. Only print the matching atom for \fB\-Q\fR.
233 .TP
234 \fB\-C\fR, \fB\-\-nocolor\fR
235 Don't output color.
236 @@ -86,25 +92,19 @@ Print version and exit.
237 .SH "EXAMPLES"
238 For finding out what a particular package depends on for building, you could do:
239 .nf
240 - $ \fIqdepends nano\fR
241 + $ \fIqdepends -d nano\fR
242 app-editors/nano-2.3.2: >=sys-libs/ncurses-5.9-r1[unicode] sys-apps/file ...
243 .fi
244 This tells us that we have \fIapp-editors/nano-2.3.2\fR installed and it depends
245 on ncurses (among other things).
246 -
247 -Searching for packages that actually have nano in their RDEPEND:
248 -.nf
249 - $ \fIqdepends -rQ nano\fR
250 - virtual/editor-0
251 -.fi
252 -Tells us that \fIvirtual/editor\fR depends on nano. However, if we
253 -wanted to know in what way a package specifically depends on another
254 -package, one can use \fB\-v\fR.
255 +.P
256 +Searching for packages that actually depend on logrotate:
257 .nf
258 - $ \fIqdepends -vrQ logrotate\fR
259 - sys-apps/portage-2.3.18: >=app-admin/logrotate-3.8.0
260 + $ \fIqdepends -qQ logrotate\fR
261 + sys-apps/portage-2.3.18: !<app-admin/logrotate-3.8.0
262 .fi
263 -This way we can see there is a specific dependency expressed here. If
264 +The \fB-q\fR flag suppresses the entire list of dependencies here, so we
265 +can quickly see what specific dependency is expressed here. If
266 the above had used \fI<logrotate-3\fR, for example, no matches would be
267 returned. Not using any specifiers allows to reveal in what way a
268 dependency is expressed.
269
270 diff --git a/qdepends.c b/qdepends.c
271 index df3434e..09156f6 100644
272 --- a/qdepends.c
273 +++ b/qdepends.c
274 @@ -210,10 +210,10 @@ qdepends_results_cb(q_vdb_pkg_ctx *pkg_ctx, void *priv)
275 ret = 1;
276
277 if (!firstmatch) {
278 - printf("%s%s/%s%s%s%s",
279 + printf("%s%s/%s%s%s:",
280 BOLD, catname, BLUE,
281 - qdep_name_only ? datom->PN : pkgname, NORM,
282 - quiet ? "" : ":");
283 + qdep_name_only ? datom->PN : pkgname,
284 + NORM);
285 }
286 firstmatch = true;