From: "Fabian Groffen" <grobian@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage-utils:master commit in: man/include/, /, man/
Date: Wed, 19 Jun 2019 07:31:24 +0000 (UTC) [thread overview]
Message-ID: <1560929444.057ffaead77a168f14861b0cce51c69332ab4ae1.grobian@gentoo> (raw)
commit: 057ffaead77a168f14861b0cce51c69332ab4ae1
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Wed Jun 19 07:30:44 2019 +0000
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Wed Jun 19 07:30:44 2019 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=057ffaea
qdepends: make -qq with -Q just print list of packages
Bug: https://bugs.gentoo.org/683430
Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>
man/include/qdepends-05-examples.include | 17 +++++++++++++++++
man/include/qdepends.optdesc.yaml | 3 ++-
man/qdepends.1 | 19 ++++++++++++++++++-
qdepends.c | 6 ++++--
4 files changed, 41 insertions(+), 4 deletions(-)
diff --git a/man/include/qdepends-05-examples.include b/man/include/qdepends-05-examples.include
index d3eac01..98ceb3a 100644
--- a/man/include/qdepends-05-examples.include
+++ b/man/include/qdepends-05-examples.include
@@ -17,3 +17,20 @@ can quickly see what specific dependency is expressed here. If
the above had used \fI<logrotate-3\fR, for example, no matches would be
returned. Not using any specifiers allows to reveal in what way a
dependency is expressed.
+.P
+Producing a list of packages that need rebuilding after a Perl upgrade:
+.nf
+ $ \fIqdepends -Qqq -F '%[CATEGORY]%[PN]%[SLOT]' ^perl:0/5.30\fR
+ dev-vcs/git:0
+ perl-core/File-Temp:0
+ dev-perl/Text-CSV_XS:0
+ ...
+.fi
+With the double \fB-q\fR flag, just the matching packages are returned,
+allowing to use the list for instance as arguments to \fBemerge\fR(1).
+The custom formatter in this case ensures all selected packages will be
+the best matching for the currently installed SLOT. Finally, the use of
+the antislot matching (\fI^\fR) is returning all packages that depend on
+perl in SLOT \fB0\fR, but in a different SUBSLOT than \fB5.30\fR,
+effectively requesting the list of packages that need rebuilding to use
+the newly installed version of Perl.
diff --git a/man/include/qdepends.optdesc.yaml b/man/include/qdepends.optdesc.yaml
index dc4ce91..f49461c 100644
--- a/man/include/qdepends.optdesc.yaml
+++ b/man/include/qdepends.optdesc.yaml
@@ -32,4 +32,5 @@ verbose: |
matches. When used with \fB-t\fR, the atom highlighting matches
what is used by the installed package, if available.
quiet: Suppress DEPEND= output for \fB\-f\fR. Only print the matching
- atom for \fB\-Q\fR.
+ atom for \fB\-Q\fR. When given two or more times, suppresses the
+ matching atom for \fB\-Q\fR, e.g.\ producing just a list of packages.
diff --git a/man/qdepends.1 b/man/qdepends.1
index d7c8957..7898e3d 100644
--- a/man/qdepends.1
+++ b/man/qdepends.1
@@ -92,7 +92,7 @@ matches. When used with \fB-t\fR, the atom highlighting matches
what is used by the installed package, if available.
.TP
\fB\-q\fR, \fB\-\-quiet\fR
-Suppress DEPEND= output for \fB\-f\fR. Only print the matching atom for \fB\-Q\fR.
+Suppress DEPEND= output for \fB\-f\fR. Only print the matching atom for \fB\-Q\fR. When given two or more times, suppresses the matching atom for \fB\-Q\fR, e.g.\ producing just a list of packages.
.TP
\fB\-C\fR, \fB\-\-nocolor\fR
Don't output color.
@@ -121,6 +121,23 @@ can quickly see what specific dependency is expressed here. If
the above had used \fI<logrotate-3\fR, for example, no matches would be
returned. Not using any specifiers allows to reveal in what way a
dependency is expressed.
+.P
+Producing a list of packages that need rebuilding after a Perl upgrade:
+.nf
+ $ \fIqdepends -Qqq -F '%[CATEGORY]%[PN]%[SLOT]' ^perl:0/5.30\fR
+ dev-vcs/git:0
+ perl-core/File-Temp:0
+ dev-perl/Text-CSV_XS:0
+ ...
+.fi
+With the double \fB-q\fR flag, just the matching packages are returned,
+allowing to use the list for instance as arguments to \fBemerge\fR(1).
+The custom formatter in this case ensures all selected packages will be
+the best matching for the currently installed SLOT. Finally, the use of
+the antislot matching (\fI^\fR) is returning all packages that depend on
+perl in SLOT \fB0\fR, but in a different SUBSLOT than \fB5.30\fR,
+effectively requesting the list of packages that need rebuilding to use
+the newly installed version of Perl.
.SH "REPORTING BUGS"
Please report bugs via http://bugs.gentoo.org/
.br
diff --git a/qdepends.c b/qdepends.c
index f5aa5a5..b5e8993 100644
--- a/qdepends.c
+++ b/qdepends.c
@@ -251,13 +251,15 @@ qdepends_results_cb(tree_pkg_ctx *pkg_ctx, void *priv)
if (!firstmatch) {
datom = tree_get_atom(pkg_ctx, true);
- printf("%s:", atom_format(state->format, datom));
+ printf("%s%s", atom_format(state->format, datom),
+ quiet < 2 ? ":" : "");
}
firstmatch = true;
snprintf(buf, sizeof(buf), "%s%s%s",
RED, atom_to_string(atom), NORM);
- add_set_unique(buf, state->udeps, NULL);
+ if (quiet < 2)
+ add_set_unique(buf, state->udeps, NULL);
} else if (!quiet) {
add_set_unique(atom_to_string(atom),
state->udeps, NULL);
next reply other threads:[~2019-06-19 7:31 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-19 7:31 Fabian Groffen [this message]
-- strict thread matches above, loose matches on Subject: below --
2021-02-20 12:23 [gentoo-commits] proj/portage-utils:master commit in: man/include/, /, man/ Fabian Groffen
2019-12-27 16:57 Fabian Groffen
2019-04-12 18:50 Fabian Groffen
2018-04-12 19:33 Fabian Groffen
2018-04-03 15:21 Fabian Groffen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1560929444.057ffaead77a168f14861b0cce51c69332ab4ae1.grobian@gentoo \
--to=grobian@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox