From ac4b3a4b814c5b6e0bf5766e26bef0141b0c0809 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Wed, 25 Jul 2018 15:16:31 +0200 Subject: [PATCH] Backport patch for multiple packages with same name for mergerepo_c Signed-off-by: Igor Gnatenko --- ...ages-in-mergerepo_c-in-case-multiple.patch | 35 +++++++++++++++++++ createrepo_c.spec | 12 ++++--- 2 files changed, 42 insertions(+), 5 deletions(-) create mode 100644 0001-Fix-missing-packages-in-mergerepo_c-in-case-multiple.patch diff --git a/0001-Fix-missing-packages-in-mergerepo_c-in-case-multiple.patch b/0001-Fix-missing-packages-in-mergerepo_c-in-case-multiple.patch new file mode 100644 index 0000000..1944397 --- /dev/null +++ b/0001-Fix-missing-packages-in-mergerepo_c-in-case-multiple.patch @@ -0,0 +1,35 @@ +From a7d4e4a8263e0da53959b49803f5b2dd249e3c69 Mon Sep 17 00:00:00 2001 +From: Jan Kaluza +Date: Wed, 25 Jul 2018 15:05:11 +0200 +Subject: [PATCH] Fix missing packages in mergerepo_c in case multiple VR + exists for single pkg in repo. + +--- + src/mergerepo_c.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/mergerepo_c.c b/src/mergerepo_c.c +index 94b929c..ad20a84 100644 +--- a/src/mergerepo_c.c ++++ b/src/mergerepo_c.c +@@ -471,7 +471,7 @@ new_merged_metadata_hashtable() + { + GHashTable *hashtable = g_hash_table_new_full(g_str_hash, + g_str_equal, +- NULL, ++ g_free, + free_merged_values); + return hashtable; + } +@@ -824,7 +824,7 @@ add_package(cr_Package *pkg, + repopath_with_protocol = prepend_protocol(repopath); + pkg->location_base = cr_safe_string_chunk_insert(pkg->chunk, repopath_with_protocol); + } +- g_hash_table_insert (merged, (gpointer) pkg->name, (gpointer) list); ++ g_hash_table_insert (merged, (gpointer) g_strdup(pkg->name), (gpointer) list); + return 1; + } + +-- +2.18.0 + diff --git a/createrepo_c.spec b/createrepo_c.spec index 346e953..58297bc 100644 --- a/createrepo_c.spec +++ b/createrepo_c.spec @@ -1,5 +1,3 @@ -%{!?_licensedir:%global license %%doc} - # Bash completion (we need different approach for RHEL-6) %if 0%{?rhel} == 6 %global bash_completion %config%{_sysconfdir}/bash_completion.d/createrepo_c.bash @@ -7,8 +5,6 @@ %global bash_completion %{_datadir}/bash-completion/completions/* %endif -%{!?python2_sitearch:%global python2_sitearch %{python_sitearch}} - %if 0%{?rhel} && 0%{?rhel} <= 7 %bcond_with python3 %bcond_with drpm @@ -26,11 +22,14 @@ Summary: Creates a common metadata repository Name: createrepo_c Version: 0.11.0 -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 +# https://github.com/rpm-software-management/createrepo_c/pull/100 +Patch0001: 0001-Fix-missing-packages-in-mergerepo_c-in-case-multiple.patch + BuildRequires: cmake BuildRequires: gcc BuildRequires: bzip2-devel @@ -223,6 +222,9 @@ ln -sr %{buildroot}%{_bindir}/modifyrepo_c %{buildroot}%{_bindir}/modifyrepo %endif %changelog +* Wed Jul 25 2018 Igor Gnatenko - 0.11.0-4 +- Backport patch for multiple packages with same name for mergerepo_c + * Thu Jul 12 2018 Fedora Release Engineering - 0.11.0-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild