repomd->records = g_slist_remove(repomd->records, rec);
}
+void
+cr_repomd_remove_record(cr_Repomd *repomd, const char *type)
+{
+ cr_RepomdRecord *rec = cr_repomd_get_record(repomd, type);
+ if (!rec) return;
+ cr_repomd_detach_record(repomd, rec);
+ cr_repomd_record_free(rec);
+}
+
cr_RepomdRecord *
cr_repomd_get_record(cr_Repomd *repomd, const char *type)
{
/** Get repomd record from the repomd object.
* @param repomd cr_Repomd object
- * @param type Type of the record
+ * @param type Type of the record ("primary", "primary_db", ..)
* @return Pointer to a record of desired type or NULL
*/
cr_RepomdRecord *cr_repomd_get_record(cr_Repomd *repomd, const char *type);
*/
void cr_repomd_detach_record(cr_Repomd *repomd, cr_RepomdRecord *rec);
+/** Remove first record of the specified type
+ * @param repomd cr_Repomd object
+ * @param type Type of the record ("primary", "primary_db", ..)
+ */
+void cr_repomd_remove_record(cr_Repomd *repomd, const char *type);
+
/** Records are stored in order they were added to the repomd.
* Because sometimes deterministic output is desirable this function
* exists.