From 9bed61bfd570d83374d58abc7612adb83a277e43 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Feb 21 2022 04:19:57 +0000 Subject: import createrepo_c-0.17.7-4.el8 --- diff --git a/SOURCES/0002-Default---keep-all-metadata-to-TRUE-and-add---discard-additional-metadata.patch b/SOURCES/0002-Default---keep-all-metadata-to-TRUE-and-add---discard-additional-metadata.patch new file mode 100644 index 0000000..b45969c --- /dev/null +++ b/SOURCES/0002-Default---keep-all-metadata-to-TRUE-and-add---discard-additional-metadata.patch @@ -0,0 +1,94 @@ +From b5f425fec738c1de344f4f917d3614e9efb98e2b Mon Sep 17 00:00:00 2001 +From: Aleš Matěj +Date: Thu, 23 Sep 2021 08:30:47 +0200 +Subject: [PATCH] Default --keep-all-metadata to TRUE and add --discard-additional-metadata + += changelog = +msg: Switch default of --keep-all-metadata to TRUE and add --discard-additional-metadata +type: enhancement +resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1992209 +--- + doc/createrepo_c.8 | 7 +++++-- + src/cmd_parser.c | 15 ++++++++++++--- + src/cmd_parser.h | 1 + + 3 files changed, 18 insertions(+), 5 deletions(-) + +diff --git a/doc/createrepo_c.8 b/doc/createrepo_c.8 +index c9017c5..1a3e101 100644 +--- a/doc/createrepo_c.8 ++++ b/doc/createrepo_c.8 +@@ -1,6 +1,6 @@ + .\" Man page generated from reStructuredText. + . +-.TH CREATEREPO_C 8 "2020-07-02" "" "" ++.TH CREATEREPO_C 8 "2021-09-23" "" "" + .SH NAME + createrepo_c \- Create rpm-md format (xml-rpm-metadata) repository + . +@@ -173,7 +173,10 @@ Generate zchunk files as well as the standard repodata. + Directory containing compression dictionaries for use by zchunk + .SS \-\-keep\-all\-metadata + .sp +-Keep all additional metadata (not primary, filelists and other xml or sqlite files, nor their compressed variants) from source repository during update. ++Keep all additional metadata (not primary, filelists and other xml or sqlite files, nor their compressed variants) from source repository during update (default). ++.SS \-\-discard\-additional\-metadata ++.sp ++Discard all additional metadata (not primary, filelists and other xml or sqlite files, nor their compressed variants) from source repository during update. + .SS \-\-compatibility + .sp + Enforce maximal compatibility with classical createrepo (Affects only: \-\-retain\-old\-md). +diff --git a/src/cmd_parser.c b/src/cmd_parser.c +index bbefa08..639d7e9 100644 +--- a/src/cmd_parser.c ++++ b/src/cmd_parser.c +@@ -65,6 +65,8 @@ struct CmdOptions _cmd_options = { + .zck_compression = FALSE, + .zck_dict_dir = NULL, + .recycle_pkglist = FALSE, ++ ++ .keep_all_metadata = TRUE, + }; + + +@@ -168,6 +170,9 @@ static GOptionEntry cmd_entries[] = + #endif + { "keep-all-metadata", 0, 0, G_OPTION_ARG_NONE, &(_cmd_options.keep_all_metadata), + "Keep all additional metadata (not primary, filelists and other xml or sqlite files, " ++ "nor their compressed variants) from source repository during update (default).", NULL }, ++ { "discard-additional-metadata", 0, 0, G_OPTION_ARG_NONE, &(_cmd_options.discard_additional_metadata), ++ "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 (Affects only: --retain-old-md).", NULL }, +@@ -510,9 +515,13 @@ check_arguments(struct CmdOptions *options, + x++; + } + +- // Check keep-all-metadata +- if (options->keep_all_metadata && !options->update) { +- g_warning("--keep-all-metadata has no effect (--update is not used)"); ++ if (options->discard_additional_metadata) { ++ options->keep_all_metadata = FALSE; ++ } ++ ++ // Check discard-additional-metadata ++ if (options->discard_additional_metadata && !options->update) { ++ g_warning("--discard-additional-metadata has no effect (--update is not used)"); + } + + // Process --distro tags +diff --git a/src/cmd_parser.h b/src/cmd_parser.h +index 32bcf99..03cfcf0 100644 +--- a/src/cmd_parser.h ++++ b/src/cmd_parser.h +@@ -77,6 +77,7 @@ struct CmdOptions { + char *zck_dict_dir; /*!< directory with zchunk dictionaries */ + gboolean keep_all_metadata; /*!< keep groupfile and updateinfo from source + repo during update */ ++ gboolean discard_additional_metadata; /*!< Inverse option to keep_all_metadata */ + gboolean ignore_lock; /*!< Ignore existing .repodata/ - remove it, + create the new one (empty) to serve as + a lock and use a .repodata.date.pid for +-- +libgit2 1.1.0 + diff --git a/SPECS/createrepo_c.spec b/SPECS/createrepo_c.spec index b764d00..89f8559 100644 --- a/SPECS/createrepo_c.spec +++ b/SPECS/createrepo_c.spec @@ -31,11 +31,12 @@ Summary: Creates a common metadata repository Name: createrepo_c Version: 0.17.7 -Release: 3%{?dist} +Release: 4%{?dist} License: GPLv2+ URL: https://github.com/rpm-software-management/createrepo_c Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz Patch1: 0001-Preserve-changed-API-for-cr_compress_file_with_stat-RhBug1973588.patch +Patch2: 0002-Default---keep-all-metadata-to-TRUE-and-add---discard-additional-metadata.patch BuildRequires: cmake BuildRequires: gcc @@ -183,6 +184,9 @@ ln -sr %{buildroot}%{_bindir}/modifyrepo_c %{buildroot}%{_bindir}/modifyrepo %{python3_sitearch}/%{name}-%{version}-py%{python3_version}.egg-info %changelog +* Wed Feb 16 2022 Pavla Kratochvilova - 0.17.7-4 +- Switch default of --keep-all-metadata to TRUE and add --discard-additional-metadata (RhBug:1992209) + * Mon Nov 29 2021 Pavla Kratochvilova - 0.17.7-3 - Fix memory leak of `tmp_err` (RhBug:2005781)