From 129f73968ac4406eaf67cdf845c1c27bd8822357 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Tue, 19 Sep 2017 09:59:46 +0200 Subject: [PATCH] Band-aid for DB_VERSION_MISMATCH errors on glibc updates References: https://bugzilla.redhat.com/show_bug.cgi?id=1483553 --- ...to-DB_PRIVATE-on-DB_VERSION_MISMATCH.patch | 31 +++++++++++++++++++ libsolv.spec | 7 ++++- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 0001-fall-back-to-DB_PRIVATE-on-DB_VERSION_MISMATCH.patch diff --git a/0001-fall-back-to-DB_PRIVATE-on-DB_VERSION_MISMATCH.patch b/0001-fall-back-to-DB_PRIVATE-on-DB_VERSION_MISMATCH.patch new file mode 100644 index 0000000..d1f38b1 --- /dev/null +++ b/0001-fall-back-to-DB_PRIVATE-on-DB_VERSION_MISMATCH.patch @@ -0,0 +1,31 @@ +From a7adb20f24a3acc4cd300b9fb12e07ee3dcfb8e3 Mon Sep 17 00:00:00 2001 +From: Panu Matilainen +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 + diff --git a/libsolv.spec b/libsolv.spec index bbb7aab..40b2ea6 100644 --- a/libsolv.spec +++ b/libsolv.spec @@ -39,12 +39,14 @@ Name: lib%{libname} Version: 0.6.29 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Package dependency solver License: BSD URL: https://github.com/openSUSE/libsolv 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: gcc-c++ @@ -287,6 +289,9 @@ popd %endif %changelog +* Tue Sep 19 2017 Panu Matilainen - 0.6.29-2 +- Band-aid for DB_VERSION_MISMATCH errors on glibc updates + * Thu Sep 07 2017 Igor Gnatenko - 0.6.29-1 - Update to 0.6.29