Backport patch for multiple packages with same name for mergerepo_c

Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
This commit is contained in:
Igor Gnatenko 2018-07-25 15:16:31 +02:00
parent 662f5e87bd
commit ac4b3a4b81
No known key found for this signature in database
GPG Key ID: 695714BD1BBC5F4C
2 changed files with 42 additions and 5 deletions

View File

@ -0,0 +1,35 @@
From a7d4e4a8263e0da53959b49803f5b2dd249e3c69 Mon Sep 17 00:00:00 2001
From: Jan Kaluza <jkaluza@redhat.com>
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

View File

@ -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 <ignatenkobrain@fedoraproject.org> - 0.11.0-4
- Backport patch for multiple packages with same name for mergerepo_c
* Thu Jul 12 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.11.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild