// XML
- cr_fill_repomdrecord(pri_xml_rec, &(cmd_options->checksum_type));
- cr_fill_repomdrecord(fil_xml_rec, &(cmd_options->checksum_type));
- cr_fill_repomdrecord(oth_xml_rec, &(cmd_options->checksum_type));
+ cr_fill_repomdrecord(pri_xml_rec, cmd_options->checksum_type);
+ cr_fill_repomdrecord(fil_xml_rec, cmd_options->checksum_type);
+ cr_fill_repomdrecord(oth_xml_rec, cmd_options->checksum_type);
// Groupfile
compressed_groupfile_rec = cr_new_repomdrecord(groupfile);
cr_process_groupfile_repomdrecord(groupfile_rec,
compressed_groupfile_rec,
- &(cmd_options->checksum_type),
+ cmd_options->checksum_type,
groupfile_compression);
}
if (updateinfo) {
updateinfo_rec = cr_new_repomdrecord(updateinfo);
- cr_fill_repomdrecord(updateinfo_rec, &(cmd_options->checksum_type));
+ cr_fill_repomdrecord(updateinfo_rec, cmd_options->checksum_type);
}
fil_db_rec = cr_new_repomdrecord(fil_db_name);
oth_db_rec = cr_new_repomdrecord(oth_db_name);
- cr_fill_repomdrecord(pri_db_rec, &(cmd_options->checksum_type));
- cr_fill_repomdrecord(fil_db_rec, &(cmd_options->checksum_type));
- cr_fill_repomdrecord(oth_db_rec, &(cmd_options->checksum_type));
+ cr_fill_repomdrecord(pri_db_rec, cmd_options->checksum_type);
+ cr_fill_repomdrecord(fil_db_rec, cmd_options->checksum_type);
+ cr_fill_repomdrecord(oth_db_rec, cmd_options->checksum_type);
g_free(pri_db_name);
g_free(fil_db_name);
// XML
- cr_fill_repomdrecord(pri_xml_rec, NULL);
- cr_fill_repomdrecord(fil_xml_rec, NULL);
- cr_fill_repomdrecord(oth_xml_rec, NULL);
+ cr_fill_repomdrecord(pri_xml_rec, CR_CHECKSUM_SHA256);
+ cr_fill_repomdrecord(fil_xml_rec, CR_CHECKSUM_SHA256);
+ cr_fill_repomdrecord(oth_xml_rec, CR_CHECKSUM_SHA256);
// Groupfile
compressed_groupfile_rec = cr_new_repomdrecord(groupfile);
cr_process_groupfile_repomdrecord(groupfile_rec,
compressed_groupfile_rec,
- NULL,
+ CR_CHECKSUM_SHA256,
cmd_options->groupfile_compression_type);
}
if (!cmd_options->noupdateinfo) {
update_info_rec = cr_new_repomdrecord(update_info_filename);
- cr_fill_repomdrecord(update_info_rec, NULL);
+ cr_fill_repomdrecord(update_info_rec, CR_CHECKSUM_SHA256);
}
if (cmd_options->koji) {
gchar *pkgorigins_path = g_strconcat(cmd_options->tmp_out_repo, "pkgorigins.gz", NULL);
pkgorigins_rec = cr_new_repomdrecord(pkgorigins_path);
- cr_fill_repomdrecord(pkgorigins_rec, NULL);
+ cr_fill_repomdrecord(pkgorigins_rec, CR_CHECKSUM_SHA256);
g_free(pkgorigins_path);
}
g_free(fil_db_c_filename);
g_free(oth_db_c_filename);
- cr_fill_repomdrecord(pri_db_rec, NULL);
- cr_fill_repomdrecord(fil_db_rec, NULL);
- cr_fill_repomdrecord(oth_db_rec, NULL);
+ cr_fill_repomdrecord(pri_db_rec, CR_CHECKSUM_SHA256);
+ cr_fill_repomdrecord(fil_db_rec, CR_CHECKSUM_SHA256);
+ cr_fill_repomdrecord(oth_db_rec, CR_CHECKSUM_SHA256);
}
#define LOCATION_HREF_PREFIX "repodata/"
-#define DEFAULT_CHECKSUM "sha256"
-#define DEFAULT_CHECKSUM_ENUM_VAL CR_CHECKSUM_SHA256
-
#define DEFAULT_DATABASE_VERSION 10
#define STR_BUFFER_SIZE 32
int
-cr_fill_repomdrecord(cr_RepomdRecord md, cr_ChecksumType *checksum_type)
+cr_fill_repomdrecord(cr_RepomdRecord md, cr_ChecksumType checksum_type)
{
- const char *checksum_str = DEFAULT_CHECKSUM;
- cr_ChecksumType checksum_t = DEFAULT_CHECKSUM_ENUM_VAL;
+ const char *checksum_str;
+ cr_ChecksumType checksum_t;
gchar *path;
if (!md || !(md->location_real) || !strlen(md->location_real)) {
path = md->location_real;
- if (checksum_type) {
- checksum_str = cr_checksum_name_str(*checksum_type);
- checksum_t = *checksum_type;
- }
+ checksum_str = cr_checksum_name_str(checksum_type);
+ checksum_t = checksum_type;
if (!g_file_test(path, G_FILE_TEST_EXISTS|G_FILE_TEST_IS_REGULAR)) {
// File doesn't exists
void
cr_process_groupfile_repomdrecord(cr_RepomdRecord groupfile,
cr_RepomdRecord cgroupfile,
- cr_ChecksumType *checksum_type,
+ cr_ChecksumType checksum_type,
cr_CompressionType groupfile_compression)
{
const char *suffix;
long gf_size = -1, cgf_size = -1;
long gf_time = -1, cgf_time = -1;
struct stat gf_stat, cgf_stat;
+ const char *checksum_str;
+ cr_ChecksumType checksum_t;
if (!groupfile || !(groupfile->location_real)
|| !strlen(groupfile->location_real) || !cgroupfile) {
// Checksum stuff
- const char *checksum_str = DEFAULT_CHECKSUM;
- cr_ChecksumType checksum_t = DEFAULT_CHECKSUM_ENUM_VAL;
-
- if (checksum_type) {
- checksum_str = cr_checksum_name_str(*checksum_type);
- checksum_t = *checksum_type;
- }
+ checksum_str = cr_checksum_name_str(checksum_type);
+ checksum_t = checksum_type;
// Paths
* @param checksum_type type of checksum to use
*/
int cr_fill_repomdrecord(cr_RepomdRecord record,
- cr_ChecksumType *checksum_type);
+ cr_ChecksumType checksum_type);
/** \ingroup repomd
* Analogue of cr_fill_repomdrecord but for groupfile.
*/
void cr_process_groupfile_repomdrecord(cr_RepomdRecord groupfile,
cr_RepomdRecord compressed_groupfile,
- cr_ChecksumType *checksum_type,
+ cr_ChecksumType checksum_type,
cr_CompressionType compression);
/** \ingroup repomd