From 54008798efcc9646f622f6b052ecd83281d57cda Mon Sep 17 00:00:00 2001 From: Judd Vinet Date: Fri, 14 Jul 2006 23:15:07 +0000 Subject: Patch from FW: Better control over CTRL-C interruptions -- do not leave the DB in an inconsistent state --- lib/libalpm/remove.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib/libalpm/remove.c') diff --git a/lib/libalpm/remove.c b/lib/libalpm/remove.c index f675eda1..4df9c7ba 100644 --- a/lib/libalpm/remove.c +++ b/lib/libalpm/remove.c @@ -149,6 +149,10 @@ int _alpm_remove_commit(pmtrans_t *trans, pmdb_t *db) char pm_install[PATH_MAX]; info = (pmpkg_t*)targ->data; + if(handle->trans->state == STATE_INTERRUPTED) { + break; + } + if(trans->type != PM_TRANS_TYPE_UPGRADE) { EVENT(trans, PM_TRANS_EVT_REMOVE_START, info, NULL); _alpm_log(PM_LOG_FLOW1, _("removing package %s-%s"), info->name, info->version); @@ -303,7 +307,7 @@ int _alpm_remove_commit(pmtrans_t *trans, pmdb_t *db) } /* run ldconfig if it exists */ - if(trans->type != PM_TRANS_TYPE_UPGRADE) { + if((trans->type != PM_TRANS_TYPE_UPGRADE) && (handle->trans->state != STATE_INTERRUPTED)) { _alpm_log(PM_LOG_FLOW1, _("running \"ldconfig -r %s\""), handle->root); _alpm_ldconfig(handle->root); } -- cgit v1.2.3