From d0e5cd2c7faef6159ab353714fa5227739994b2f Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Sun, 12 Aug 2012 16:28:42 +1000 Subject: 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 Signed-off-by: Allan McRae --- src/pacman/package.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') 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); -- cgit v1.2.3-70-g09d2