commit:     a0780928edc76543e63709c915fb7d581bd13291
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Sat May 16 14:29:45 2020 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Sat May 16 14:29:45 2020 +0000
URL:        https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=a0780928

qfile: print symlink targets in verbose mode

e.g.:
% qfile -v /bin/csh
app-shells/tcsh-6.21.00-r1: /bin/csh -> tcsh

Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>

 man/include/qfile.optdesc.yaml | 6 +++---
 man/qfile.1                    | 8 ++++----
 qfile.c                        | 6 +++++-
 3 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/man/include/qfile.optdesc.yaml b/man/include/qfile.optdesc.yaml
index 66ee885..9e1d24b 100644
--- a/man/include/qfile.optdesc.yaml
+++ b/man/include/qfile.optdesc.yaml
@@ -1,7 +1,7 @@
 verbose: |
-    Print package versions to matches, warn about problems with
-    resolving symlinks or positioning packages under an alternative
-    root.
+    Print package versions and symlink targets for matches, warn about
+    problems with resolving symlinks or positioning packages under an
+    alternative root.
 quiet: |
     Don't print matching file for matches, just the package.  Don't
     report about orphan files.

diff --git a/man/qfile.1 b/man/qfile.1
index 7501311..7caa459 100644
--- a/man/qfile.1
+++ b/man/qfile.1
@@ -1,5 +1,5 @@
 .\" generated by mkman.py, please do NOT edit!
-.TH qfile "1" "Nov 2019" "Gentoo Foundation" "qfile"
+.TH qfile "1" "May 2020" "Gentoo Foundation" "qfile"
 .SH NAME
 qfile \- list all pkgs owning files
 .SH SYNOPSIS
@@ -62,9 +62,9 @@ Don't look in the prunelib registry.
 Set the ROOT env var.
 .TP
 \fB\-v\fR, \fB\-\-verbose\fR
-Print package versions to matches, warn about problems with
-resolving symlinks or positioning packages under an alternative
-root.
+Print package versions and symlink targets for matches, warn about
+problems with resolving symlinks or positioning packages under an
+alternative root.
 .TP
 \fB\-q\fR, \fB\-\-quiet\fR
 Don't print matching file for matches, just the package.  Don't

diff --git a/qfile.c b/qfile.c
index d104848..efac60e 100644
--- a/qfile.c
+++ b/qfile.c
@@ -305,8 +305,12 @@ static int qfile_cb(tree_pkg_ctx *pkg_ctx, void *priv)
                                printf("%s", atom_format(state->format, atom));
                                if (quiet)
                                        puts("");
+                               else if (verbose && e->type == CONTENTS_SYM)
+                                       printf(": %s%s -> %s\n",
+                                                       state->root ? 
state->root : "",
+                                                       e->name, e->sym_target);
                                else
-                                       printf(": %s%s\n", state->root ? : "", 
e->name);
+                                       printf(": %s%s\n", state->root ? 
state->root : "", e->name);
                        } else {
                                non_orphans[i] = 1;
                        }

Reply via email to