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,
|
ALPM_ERR_SIG_MISSING,
|
||||||
/** Signatures are invalid */
|
/** Signatures are invalid */
|
||||||
ALPM_ERR_SIG_INVALID,
|
ALPM_ERR_SIG_INVALID,
|
||||||
|
/** Keys are missing from keyring */
|
||||||
|
ALPM_ERR_KEY_MISSING,
|
||||||
/* Dependencies */
|
/* Dependencies */
|
||||||
/** Dependencies could not be satisfied */
|
/** Dependencies could not be satisfied */
|
||||||
ALPM_ERR_UNSATISFIED_DEPS,
|
ALPM_ERR_UNSATISFIED_DEPS,
|
||||||
|
|
|
@ -766,6 +766,7 @@ int SYMEXPORT alpm_pkg_load(alpm_handle_t *handle, const char *filename, int ful
|
||||||
|
|
||||||
if(fail) {
|
if(fail) {
|
||||||
_alpm_log(handle, ALPM_LOG_ERROR, _("required key missing from keyring\n"));
|
_alpm_log(handle, ALPM_LOG_ERROR, _("required key missing from keyring\n"));
|
||||||
|
handle->pm_errno = ALPM_ERR_KEY_MISSING;
|
||||||
free(sigpath);
|
free(sigpath);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -130,6 +130,8 @@ const char SYMEXPORT *alpm_strerror(alpm_errno_t err)
|
||||||
return _("missing PGP signature");
|
return _("missing PGP signature");
|
||||||
case ALPM_ERR_SIG_INVALID:
|
case ALPM_ERR_SIG_INVALID:
|
||||||
return _("invalid PGP signature");
|
return _("invalid PGP signature");
|
||||||
|
case ALPM_ERR_KEY_MISSING:
|
||||||
|
return _("PGP key missing from keyring");
|
||||||
/* Dependencies */
|
/* Dependencies */
|
||||||
case ALPM_ERR_UNSATISFIED_DEPS:
|
case ALPM_ERR_UNSATISFIED_DEPS:
|
||||||
return _("could not satisfy dependencies");
|
return _("could not satisfy dependencies");
|
||||||
|
|
|
@ -975,6 +975,7 @@ static int check_keyring(alpm_handle_t *handle)
|
||||||
EVENT(handle, &event);
|
EVENT(handle, &event);
|
||||||
if(fail) {
|
if(fail) {
|
||||||
_alpm_log(handle, ALPM_LOG_ERROR, _("required key missing from keyring\n"));
|
_alpm_log(handle, ALPM_LOG_ERROR, _("required key missing from keyring\n"));
|
||||||
|
handle->pm_errno = ALPM_ERR_KEY_MISSING;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue