Update to 0.22.3

This commit is contained in:
Jaroslav Mracek 2018-11-22 09:41:51 +01:00
parent 4eaec77035
commit 2177a6cc29
9 changed files with 17 additions and 228 deletions

1
.gitignore vendored
View File

@ -27,3 +27,4 @@
/libdnf-0.19.1.tar.gz /libdnf-0.19.1.tar.gz
/libdnf-0.20.0.tar.gz /libdnf-0.20.0.tar.gz
/libdnf-0.22.0.tar.gz /libdnf-0.22.0.tar.gz
/libdnf-0.22.3.tar.gz

View File

@ -1,40 +0,0 @@
From 83a0b5f289fd9461b68b1afab525c0f4ca6015b1 Mon Sep 17 00:00:00 2001
From: Jaroslav Mracek <jmracek@redhat.com>
Date: Mon, 15 Oct 2018 21:27:15 +0200
Subject: [PATCH] Modify solver_describe_decision to report cleaned (RhBug:1486749)
---
libdnf/goal/Goal.cpp | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/libdnf/goal/Goal.cpp b/libdnf/goal/Goal.cpp
index 50fef5c..7d17a49 100644
--- a/libdnf/goal/Goal.cpp
+++ b/libdnf/goal/Goal.cpp
@@ -647,7 +647,8 @@ Goal::getReason(DnfPackage *pkg)
if (!pImpl->solv)
return HY_REASON_USER;
Id info;
- int reason = solver_describe_decision(pImpl->solv, dnf_package_get_id(pkg), &info);
+ const Id pkgID = dnf_package_get_id(pkg);
+ int reason = solver_describe_decision(pImpl->solv, pkgID, &info);
if ((reason == SOLVER_REASON_UNIT_RULE ||
reason == SOLVER_REASON_RESOLVE_JOB) &&
@@ -658,6 +659,13 @@ Goal::getReason(DnfPackage *pkg)
return HY_REASON_CLEAN;
if (reason == SOLVER_REASON_WEAKDEP)
return HY_REASON_WEAKDEP;
+ IdQueue cleanDepsQueue;
+ solver_get_cleandeps(pImpl->solv, cleanDepsQueue.getQueue());
+ for (int i = 0; i < cleanDepsQueue.size(); ++i) {
+ if (cleanDepsQueue[i] == pkgID) {
+ return HY_REASON_CLEAN;
+ }
+ }
return HY_REASON_DEP;
}
--
libgit2 0.26.6

View File

@ -1,25 +0,0 @@
From cc7776ba7e33770ad5744a67d32b03aaece992f8 Mon Sep 17 00:00:00 2001
From: Daniel Mach <dmach@redhat.com>
Date: Wed, 17 Oct 2018 12:12:18 +0200
Subject: [PATCH] [history] Fix crash in TransactionItem::addReplacedBy().
---
libdnf/transaction/TransactionItem.hpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libdnf/transaction/TransactionItem.hpp b/libdnf/transaction/TransactionItem.hpp
index dc4e2c8..72684f7 100644
--- a/libdnf/transaction/TransactionItem.hpp
+++ b/libdnf/transaction/TransactionItem.hpp
@@ -110,7 +110,7 @@ public:
// int64_t getTransactionId() const noexcept { return trans.getId(); }
const std::vector< TransactionItemPtr > &getReplacedBy() const noexcept { return replacedBy; }
- void addReplacedBy(TransactionItemPtr value) { replacedBy.push_back(value); }
+ void addReplacedBy(TransactionItemPtr value) { if (value) replacedBy.push_back(value); }
void save();
void saveReplacedBy();
--
libgit2 0.26.6

View File

@ -1,37 +0,0 @@
From dbe553c3846061f022dae906276b77a8430cce6a Mon Sep 17 00:00:00 2001
From: Jaroslav Rohel <jrohel@redhat.com>
Date: Thu, 18 Oct 2018 16:06:55 +0200
Subject: [PATCH] [swdb] create persistent WAL files (RhBug:1640235)
---
libdnf/utils/sqlite3/Sqlite3.cpp | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/libdnf/utils/sqlite3/Sqlite3.cpp b/libdnf/utils/sqlite3/Sqlite3.cpp
index 021b5d2..27fed56 100644
--- a/libdnf/utils/sqlite3/Sqlite3.cpp
+++ b/libdnf/utils/sqlite3/Sqlite3.cpp
@@ -30,9 +30,17 @@ SQLite3::open()
sqlite3_close(db);
throw LibException(result, "Open failed");
}
- // sqlite doesn't behave correctly in chroots without following line:
- // turn foreign key checking on
- exec("PRAGMA locking_mode = NORMAL; PRAGMA journal_mode = WAL; PRAGMA foreign_keys = ON;");
+#if SQLITE_VERSION_NUMBER >= 3022000
+ int enabled = 1;
+ sqlite3_file_control(db, "main", SQLITE_FCNTL_PERSIST_WAL, &enabled);
+ if (sqlite3_db_readonly(db, "main") == 1)
+ exec("PRAGMA locking_mode = NORMAL; PRAGMA foreign_keys = ON;");
+ else
+ exec("PRAGMA locking_mode = NORMAL; PRAGMA journal_mode = WAL; PRAGMA foreign_keys = ON;");
+#else
+ // Journal mode WAL in readonly mode is supported from sqlite version 3.22.0
+ exec("PRAGMA locking_mode = NORMAL; PRAGMA journal_mode = TRUNCATE; PRAGMA foreign_keys = ON;");
+#endif
sqlite3_busy_timeout(db, 10000);
}
}
--
libgit2 0.26.7

