summaryrefslogtreecommitdiff
path: root/src/pacman/package.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/pacman/package.c')
-rw-r--r--src/pacman/package.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/pacman/package.c b/src/pacman/package.c
index bef91e27..54c035c3 100644
--- a/src/pacman/package.c
+++ b/src/pacman/package.c
@@ -38,7 +38,6 @@
/** Turn a depends list into a text list.
* @param deps a list with items of type alpm_depend_t
- * @return a string list, must be freed
*/
static void deplist_display(const char *title,
alpm_list_t *deps)
@@ -52,6 +51,21 @@ static void deplist_display(const char *title,
FREELIST(text);
}
+/** Turn a optdepends list into a text list.
+ * @param optdeps a list with items of type alpm_optdepend_t
+ */
+static void optdeplist_display(const char *title,
+ alpm_list_t *optdeps)
+{
+ alpm_list_t *i, *text = NULL;
+ for(i = optdeps; i; i = alpm_list_next(i)) {
+ alpm_depend_t *optdep = i->data;
+ text = alpm_list_add(text, alpm_dep_compute_string(optdep));
+ }
+ list_display_linebreak(title, text);
+ FREELIST(text);
+}
+
/**
* Display the details of a package.
* Extra information entails 'required by' info for sync packages and backup
@@ -111,7 +125,7 @@ void dump_pkg_full(alpm_pkg_t *pkg, int extra)
list_display(_("Groups :"), alpm_pkg_get_groups(pkg));
deplist_display(_("Provides :"), alpm_pkg_get_provides(pkg));
deplist_display(_("Depends On :"), alpm_pkg_get_depends(pkg));
- list_display_linebreak(_("Optional Deps :"), alpm_pkg_get_optdepends(pkg));
+ optdeplist_display(_("Optional Deps :"), alpm_pkg_get_optdepends(pkg));
if(extra || from == PKG_FROM_LOCALDB) {
list_display(_("Required By :"), requiredby);
}