static int pakfire_repo_import_key(struct pakfire_repo* repo, FILE* f) {
struct pakfire_key** keys = NULL;
- size_t counter = 0;
int r;
// Import any keys from the file descriptor
if (r)
return r;
- // Count how many keys were imported
- for (struct pakfire_key** key = keys; *key; key++)
- counter++;
-
- // We should only import one key
- if (counter != 1) {
- ERROR(repo->pakfire, "Imported %zu key(s) but expected one\n", counter);
- r = 1;
- goto ERROR;
- }
+ /*
+ XXX It can happen, that more than one repository are using the same
+ key which can only be imported once. The second time, the key won't
+ be returned which lets us end up with that repository having no key.
+ */
for (struct pakfire_key** key = keys; *key; key++) {
char* dump = pakfire_key_dump(*key);