Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib/libalpm/trans.c
diff options
context:
space:
mode:
authorAndrew Gregory <andrew.gregory.8@gmail.com>2015-09-14 18:37:40 -0400
committerAllan McRae <allan@archlinux.org>2015-09-20 17:36:53 +1000
commit6946d7d1b77a550c3f4de48e4cc6ad1094ac6b10 (patch)
tree70536168605c0ced9d469c126c764193fcfa69c8 /lib/libalpm/trans.c
parentaf747ef34a9a152614fcde18abcfc6e1e3ec5d0e (diff)
check fileconflicts and diskspace outside commit
This is necessary in order to be able to run PreTransaction hooks as close to the actual commit as possible so that we don't prematurely run hooks for a transaction that ultimately never happens. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'lib/libalpm/trans.c')
-rw-r--r--lib/libalpm/trans.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/libalpm/trans.c b/lib/libalpm/trans.c
index 6a26e753..ed073c09 100644
--- a/lib/libalpm/trans.c
+++ b/lib/libalpm/trans.c
@@ -183,6 +183,10 @@ int SYMEXPORT alpm_trans_commit(alpm_handle_t *handle, alpm_list_t **data)
if(trans->flags & ALPM_TRANS_FLAG_DOWNLOADONLY) {
return 0;
}
+ if(_alpm_sync_check(handle, data) != 0) {
+ /* pm_errno is set by _alpm_sync_check() */
+ return -1;
+ }
}
trans->state = STATE_COMMITING;
@@ -198,7 +202,7 @@ int SYMEXPORT alpm_trans_commit(alpm_handle_t *handle, alpm_list_t **data)
return -1;
}
} else {
- if(_alpm_sync_commit(handle, data) == -1) {
+ if(_alpm_sync_commit(handle) == -1) {
/* pm_errno is set by _alpm_sync_commit() */
alpm_errno_t save = handle->pm_errno;
alpm_logaction(handle, ALPM_CALLER_PREFIX, "transaction failed\n");