Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib/libalpm/add.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/add.c
parent318e233cb38635581b14e081c22e369265c753b8 (diff)
Patch from FW: Better control over CTRL-C interruptions -- do not leave the DB in an inconsistent state
Diffstat (limited to 'lib/libalpm/add.c')
-rw-r--r--lib/libalpm/add.c10
1 files changed, 8 insertions, 2 deletions
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);
}