Lock the database on -Sc operation.
This partly fixes FS#9609. Weird things could happen when running -Sc while another instance was already running. The cleancache function could delete packages that were just being downloaded. Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
This commit is contained in:
parent
6f3949e3da
commit
7879e4bef7
1 changed files with 12 additions and 1 deletions
|
@ -774,8 +774,19 @@ int pacman_sync(alpm_list_t *targets)
|
|||
|
||||
/* clean the cache */
|
||||
if(config->op_s_clean) {
|
||||
int ret = sync_cleancache(config->op_s_clean);
|
||||
int ret = 0;
|
||||
|
||||
if(sync_trans_init(0) == -1) {
|
||||
return(1);
|
||||
}
|
||||
|
||||
ret += sync_cleancache(config->op_s_clean);
|
||||
ret += sync_cleandb_all();
|
||||
|
||||
if(sync_trans_release() == -1) {
|
||||
ret++;
|
||||
}
|
||||
|
||||
return(ret);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue