add specific error for missing gpg support
"wrong or NULL argument passed" is a useless error for end users. Fixes FS#60880. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
508b4e3ec0
commit
3726693612
4 changed files with 10 additions and 5 deletions
|
@ -118,7 +118,9 @@ typedef enum _alpm_errno_t {
|
||||||
ALPM_ERR_LIBARCHIVE,
|
ALPM_ERR_LIBARCHIVE,
|
||||||
ALPM_ERR_LIBCURL,
|
ALPM_ERR_LIBCURL,
|
||||||
ALPM_ERR_EXTERNAL_DOWNLOAD,
|
ALPM_ERR_EXTERNAL_DOWNLOAD,
|
||||||
ALPM_ERR_GPGME
|
ALPM_ERR_GPGME,
|
||||||
|
/* Missing compile-time features */
|
||||||
|
ALPM_ERR_MISSING_CAPABILITY_SIGNATURES
|
||||||
} alpm_errno_t;
|
} alpm_errno_t;
|
||||||
|
|
||||||
/** Returns the current error code from the handle. */
|
/** Returns the current error code from the handle. */
|
||||||
|
|
|
@ -788,7 +788,7 @@ alpm_db_t *_alpm_db_register_sync(alpm_handle_t *handle, const char *treename,
|
||||||
|
|
||||||
#ifndef HAVE_LIBGPGME
|
#ifndef HAVE_LIBGPGME
|
||||||
if(level != ALPM_SIG_USE_DEFAULT) {
|
if(level != ALPM_SIG_USE_DEFAULT) {
|
||||||
RET_ERR(handle, ALPM_ERR_WRONG_ARGS, NULL);
|
RET_ERR(handle, ALPM_ERR_MISSING_CAPABILITY_SIGNATURES, NULL);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -159,6 +159,9 @@ const char SYMEXPORT *alpm_strerror(alpm_errno_t err)
|
||||||
return _("gpgme error");
|
return _("gpgme error");
|
||||||
case ALPM_ERR_EXTERNAL_DOWNLOAD:
|
case ALPM_ERR_EXTERNAL_DOWNLOAD:
|
||||||
return _("error invoking external downloader");
|
return _("error invoking external downloader");
|
||||||
|
/* Missing compile-time features */
|
||||||
|
case ALPM_ERR_MISSING_CAPABILITY_SIGNATURES:
|
||||||
|
return _("compiled without signature support");
|
||||||
/* Unknown error! */
|
/* Unknown error! */
|
||||||
default:
|
default:
|
||||||
return _("unexpected error");
|
return _("unexpected error");
|
||||||
|
|
|
@ -807,7 +807,7 @@ int SYMEXPORT alpm_option_set_default_siglevel(alpm_handle_t *handle,
|
||||||
handle->siglevel = level;
|
handle->siglevel = level;
|
||||||
#else
|
#else
|
||||||
if(level != 0 && level != ALPM_SIG_USE_DEFAULT) {
|
if(level != 0 && level != ALPM_SIG_USE_DEFAULT) {
|
||||||
RET_ERR(handle, ALPM_ERR_WRONG_ARGS, -1);
|
RET_ERR(handle, ALPM_ERR_MISSING_CAPABILITY_SIGNATURES, -1);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -827,7 +827,7 @@ int SYMEXPORT alpm_option_set_local_file_siglevel(alpm_handle_t *handle,
|
||||||
handle->localfilesiglevel = level;
|
handle->localfilesiglevel = level;
|
||||||
#else
|
#else
|
||||||
if(level != 0 && level != ALPM_SIG_USE_DEFAULT) {
|
if(level != 0 && level != ALPM_SIG_USE_DEFAULT) {
|
||||||
RET_ERR(handle, ALPM_ERR_WRONG_ARGS, -1);
|
RET_ERR(handle, ALPM_ERR_MISSING_CAPABILITY_SIGNATURES, -1);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -851,7 +851,7 @@ int SYMEXPORT alpm_option_set_remote_file_siglevel(alpm_handle_t *handle,
|
||||||
handle->remotefilesiglevel = level;
|
handle->remotefilesiglevel = level;
|
||||||
#else
|
#else
|
||||||
if(level != 0 && level != ALPM_SIG_USE_DEFAULT) {
|
if(level != 0 && level != ALPM_SIG_USE_DEFAULT) {
|
||||||
RET_ERR(handle, ALPM_ERR_WRONG_ARGS, -1);
|
RET_ERR(handle, ALPM_ERR_MISSING_CAPABILITY_SIGNATURES, -1);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Add table
Reference in a new issue