Fix test suite when GPGME is disabled
As noted by Allan, we failed pretty hard if gpgme was compiled out. With these changes, only sign001.py fails. This can/will be fixed later once we beef up the test suite with more signing tests anyway. Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
f1d25ba2dd
commit
05f7c0280e
3 changed files with 16 additions and 1 deletions
|
@ -600,6 +600,14 @@ alpm_db_t *_alpm_db_register_sync(alpm_handle_t *handle, const char *treename,
|
||||||
|
|
||||||
_alpm_log(handle, ALPM_LOG_DEBUG, "registering sync database '%s'\n", treename);
|
_alpm_log(handle, ALPM_LOG_DEBUG, "registering sync database '%s'\n", treename);
|
||||||
|
|
||||||
|
_alpm_log(handle, ALPM_LOG_DEBUG, "spot 3\n");
|
||||||
|
#ifndef HAVE_LIBGPGME
|
||||||
|
_alpm_log(handle, ALPM_LOG_DEBUG, "spot 2\n");
|
||||||
|
if(level != 0 && level != ALPM_SIG_USE_DEFAULT) {
|
||||||
|
RET_ERR(handle, ALPM_ERR_WRONG_ARGS, NULL);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
db = _alpm_db_new(treename, 0);
|
db = _alpm_db_new(treename, 0);
|
||||||
if(db == NULL) {
|
if(db == NULL) {
|
||||||
RET_ERR(handle, ALPM_ERR_DB_CREATE, NULL);
|
RET_ERR(handle, ALPM_ERR_DB_CREATE, NULL);
|
||||||
|
|
|
@ -327,7 +327,6 @@ alpm_db_t *_alpm_db_new(const char *treename, int is_local)
|
||||||
CALLOC(db, 1, sizeof(alpm_db_t), return NULL);
|
CALLOC(db, 1, sizeof(alpm_db_t), return NULL);
|
||||||
STRDUP(db->treename, treename, return NULL);
|
STRDUP(db->treename, treename, return NULL);
|
||||||
db->is_local = is_local;
|
db->is_local = is_local;
|
||||||
db->siglevel = 0;
|
|
||||||
|
|
||||||
return db;
|
return db;
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,8 +45,10 @@ alpm_handle_t *_alpm_handle_new()
|
||||||
|
|
||||||
CALLOC(handle, 1, sizeof(alpm_handle_t), return NULL);
|
CALLOC(handle, 1, sizeof(alpm_handle_t), return NULL);
|
||||||
|
|
||||||
|
#ifdef HAVE_LIBGPGME
|
||||||
handle->siglevel = ALPM_SIG_PACKAGE | ALPM_SIG_PACKAGE_OPTIONAL |
|
handle->siglevel = ALPM_SIG_PACKAGE | ALPM_SIG_PACKAGE_OPTIONAL |
|
||||||
ALPM_SIG_DATABASE | ALPM_SIG_DATABASE_OPTIONAL;
|
ALPM_SIG_DATABASE | ALPM_SIG_DATABASE_OPTIONAL;
|
||||||
|
#endif
|
||||||
|
|
||||||
return handle;
|
return handle;
|
||||||
}
|
}
|
||||||
|
@ -579,7 +581,13 @@ int SYMEXPORT alpm_option_set_default_siglevel(alpm_handle_t *handle,
|
||||||
alpm_siglevel_t level)
|
alpm_siglevel_t level)
|
||||||
{
|
{
|
||||||
CHECK_HANDLE(handle, return -1);
|
CHECK_HANDLE(handle, return -1);
|
||||||
|
#ifdef HAVE_LIBGPGME
|
||||||
handle->siglevel = level;
|
handle->siglevel = level;
|
||||||
|
#else
|
||||||
|
if(level != 0 && level != ALPM_SIG_USE_DEFAULT) {
|
||||||
|
RET_ERR(handle, ALPM_ERR_WRONG_ARGS, -1);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue