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/add.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'lib/libalpm/add.c') diff --git a/lib/libalpm/add.c b/lib/libalpm/add.c index 7b96cf08..62ea3e00 100644 --- a/lib/libalpm/add.c +++ b/lib/libalpm/add.c @@ -300,6 +300,10 @@ int _alpm_add_commit(pmtrans_t *trans, pmdb_t *db) pmpkg_t *oldpkg = NULL; errors = 0; + if(handle->trans->state == STATE_INTERRUPTED) { + break; + } + pmo_upgrade = (trans->type == PM_TRANS_TYPE_UPGRADE) ? 1 : 0; /* see if this is an upgrade. if so, remove the old package first */ @@ -689,8 +693,10 @@ int _alpm_add_commit(pmtrans_t *trans, pmdb_t *db) } /* run ldconfig if it exists */ - _alpm_log(PM_LOG_FLOW1, _("running \"ldconfig -r %s\""), handle->root); - _alpm_ldconfig(handle->root); + if(handle->trans->state != STATE_INTERRUPTED) { + _alpm_log(PM_LOG_FLOW1, _("running \"ldconfig -r %s\""), handle->root); + _alpm_ldconfig(handle->root); + } return(0); } -- cgit v1.2.3-2-g168b