View File

@ -1,58 +0,0 @@
From 744a95e49b6f29aa65bc5b28e0e821c38c481581 Mon Sep 17 00:00:00 2001
From: Jaroslav Mracek <jmracek@redhat.com>
Date: Fri, 19 Oct 2018 15:44:39 +0200
Subject: [PATCH] Relocate ModuleContainer save hook (RhBug:1632518)
---
libdnf/dnf-context.cpp | 5 +----
libdnf/dnf-transaction.cpp | 5 +++++
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/libdnf/dnf-context.cpp b/libdnf/dnf-context.cpp
index 141af3a..db1741c 100644
--- a/libdnf/dnf-context.cpp
+++ b/libdnf/dnf-context.cpp
@@ -1879,10 +1879,7 @@ dnf_context_run(DnfContext *context, GCancellable *cancellable, GError **error)
error);
if (!ret)
return FALSE;
- auto moduleContainer = dnf_sack_get_module_container(priv->sack);
- if (moduleContainer) {
- moduleContainer->save();
- }
+
/* this sack is no longer valid */
g_object_unref(priv->sack);
priv->sack = NULL;
diff --git a/libdnf/dnf-transaction.cpp b/libdnf/dnf-transaction.cpp
index 5c078a0..0d948d7 100644
--- a/libdnf/dnf-transaction.cpp
+++ b/libdnf/dnf-transaction.cpp
@@ -38,12 +38,14 @@
#include "dnf-package.h"
#include "dnf-rpmts.h"
#include "dnf-sack.h"
+#include "dnf-sack-private.hpp"
#include "dnf-transaction.h"
#include "dnf-types.h"
#include "dnf-utils.h"
#include "hy-query.h"
#include "hy-util-private.hpp"
+#include "module/ModulePackageContainer.hpp"
#include "transaction/Swdb.hpp"
#include "transaction/Transformer.hpp"
#include "utils/bgettext/bgettext-lib.h"
@@ -1435,6 +1437,9 @@ dnf_transaction_commit(DnfTransaction *transaction, HyGoal goal, DnfState *state
goto out;
}
+ if (auto moduleContainer = dnf_sack_get_module_container(dnf_context_get_sack(priv->context)))
+ moduleContainer->save();
+
/* all sacks are invalid now */
dnf_context_invalidate_full(priv->context,
"transaction performed",
--
libgit2 0.26.7

View File

@ -1,30 +0,0 @@
From 1e7118d01d9ba92f759cd9669f9d0dd5af0619d6 Mon Sep 17 00:00:00 2001
From: Jaroslav Mracek <jmracek@redhat.com>
Date: Sat, 20 Oct 2018 01:13:49 +0200
Subject: [PATCH] Test if sack is present and run save module persistor (RhBug:1632518)
---
libdnf/dnf-transaction.cpp | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/libdnf/dnf-transaction.cpp b/libdnf/dnf-transaction.cpp
index 0d948d7..b89eace 100644
--- a/libdnf/dnf-transaction.cpp
+++ b/libdnf/dnf-transaction.cpp
@@ -1437,8 +1437,11 @@ dnf_transaction_commit(DnfTransaction *transaction, HyGoal goal, DnfState *state
goto out;
}
- if (auto moduleContainer = dnf_sack_get_module_container(dnf_context_get_sack(priv->context)))
- moduleContainer->save();
+ if (DnfSack * sack = hy_goal_get_sack(goal)) {
+ if (auto moduleContainer = dnf_sack_get_module_container(sack)) {
+ moduleContainer->save();
+ }
+ }
/* all sacks are invalid now */
dnf_context_invalidate_full(priv->context,
--
libgit2 0.26.7

View File

@ -1,26 +0,0 @@
From b2d35e9b7168c572320444e5b1e831def7e5b065 Mon Sep 17 00:00:00 2001
From: Daniel Mach <dmach@redhat.com>
Date: Tue, 6 Nov 2018 14:31:38 +0100
Subject: [PATCH] [transaction] Fix transaction item lookup for obsoleted packages (RhBug: 1642796)
---
libdnf/dnf-transaction.cpp | 3 +++
1 file changed, 3 insertions(+)
diff --git a/libdnf/dnf-transaction.cpp b/libdnf/dnf-transaction.cpp
index b89eace..2aed9a9 100644
--- a/libdnf/dnf-transaction.cpp
+++ b/libdnf/dnf-transaction.cpp
@@ -713,6 +713,9 @@ dnf_transaction_ts_progress_cb(const void *arg,
case RPMCALLBACK_UNINST_STOP:
pkg = dnf_find_pkg_from_header(priv->remove, hdr);
+ if (pkg == NULL) {
+ pkg = dnf_find_pkg_from_header(priv->remove_helper, hdr);
+ }
if (pkg == NULL && filename != NULL) {
pkg = dnf_find_pkg_from_filename_suffix(priv->remove, filename);
}
--
libgit2 0.26.7

View File

@ -1,6 +1,6 @@
%global libsolv_version 0.6.30-1 %global libsolv_version 0.6.35-1
%global libmodulemd_version 1.6.1 %global libmodulemd_version 1.6.1
%global dnf_conflict 3.7.1 %global dnf_conflict 4.0.9
%global swig_version 3.0.12 %global swig_version 3.0.12
%bcond_with valgrind %bcond_with valgrind
@ -12,7 +12,7 @@
%bcond_without python3 %bcond_without python3
%endif %endif
%if 0%{?rhel} > 7 %if 0%{?rhel} > 7 || 0%{?fedora} > 29
# Disable python2 build by default # Disable python2 build by default
%bcond_with python2 %bcond_with python2
%else %else
@ -30,18 +30,12 @@
%{nil} %{nil}
Name: libdnf Name: libdnf
Version: 0.22.0 Version: 0.22.3
Release: 8%{?dist} Release: 1%{?dist}
Summary: Library providing simplified C and Python API to libsolv Summary: Library providing simplified C and Python API to libsolv
License: LGPLv2+ License: LGPLv2+
URL: https://github.com/rpm-software-management/libdnf URL: https://github.com/rpm-software-management/libdnf
Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz
Patch0001: 0001-Modify-solver_describe_decision-to-report-cleaned-RhBug1486749.patch
Patch0002: 0002-history-Fix-crash-in-TransactionItemaddReplacedBy.patch
Patch0003: 0003-swdb-create-persistent-WAL-files-RhBug1640235.patch
Patch0004: 0004-Relocate-ModuleContainer-save-hook-RhBug1632518.patch
Patch0005: 0005-Test-if-sack-is-present-and-run-save-module-persistor-RhBug1632518.patch
Patch0006: 0006-transaction-Fix-transaction-item-lookup-for-obsoleted-packages-RhBug-1642796.patch
BuildRequires: cmake BuildRequires: cmake
BuildRequires: gcc BuildRequires: gcc
@ -249,6 +243,16 @@ popd
%endif %endif
%changelog %changelog
* Thu Nov 22 2018 Jaroslav Mracek <jmracek@redhat.com> - 0.22.3-1
- Permanently disable Python2 build for Fedora 30+
- Update to 0.22.3
- Modify solver_describe_decision to report cleaned (RhBug:1486749)
- [swdb] create persistent WAL files (RhBug:1640235)
- Relocate ModuleContainer save hook (RhBug:1632518)
- [transaction] Fix transaction item lookup for obsoleted packages (RhBug: 1642796)
- Fix memory leaks and memory allocations
- [repo] Possibility to extend downloaded repository metadata
* Wed Nov 07 2018 Jaroslav Mracek <jmracek@redhat.com> - 0.22.0-8 * Wed Nov 07 2018 Jaroslav Mracek <jmracek@redhat.com> - 0.22.0-8
- Backport fixes for RHBZ#1642796 from upstream master - Backport fixes for RHBZ#1642796 from upstream master

View File

@ -1 +1 @@
SHA512 (libdnf-0.22.0.tar.gz) = a9d11fd20505d559a62178b74d95ac840bf0e09f82b95faef217631d6ad05c1a796fd2097e5bc772a8f07716561169c1f147d5ab6613a828f5653cb1f12e4cd7 SHA512 (libdnf-0.22.3.tar.gz) = 4563030eafad6c0536623a675f1ade35da49667073e2ebbc3ec03602861ee71aee1fa2f1d6109ad7fd4fbc91302c744c143c24a22179edc4f88ad886e9bdb9d8