summaryrefslogtreecommitdiff
path: root/lib/libalpm/remove.c
diff options
context:
space:
mode:
authorJudd Vinet <judd@archlinux.org>2006-07-14 23:15:07 +0000
committerJudd Vinet <judd@archlinux.org>2006-07-14 23:15:07 +0000
commit54008798efcc9646f622f6b052ecd83281d57cda (patch)
treef50aeec616897699713156468943dfc8f9923178 /lib/libalpm/remove.c
parent318e233cb38635581b14e081c22e369265c753b8 (diff)
downloadpacman-54008798efcc9646f622f6b052ecd83281d57cda.tar.xz
Patch from FW: Better control over CTRL-C interruptions -- do not leave the DB in an inconsistent state
Diffstat (limited to 'lib/libalpm/remove.c')
-rw-r--r--lib/libalpm/remove.c6
1 files changed, 5 insertions, 1 deletions
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);
}