Band-aid for DB_VERSION_MISMATCH errors on glibc updates

References: https://bugzilla.redhat.com/show_bug.cgi?id=1483553
This commit is contained in:
Panu Matilainen 2017-09-19 09:59:46 +02:00 committed by Igor Gnatenko
parent c9f92ee550
commit 129f73968a
2 changed files with 37 additions and 1 deletions

View File

@ -0,0 +1,31 @@
From a7adb20f24a3acc4cd300b9fb12e07ee3dcfb8e3 Mon Sep 17 00:00:00 2001
From: Panu Matilainen <pmatilai@redhat.com>
Date: Tue, 19 Sep 2017 09:56:36 +0200
Subject: [PATCH] fall back to DB_PRIVATE on DB_VERSION_MISMATCH
---
ext/repo_rpmdb.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/ext/repo_rpmdb.c b/ext/repo_rpmdb.c
index c7000a9..85e327c 100644
--- a/ext/repo_rpmdb.c
+++ b/ext/repo_rpmdb.c
@@ -1246,7 +1246,13 @@ opendbenv(struct rpmdbstate *state)
{
#if defined(FEDORA) || defined(MAGEIA)
int serialize_fd = serialize_dbenv_ops(state);
- r = dbenv->open(dbenv, dbpath, DB_CREATE|DB_INIT_CDB|DB_INIT_MPOOL, 0644);
+ int eflags = DB_CREATE|DB_INIT_CDB|DB_INIT_MPOOL;
+ r = dbenv->open(dbenv, dbpath, eflags, 0644);
+ if (r == DB_VERSION_MISMATCH)
+ {
+ eflags |= DB_PRIVATE;
+ r = dbenv->open(dbenv, dbpath, eflags, 0644);
+ }
if (serialize_fd >= 0)
close(serialize_fd);
#else
--
2.14.1

View File

@ -39,12 +39,14 @@
Name: lib%{libname} Name: lib%{libname}
Version: 0.6.29 Version: 0.6.29
Release: 1%{?dist} Release: 2%{?dist}
Summary: Package dependency solver Summary: Package dependency solver
License: BSD License: BSD
URL: https://github.com/openSUSE/libsolv URL: https://github.com/openSUSE/libsolv
Source: %{url}/archive/%{version}/%{name}-%{version}.tar.gz Source: %{url}/archive/%{version}/%{name}-%{version}.tar.gz
# https://bugzilla.redhat.com/show_bug.cgi?id=1483553
Patch0: 0001-fall-back-to-DB_PRIVATE-on-DB_VERSION_MISMATCH.patch
BuildRequires: cmake BuildRequires: cmake
BuildRequires: gcc-c++ BuildRequires: gcc-c++
@ -287,6 +289,9 @@ popd
%endif %endif
%changelog %changelog
* Tue Sep 19 2017 Panu Matilainen <pmatilai@redhat.com> - 0.6.29-2
- Band-aid for DB_VERSION_MISMATCH errors on glibc updates
* Thu Sep 07 2017 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.6.29-1 * Thu Sep 07 2017 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.6.29-1
- Update to 0.6.29 - Update to 0.6.29