libalpm/sync.c: Do not download missing keys multiple times
We now store key structs of our missing key info, so can not search the list for string matches. This caused missing keys to be downloaded once for every package they signed. Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
27f354a787
commit
540b19164b
1 changed files with 10 additions and 2 deletions
|
@ -873,6 +873,14 @@ finish:
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_LIBGPGME
|
#ifdef HAVE_LIBGPGME
|
||||||
|
|
||||||
|
static int key_cmp(const void *k1, const void *k2) {
|
||||||
|
const struct keyinfo_t *key1 = k1;
|
||||||
|
const char *key2 = k2;
|
||||||
|
|
||||||
|
return strcmp(key1->keyid, key2);
|
||||||
|
}
|
||||||
|
|
||||||
static int check_keyring(alpm_handle_t *handle)
|
static int check_keyring(alpm_handle_t *handle)
|
||||||
{
|
{
|
||||||
size_t current = 0, numtargs;
|
size_t current = 0, numtargs;
|
||||||
|
@ -910,7 +918,7 @@ static int check_keyring(alpm_handle_t *handle)
|
||||||
alpm_list_t *k;
|
alpm_list_t *k;
|
||||||
for(k = keys; k; k = k->next) {
|
for(k = keys; k; k = k->next) {
|
||||||
char *key = k->data;
|
char *key = k->data;
|
||||||
if(!alpm_list_find_str(errors, key) &&
|
if(!alpm_list_find(errors, key, key_cmp) &&
|
||||||
_alpm_key_in_keychain(handle, key) == 0) {
|
_alpm_key_in_keychain(handle, key) == 0) {
|
||||||
keyinfo = malloc(sizeof(struct keyinfo_t));
|
keyinfo = malloc(sizeof(struct keyinfo_t));
|
||||||
if(!keyinfo) {
|
if(!keyinfo) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue