From ce9fd69eba44d997a660c982a8149fae7acb6a29 Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Thu, 7 Mar 2013 01:32:41 -0500 Subject: make status/log messages reflect version change Currently pacman either prints 'adding' or 'upgrading' when installing a package. This make pacman print and log the other possible actions: 'downgrade' and 'reinstall' Signed-off-by: Simon Gomizelj Signed-off-by: Allan McRae --- src/pacman/callback.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'src/pacman') diff --git a/src/pacman/callback.c b/src/pacman/callback.c index d0887cb7..71d9d04d 100644 --- a/src/pacman/callback.c +++ b/src/pacman/callback.c @@ -207,6 +207,30 @@ void cb_event(alpm_event_t event, void *data1, void *data2) alpm_pkg_get_version(data1)); display_new_optdepends(data2, data1); break; + case ALPM_EVENT_DOWNGRADE_START: + if(config->noprogressbar) { + printf(_("downgrading %s...\n"), alpm_pkg_get_name(data1)); + } + break; + case ALPM_EVENT_DOWNGRADE_DONE: + alpm_logaction(config->handle, PACMAN_CALLER_PREFIX, + "downgraded %s (%s -> %s)\n", + alpm_pkg_get_name(data1), + alpm_pkg_get_version(data2), + alpm_pkg_get_version(data1)); + display_new_optdepends(data2, data1); + break; + case ALPM_EVENT_REINSTALL_START: + if(config->noprogressbar) { + printf(_("reinstalling %s...\n"), alpm_pkg_get_name(data1)); + } + break; + case ALPM_EVENT_REINSTALL_DONE: + alpm_logaction(config->handle, PACMAN_CALLER_PREFIX, + "reinstalled %s (%s)\n", + alpm_pkg_get_name(data1), + alpm_pkg_get_version(data1)); + break; case ALPM_EVENT_INTEGRITY_START: if(config->noprogressbar) { printf(_("checking package integrity...\n")); @@ -444,6 +468,12 @@ void cb_progress(alpm_progress_t event, const char *pkgname, int percent, case ALPM_PROGRESS_UPGRADE_START: opr = _("upgrading"); break; + case ALPM_PROGRESS_DOWNGRADE_START: + opr = _("downgrading"); + break; + case ALPM_PROGRESS_REINSTALL_START: + opr = _("reinstalling"); + break; case ALPM_PROGRESS_REMOVE_START: opr = _("removing"); break; -- cgit v1.2.3-70-g09d2