Skip to content

Commit

Permalink
--compatibility avoids compressing group metadata
Browse files Browse the repository at this point in the history
closes #403
  • Loading branch information
dralley committed Feb 7, 2024
1 parent c00f74f commit 7d7f689
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/cmd_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ static GOptionEntry cmd_entries[] =
"Discard all additional metadata (not primary, filelists and other xml or sqlite files, "
"nor their compressed variants) from source repository during update.", NULL },
{ "compatibility", 0, 0, G_OPTION_ARG_NONE, &(_cmd_options.compatibility),
"Enforce maximal compatibility with classical createrepo (Changes --retain-old-md behavior, uses Gzip for compression, produces sqlite metadata by default).", NULL },
"Enforce maximal compatibility with classical createrepo and yum (Changes --retain-old-md behavior, uses Gzip for compression, produces sqlite metadata by default, leaves group metadata uncompressed).", NULL },
{ "retain-old-md-by-age", 0, 0, G_OPTION_ARG_STRING, &(_cmd_options.retain_old_md_by_age),
"During --update, remove all files in repodata/ which are older "
"then the specified period of time. (e.g. '2h', '30d', ...). "
Expand Down
7 changes: 6 additions & 1 deletion src/createrepo_c.c
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,12 @@ main(int argc, char **argv)

// Groupfile specified as argument
if (cmd_options->groupfile_fullpath) {
gchar *compressed_path = cr_compress_groupfile(cmd_options->groupfile_fullpath, tmp_out_repo, compression);
cr_CompressionType group_compression = compression;
// Skip compressing the group metadata when using --compatibility flag
if (cmd_options->compatibility) {
group_compression = CR_CW_NO_COMPRESSION;
}
gchar *compressed_path = cr_compress_groupfile(cmd_options->groupfile_fullpath, tmp_out_repo, group_compression);
cr_Metadatum *new_groupfile_metadatum = g_malloc0(sizeof(cr_Metadatum));
new_groupfile_metadatum->name = compressed_path;
new_groupfile_metadatum->type = g_strdup("group");
Expand Down

0 comments on commit 7d7f689

Please sign in to comment.