summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorXavier Chantry <shiningxc@gmail.com>2008-07-31 16:35:21 +0200
committerDan McGee <dan@archlinux.org>2008-08-23 08:38:25 -0500
commit96e023c7bd0b1069878667278a45a34476c42472 (patch)
treed848f573ad7ccf51e986950cfb6ebb84ef8bfb12 /src
parente27a8c9ae323c275b0c3503d6a6ea18b639f4dc6 (diff)
pacman: print optdepends on install and upgrade.
This implements FS#10630. Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'src')
-rw-r--r--src/pacman/callback.c2
-rw-r--r--src/pacman/util.c9
-rw-r--r--src/pacman/util.h1
3 files changed, 12 insertions, 0 deletions
diff --git a/src/pacman/callback.c b/src/pacman/callback.c
index b8e2d77e..8d4538c4 100644
--- a/src/pacman/callback.c
+++ b/src/pacman/callback.c
@@ -181,6 +181,7 @@ void cb_trans_evt(pmtransevt_t event, void *data1, void *data2)
alpm_logaction("installed %s (%s)\n",
alpm_pkg_get_name(data1),
alpm_pkg_get_version(data1));
+ display_optdepends(data1);
break;
case PM_TRANS_EVT_REMOVE_START:
if(config->noprogressbar) {
@@ -202,6 +203,7 @@ void cb_trans_evt(pmtransevt_t event, void *data1, void *data2)
(char *)alpm_pkg_get_name(data1),
(char *)alpm_pkg_get_version(data2),
(char *)alpm_pkg_get_version(data1));
+ display_optdepends(data1);
break;
case PM_TRANS_EVT_INTEGRITY_START:
printf(_("checking package integrity...\n"));
diff --git a/src/pacman/util.c b/src/pacman/util.c
index 1a74c9ea..8c4aeab8 100644
--- a/src/pacman/util.c
+++ b/src/pacman/util.c
@@ -609,6 +609,15 @@ void display_synctargets(const alpm_list_t *syncpkgs)
alpm_list_free(rpkglist);
}
+void display_optdepends(pmpkg_t *pkg)
+{
+ alpm_list_t *optdeps = alpm_pkg_get_optdepends(pkg);
+ if(optdeps) {
+ printf(_("Optional dependencies for %s\n"), alpm_pkg_get_name(pkg));
+ list_display_linebreak(" ", optdeps);
+ }
+}
+
/* presents a prompt and gets a Y/N answer */
int yesno(short preset, char *fmt, ...)
{
diff --git a/src/pacman/util.h b/src/pacman/util.h
index 209b2424..f94f0aed 100644
--- a/src/pacman/util.h
+++ b/src/pacman/util.h
@@ -54,6 +54,7 @@ void list_display(const char *title, const alpm_list_t *list);
void list_display_linebreak(const char *title, const alpm_list_t *list);
void display_targets(const alpm_list_t *pkgs, int install);
void display_synctargets(const alpm_list_t *syncpkgs);
+void display_optdepends(pmpkg_t *pkg);
int yesno(short preset, char *fmt, ...);
int pm_printf(pmloglevel_t level, const char *format, ...) __attribute__((format(printf,2,3)));
int pm_fprintf(FILE *stream, pmloglevel_t level, const char *format, ...) __attribute__((format(printf,3,4)));