cr_Repomd *repomd_obj = cr_repomd_new();
- cr_RepomdRecord *pri_xml_rec = cr_repomd_record_new(pri_xml_filename, "primary");
- cr_RepomdRecord *fil_xml_rec = cr_repomd_record_new(fil_xml_filename, "filelists");
- cr_RepomdRecord *oth_xml_rec = cr_repomd_record_new(oth_xml_filename, "other");
+ cr_RepomdRecord *pri_xml_rec = cr_repomd_record_new("primary", pri_xml_filename);
+ cr_RepomdRecord *fil_xml_rec = cr_repomd_record_new("filelists", fil_xml_filename);
+ cr_RepomdRecord *oth_xml_rec = cr_repomd_record_new("other", oth_xml_filename);
cr_RepomdRecord *pri_db_rec = NULL;
cr_RepomdRecord *fil_db_rec = NULL;
cr_RepomdRecord *oth_db_rec = NULL;
// Groupfile
if (groupfile) {
- groupfile_rec = cr_repomd_record_new(groupfile, "group");
- compressed_groupfile_rec = cr_repomd_record_new(groupfile, "group_gz");
+ groupfile_rec = cr_repomd_record_new("group", groupfile);
+ compressed_groupfile_rec = cr_repomd_record_new("group_gz", groupfile);
cr_repomd_record_compress_and_fill(groupfile_rec,
compressed_groupfile_rec,
cmd_options->checksum_type,
// Updateinfo
if (updateinfo) {
- updateinfo_rec = cr_repomd_record_new(updateinfo, "updateinfo");
+ updateinfo_rec = cr_repomd_record_new("updateinfo", updateinfo);
cr_repomd_record_fill(updateinfo_rec, cmd_options->checksum_type, NULL);
}
// Prepare repomd records
- pri_db_rec = cr_repomd_record_new(pri_db_name, "primary_db");
- fil_db_rec = cr_repomd_record_new(fil_db_name, "filelists_db");
- oth_db_rec = cr_repomd_record_new(oth_db_name, "other_db");
+ pri_db_rec = cr_repomd_record_new("primary_db", pri_db_name);
+ fil_db_rec = cr_repomd_record_new("filelists_db", fil_db_name);
+ oth_db_rec = cr_repomd_record_new("other_db", oth_db_name);
cr_repomd_record_fill(pri_db_rec, cmd_options->checksum_type, NULL);
cr_repomd_record_fill(fil_db_rec, cmd_options->checksum_type, NULL);
// Prepare repomd records
- cr_RepomdRecord *pri_xml_rec = cr_repomd_record_new(pri_xml_filename, "primary");
- cr_RepomdRecord *fil_xml_rec = cr_repomd_record_new(fil_xml_filename, "filelists");
- cr_RepomdRecord *oth_xml_rec = cr_repomd_record_new(oth_xml_filename, "other");
+ cr_RepomdRecord *pri_xml_rec = cr_repomd_record_new("primary", pri_xml_filename);
+ cr_RepomdRecord *fil_xml_rec = cr_repomd_record_new("filelists", fil_xml_filename);
+ cr_RepomdRecord *oth_xml_rec = cr_repomd_record_new("other", oth_xml_filename);
cr_RepomdRecord *pri_db_rec = NULL;
cr_RepomdRecord *fil_db_rec = NULL;
cr_RepomdRecord *oth_db_rec = NULL;
// Groupfile
if (groupfile) {
- groupfile_rec = cr_repomd_record_new(groupfile, "group");
- compressed_groupfile_rec = cr_repomd_record_new(groupfile, "group_gz");
+ groupfile_rec = cr_repomd_record_new("group", groupfile);
+ compressed_groupfile_rec = cr_repomd_record_new("group_gz", groupfile);
cr_repomd_record_compress_and_fill(groupfile_rec,
compressed_groupfile_rec,
CR_CHECKSUM_SHA256,
// Update info
if (!cmd_options->noupdateinfo) {
- update_info_rec = cr_repomd_record_new(update_info_filename, "updateinfo");
+ update_info_rec = cr_repomd_record_new("updateinfo", update_info_filename);
cr_repomd_record_fill(update_info_rec, CR_CHECKSUM_SHA256, NULL);
}
if (cmd_options->koji) {
gchar *pkgorigins_path = g_strconcat(cmd_options->tmp_out_repo, "pkgorigins.gz", NULL);
- pkgorigins_rec = cr_repomd_record_new(pkgorigins_path, "origin");
+ pkgorigins_rec = cr_repomd_record_new("origin", pkgorigins_path);
cr_repomd_record_fill(pkgorigins_rec, CR_CHECKSUM_SHA256, NULL);
g_free(pkgorigins_path);
}
remove(oth_db_filename);
// Prepare repomd records
- pri_db_rec = cr_repomd_record_new(pri_db_c_filename, "primary_db");
- fil_db_rec = cr_repomd_record_new(fil_db_c_filename, "filelists_db");
- oth_db_rec = cr_repomd_record_new(oth_db_c_filename, "other_db");
+ pri_db_rec = cr_repomd_record_new("primary_db", pri_db_c_filename);
+ fil_db_rec = cr_repomd_record_new("filelists_db", fil_db_c_filename);
+ oth_db_rec = cr_repomd_record_new("other_db", oth_db_c_filename);
g_free(pri_db_filename);
g_free(fil_db_filename);
* cr_Repomd *md = cr_repomd_new();
* cr_RepomdRecord *rec;
*
+ * cr_xml_dump_init();
+ *
* // Set some repomd stuff
* cr_repomd_set_revision(md, "007");
* cr_repomd_add_repo_tag(md, "repotag");
* cr_repomd_add_distro_tag(md, "foocpeid", "data");
*
* // Create record for new metadata file
- * rec = cr_repomd_record_new("/foo/bar/repodata/primary.xml.xz");
+ * rec = cr_repomd_record_new("primary", "/foo/bar/repodata/primary.xml.xz");
* // Calculate all needed parameters (uncompresed size, checksum, ...)
* cr_repomd_record_fill(rec, CR_CHECKSUM_SHA256);
* // Rename source file - insert checksum into the filename
* cr_repomd_record_rename_file(rec)
* // Append the record into the repomd
- * cr_repomd_set_record(md, rec, "primary");
+ * cr_repomd_set_record(md, rec);
*
* // Get repomd.xml content
- * // Note: cr_xml_dump_init() shoud be once called before dump
* xml = cr_repomd_xml_dump(md);
+ *
+ * // Cleanup
* cr_repomd_free(md);
+ * cr_xml_dump_cleanup();
* \endcode
*
* \addtogroup repomd
* cr_Package *pkg;
* struct cr_XmlStruct xml;
*
+ * cr_xml_dump_init();
+ * cr_package_parser_init();
+ *
* pkg = cr_package_from_rpm("path/to/rpm.rpm", CR_CHECKSUM_SHA256,
* "repodata/rpm.rpm", NULL, 10, NULL);
*
- * cr_xml_dump_init();
* xml = cr_xml_dump(pkg, NULL);
- * cr_xml_dump_cleanup();
*
* cr_package_free(pkg);
*
* free(xml.primary);
* free(xml.filelists);
* free(xml.other);
+ *
+ * cr_package_parser_cleanup();
+ * cr_xml_dump_cleanup();
* \endcode
*
* \addtogroup xml_dump