FS#66472: Remove *.sig file if package corrupted

In case if a package corrupted (e.g. signature or hash is invalid)
pacman tries to remove the package file to redownload it anew the next time.
Remove *.sig file as well to make sure no data is left for the invalid
package.

Signed-off-by: Anatol Pomozov <anatol.pomozov@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
Anatol Pomozov 2020-09-14 18:52:56 -07:00 committed by Allan McRae
parent d85d9c8c60
commit ff7ff3c58d

View file

@ -688,7 +688,13 @@ static int prompt_to_delete(alpm_handle_t *handle, const char *filepath,
};
QUESTION(handle, &question);
if(question.remove) {
char *sig_filepath;
unlink(filepath);
sig_filepath = _alpm_sigpath(handle, filepath);
unlink(sig_filepath);
FREE(sig_filepath);
}
return question.remove;
}