From c1d6cec2e277eea7affa43601086c523311b58c0 Mon Sep 17 00:00:00 2001 From: Andrew Gregory Date: Sat, 11 Oct 2014 04:08:20 -0400 Subject: sync.c: download packages before starting commit download_files sets the transaction state to STATE_DOWNLOADING. Modifying the state after it has already been set to STATE_COMMITTING created a brief window where SIGINT would fail to interrupt the process and caused interrupted downloads to result in a 'transaction started' message in the log with no matching transaction end. Signed-off-by: Andrew Gregory --- lib/libalpm/trans.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'lib/libalpm/trans.c') diff --git a/lib/libalpm/trans.c b/lib/libalpm/trans.c index aebd8dd2..7cdb096f 100644 --- a/lib/libalpm/trans.c +++ b/lib/libalpm/trans.c @@ -175,6 +175,16 @@ int SYMEXPORT alpm_trans_commit(alpm_handle_t *handle, alpm_list_t **data) return 0; } + if(trans->add) { + if(_alpm_sync_load(handle, data) != 0) { + /* pm_errno is set by _alpm_sync_load() */ + return -1; + } + if(trans->flags & ALPM_TRANS_FLAG_DOWNLOADONLY) { + return 0; + } + } + trans->state = STATE_COMMITING; alpm_logaction(handle, ALPM_CALLER_PREFIX, "transaction started\n"); -- cgit v1.2.3-24-g4f1b