Accepting request 438024 from home:M0ses:branches:system:packagemanager

OBS-URL: https://build.opensuse.org/request/show/438024
OBS-URL: https://build.opensuse.org/package/show/system:packagemanager/createrepo_c?expand=0&rev=12
This commit is contained in:
Frank Schreiner 2016-10-31 13:15:00 +00:00 committed by Git OBS Bridge
parent 97fbda4b7a
commit d70c720381
4 changed files with 61 additions and 7 deletions

View File

@ -0,0 +1,53 @@
diff --git a/src/parsehdr.c b/src/parsehdr.c
index ceaf884..61f5a89 100644
--- a/src/parsehdr.c
+++ b/src/parsehdr.c
@@ -319,7 +319,10 @@ cr_package_from_header(Header hdr,
};
// Hastable with filenames from provided
- GHashTable *provided_hashtable = g_hash_table_new(g_str_hash, g_str_equal);
+ GHashTable *provided_hashtable = g_hash_table_new_full(g_str_hash,
+ g_str_equal,
+ NULL,
+ g_free);
// Hashtable with already processed files from requires
GHashTable *ap_hashtable = g_hash_table_new_full(g_str_hash,
@@ -358,15 +361,19 @@ cr_package_from_header(Header hdr,
}
// Skip package primary files
- if (g_hash_table_lookup_extended(filenames_hashtable, filename, NULL, NULL)) {
+ if (*filename == '/' && g_hash_table_lookup_extended(filenames_hashtable, filename, NULL, NULL)) {
if (cr_is_primary(filename)) {
continue;
}
}
// Skip files which are provided
- if (g_hash_table_lookup_extended(provided_hashtable, filename, NULL, NULL)) {
- continue;
+ gpointer pvalue;
+ if (g_hash_table_lookup_extended(provided_hashtable, filename, NULL, &pvalue)) {
+ struct ap_value_struct *ap_value = pvalue;
+ if (!ap_value->flags || !ap_value->flags[0] || !flags || !flags[0] ||
+ (!g_strcmp0(ap_value->flags, flags) && !g_strcmp0(ap_value->version, full_version)))
+ continue;
}
// Calculate pre value
@@ -413,8 +420,12 @@ cr_package_from_header(Header hdr,
switch (deptype) {
case DEP_PROVIDES:
- g_hash_table_replace(provided_hashtable, dependency->name, dependency->name);
pkg->provides = g_slist_prepend(pkg->provides, dependency);
+ struct ap_value_struct *pvalue = g_malloc(sizeof(struct ap_value_struct));
+ pvalue->flags = flags;
+ pvalue->version = full_version;
+ pvalue->pre = dependency->pre;
+ g_hash_table_replace(provided_hashtable, dependency->name, pvalue);
break;
case DEP_CONFLICTS:
pkg->conflicts = g_slist_prepend(pkg->conflicts, dependency);

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:86504509036d18db8a9829acb9e5108a2e62e438611e65940ac45aca24e63a8a
size 373784

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:00a3dbba22ca41503f12aed7f9c5496b477edcdf608c0090847518ade8944092
size 357990

View File

@ -20,17 +20,17 @@
%define libname lib%{name}%{major}
%define devname lib%{name}-devel
%define version_unconverted 0.10.0.git20160503.7c6fae0
%define version_unconverted 0.10.0.git20160929.547b5db
Name: createrepo_c
Summary: Creates a common metadata repository
License: GPL-2.0
Group: System/Packages
Version: 0.10.0.git20160503.7c6fae0
Version: 0.10.0.git20160929.547b5db
Release: 0
Url: https://github.com/rpm-software-management/createrepo_c
Source0: %{name}-%{version}.tar.gz
Patch0: 000-Ensure_that_provides-requires_versions_are_factored_into_dep_filtering.diff
BuildRequires: bash-completion
%if 0%{?suse_version} >= 1330
@ -38,8 +38,8 @@ BuildRequires: bash-completion-devel
%endif
BuildRequires: cmake
BuildRequires: fdupes
BuildRequires: doxygen
BuildRequires: fdupes
BuildRequires: file-devel
BuildRequires: glib2-devel >= 2.22.0
BuildRequires: libbz2-devel
@ -87,6 +87,7 @@ These development files are for easy manipulation with a repodata.
%prep
%setup -q
%patch0 -p1
%if %{with python3}
rm -rf py3