libalpm: set errno when key is missing from keyring
There was no fitting error type for this so add ALPM_ERR_KEY_MISSING.
This commit is contained in:
parent
48a784dde8
commit
beb6bd80cd
4 changed files with 6 additions and 0 deletions
|
@ -300,6 +300,8 @@ typedef enum _alpm_errno_t {
|
|||
ALPM_ERR_SIG_MISSING,
|
||||
/** Signatures are invalid */
|
||||
ALPM_ERR_SIG_INVALID,
|
||||
/** Keys are missing from keyring */
|
||||
ALPM_ERR_KEY_MISSING,
|
||||
/* Dependencies */
|
||||
/** Dependencies could not be satisfied */
|
||||
ALPM_ERR_UNSATISFIED_DEPS,
|
||||
|
|
|
@ -766,6 +766,7 @@ int SYMEXPORT alpm_pkg_load(alpm_handle_t *handle, const char *filename, int ful
|
|||
|
||||
if(fail) {
|
||||
_alpm_log(handle, ALPM_LOG_ERROR, _("required key missing from keyring\n"));
|
||||
handle->pm_errno = ALPM_ERR_KEY_MISSING;
|
||||
free(sigpath);
|
||||
return -1;
|
||||
}
|
||||
|
|
|
@ -130,6 +130,8 @@ const char SYMEXPORT *alpm_strerror(alpm_errno_t err)
|
|||
return _("missing PGP signature");
|
||||
case ALPM_ERR_SIG_INVALID:
|
||||
return _("invalid PGP signature");
|
||||
case ALPM_ERR_KEY_MISSING:
|
||||
return _("PGP key missing from keyring");
|
||||
/* Dependencies */
|
||||
case ALPM_ERR_UNSATISFIED_DEPS:
|
||||
return _("could not satisfy dependencies");
|
||||
|
|
|
@ -975,6 +975,7 @@ static int check_keyring(alpm_handle_t *handle)
|
|||
EVENT(handle, &event);
|
||||
if(fail) {
|
||||
_alpm_log(handle, ALPM_LOG_ERROR, _("required key missing from keyring\n"));
|
||||
handle->pm_errno = ALPM_ERR_KEY_MISSING;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue