summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierre Neidhardt <ambrevar@gmail.com>2014-02-03 12:53:10 +0100
committerAllan McRae <allan@archlinux.org>2014-02-04 14:21:07 +1000
commit0deeb9991c0c93526a541c8757f611ba63690d55 (patch)
tree4e1f5ef6e2c8c87de904efa4c2dff08b56c8205e
parentb9601b1e597c64df9d04678509c31f9bab538fd2 (diff)
downloadpacman-0deeb9991c0c93526a541c8757f611ba63690d55.tar.xz
pactree: removed 'provision' from linear output
Linear output is especially useful when piped to other commands, e.g. $ pactree -lu pacman | pacman -Qqkk - The above command would previously show errors on packages with provisions. Signed-off-by: Pierre Neidhardt <ambrevar@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
-rw-r--r--src/util/pactree.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/util/pactree.c b/src/util/pactree.c
index 4192999d..6c620aac 100644
--- a/src/util/pactree.c
+++ b/src/util/pactree.c
@@ -363,10 +363,13 @@ static void print_text(const char *pkg, const char *provision,
}
/* print tip */
+ /* If style->provides is empty (e.g. when using linear style), we do not
+ * want to print the provided package. This makes output easier to parse and
+ * to reuse. */
if(!pkg && provision) {
printf("%s%s%s%s [unresolvable]%s\n", tip, color->leaf1,
provision, color->branch1, color->off);
- } else if(provision && strcmp(pkg, provision) != 0) {
+ } else if(provision && strcmp(pkg, provision) != 0 && *(style->provides) != '\0') {
printf("%s%s%s%s%s %s%s%s\n", tip, color->leaf1, pkg,
color->leaf2, style->provides, color->leaf1, provision,
color->off);