summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAllan McRae <allan@archlinux.org>2012-08-12 16:28:42 +1000
committerAllan McRae <allan@archlinux.org>2012-12-14 12:35:34 +1000
commitd0e5cd2c7faef6159ab353714fa5227739994b2f (patch)
tree290fa301adf0daa733f7ec298593a456b3c01e61 /src
parent9a24f1ffc50deb7d979430ac85475b10b4a98d28 (diff)
downloadpacman-d0e5cd2c7faef6159ab353714fa5227739994b2f.tar.xz
Add "Optional for" to package information output
Much like packages that require a give package are displayed in the "Required by" field of its information output, alos display packages that optionally require the package. Inspired-by: Benedikt Morbach <benedikt.morbach@googlemail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'src')
-rw-r--r--src/pacman/package.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/pacman/package.c b/src/pacman/package.c
index ce7de7f3..a8f322cc 100644
--- a/src/pacman/package.c
+++ b/src/pacman/package.c
@@ -89,7 +89,7 @@ void dump_pkg_full(alpm_pkg_t *pkg, int extra)
double size;
char bdatestr[50] = "", idatestr[50] = "";
const char *label, *reason;
- alpm_list_t *validation = NULL, *requiredby = NULL;
+ alpm_list_t *validation = NULL, *requiredby = NULL, *optionalfor = NULL;
from = alpm_pkg_get_origin(pkg);
@@ -137,6 +137,7 @@ void dump_pkg_full(alpm_pkg_t *pkg, int extra)
if(extra || from == ALPM_PKG_FROM_LOCALDB) {
/* compute this here so we don't get a pause in the middle of output */
requiredby = alpm_pkg_compute_requiredby(pkg);
+ optionalfor = alpm_pkg_compute_optionalfor(pkg);
}
cols = getcols(fileno(stdout));
@@ -159,6 +160,7 @@ void dump_pkg_full(alpm_pkg_t *pkg, int extra)
if(extra || from == ALPM_PKG_FROM_LOCALDB) {
list_display(_("Required By :"), requiredby, cols);
+ list_display(_("Optional For :"), optionalfor, cols);
}
deplist_display(_("Conflicts With :"), alpm_pkg_get_conflicts(pkg), cols);
deplist_display(_("Replaces :"), alpm_pkg_get_replaces(pkg), cols);