[pacman-dev] [PATCH 6/6] Make package info show optional requirements

Benedikt Morbach benedikt.morbach at googlemail.com
Thu Jul 21 14:39:27 EDT 2011


---
 src/pacman/package.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/pacman/package.c b/src/pacman/package.c
index 250f701..8bb67dc 100644
--- a/src/pacman/package.c
+++ b/src/pacman/package.c
@@ -53,7 +53,8 @@ void dump_pkg_full(alpm_pkg_t *pkg, enum pkg_from from, int extra)
 	const char *label;
 	double size;
 	const alpm_list_t *i;
-	alpm_list_t *depstrings = NULL, *optstrings = NULL, *requiredby = NULL;
+	alpm_list_t *depstrings, *optstrings, *requiredby, *optrequiredby;
+	depstrings = optstrings = requiredby = optrequiredby = NULL;
 
 	if(pkg == NULL) {
 		return;
@@ -92,7 +93,8 @@ void dump_pkg_full(alpm_pkg_t *pkg, enum pkg_from from, int extra)
 
 	if(extra || from == PKG_FROM_LOCALDB) {
 		/* compute this here so we don't get a pause in the middle of output */
-		requiredby = alpm_pkg_compute_requiredby(pkg, 0);
+		requiredby    = alpm_pkg_compute_requiredby(pkg, 0);
+		optrequiredby = alpm_pkg_compute_requiredby(pkg, 1);
 	}
 
 	/* actual output */
@@ -110,6 +112,7 @@ void dump_pkg_full(alpm_pkg_t *pkg, enum pkg_from from, int extra)
 	list_display_linebreak(_("Optional Deps  :"), optstrings);
 	if(extra || from == PKG_FROM_LOCALDB) {
 		list_display(_("Required By    :"), requiredby);
+		list_display(_("Optional For   :"), optrequiredby);
 	}
 	list_display(_("Conflicts With :"), alpm_pkg_get_conflicts(pkg));
 	list_display(_("Replaces       :"), alpm_pkg_get_replaces(pkg));
-- 
1.7.6



More information about the pacman-dev mailing list