From dcc820dc725eb490574cb51e7966f988b6288c20 Mon Sep 17 00:00:00 2001 From: Daniel Alley Date: Tue, 6 Feb 2024 00:06:08 -0500 Subject: [PATCH] --compatibility avoids compressing group metadata closes #403 --- src/cmd_parser.c | 2 +- src/createrepo_c.c | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/cmd_parser.c b/src/cmd_parser.c index 10e04bfb..327d69e8 100644 --- a/src/cmd_parser.c +++ b/src/cmd_parser.c @@ -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', ...). " diff --git a/src/createrepo_c.c b/src/createrepo_c.c index 88beee9d..495c5936 100644 --- a/src/createrepo_c.c +++ b/src/createrepo_c.c @@ -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");