From 7c04b050ea6d194392b82165ce08e89e97e4127c Mon Sep 17 00:00:00 2001 From: Aurelien Foret Date: Wed, 16 Mar 2005 20:09:10 +0000 Subject: Make sure we generate a UPGRADE_DONE event during upgrades --- lib/libalpm/add.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/libalpm/add.c b/lib/libalpm/add.c index 325dbc86..d6e4d9d8 100644 --- a/lib/libalpm/add.c +++ b/lib/libalpm/add.c @@ -561,10 +561,10 @@ int add_commit(pmdb_t *db, pmtrans_t *trans) _alpm_runscriptlet(handle->root, pm_install, "post_install", info->version, NULL); } - if(pmo_upgrade && oldpkg) { + if(pmo_upgrade) { TRANS_CB(trans, PM_TRANS_EVT_UPGRADE_DONE, info, NULL); alpm_logaction("upgraded %s (%s -> %s)", info->name, - oldpkg->version, info->version); + oldpkg ? oldpkg->version : NULL, info->version); } else { TRANS_CB(trans, PM_TRANS_EVT_ADD_DONE, info, NULL); alpm_logaction("installed %s (%s)", info->name, info->version); -- cgit v1.2.3-24-g4f1b