User-visible log when validity check fails due to access

Currently, if checking the validity of packages fails due to an access
error on one or more packages, the user must sift through debug output
in order to find the culprit package(s). This patch adds a call to
_alpm_log in such a case to make the culprits more easily visible.

Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
David Phillips 2018-09-19 14:30:37 +12:00 committed by Allan McRae
parent b54b33d816
commit 192d6166e9

View file

@ -1190,6 +1190,11 @@ static int check_validity(alpm_handle_t *handle,
case ALPM_ERR_PKG_INVALID_CHECKSUM: case ALPM_ERR_PKG_INVALID_CHECKSUM:
prompt_to_delete(handle, v->path, v->error); prompt_to_delete(handle, v->path, v->error);
break; break;
case ALPM_ERR_PKG_NOT_FOUND:
case ALPM_ERR_BADPERMS:
case ALPM_ERR_PKG_OPEN:
_alpm_log(handle, ALPM_LOG_ERROR, _("failed to read file %s: %s\n"), v->path, alpm_strerror(v->error));
break;
default: default:
/* ignore */ /* ignore */
break; break;