From d78f45ae0c11fb19a1a0bf30728386e9febe0705 Mon Sep 17 00:00:00 2001 From: Andrew Gregory Date: Tue, 5 Nov 2013 11:29:55 -0500 Subject: log important events from the backend This ensures that important events will be logged and consistent regardless of the frontend. The need for global context in the event callback is also removed. The event is logged before any post_* scripts run, so this also moves the post_* script output underneath the event in the log. Fixes FS#36504 Signed-off-by: Andrew Gregory Signed-off-by: Allan McRae --- lib/libalpm/remove.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/libalpm/remove.c') diff --git a/lib/libalpm/remove.c b/lib/libalpm/remove.c index 7237a567..e745d89f 100644 --- a/lib/libalpm/remove.c +++ b/lib/libalpm/remove.c @@ -687,6 +687,11 @@ int _alpm_remove_single_package(alpm_handle_t *handle, remove_package_files(handle, oldpkg, newpkg, targ_count, pkg_count); } + if(!newpkg) { + alpm_logaction(handle, ALPM_CALLER_PREFIX, "removed %s (%s)\n", + oldpkg->name, oldpkg->version); + } + /* run the post-remove script if it exists */ if(!newpkg && alpm_pkg_has_scriptlet(oldpkg) && !(handle->trans->flags & ALPM_TRANS_FLAG_NOSCRIPTLET)) { -- cgit v1.2.3-24-g4f1b