This will make sure that when set_record is called, all existing
records of the same type are removed.
It makes no sense to have multiple records of the same type,
and it actively breaks libhifs checksum validation.
Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
cr_RepomdRecord *record)
{
if (!repomd || !record) return;
+
+ cr_RepomdRecord *delrec = NULL;
+ // Remove all existing record of the same type
+ while((delrec = cr_repomd_get_record(repomd, record->type)) != NULL) {
+ cr_repomd_detach_record(repomd, delrec);
+ cr_repomd_record_free(delrec);
+ }
+
repomd->records = g_slist_append(repomd->records, record);
}