Update to 4.12.0

Resolves: rhbz#2074455
Resolves: rhbz#2064579
Resolves: rhbz#2046581
Resolves: rhbz#2053014
Resolves: rhbz#2070967
This commit is contained in:
Pavla Kratochvilova 2022-04-28 10:31:57 +02:00
parent bd959d231e
commit 872dc69a75
7 changed files with 29 additions and 277 deletions

1
.gitignore vendored
View File

@ -146,3 +146,4 @@
/dnf-4.6.1.tar.gz
/dnf-4.7.0.tar.gz
/dnf-4.10.0.tar.gz
/dnf-4.12.0.tar.gz

View File

@ -1,29 +0,0 @@
From 39e759ae6afb046cf6d60fb91b3ee208cb150a2f Mon Sep 17 00:00:00 2001
From: Jaroslav Mracek <jmracek@redhat.com>
Date: Mon, 6 Sep 2021 12:40:59 +0200
Subject: [PATCH] [doc] Improve description of multilib_policy=all (RhBug:1996681,1995630)
https://bugzilla.redhat.com/show_bug.cgi?id=1996681
https://bugzilla.redhat.com/show_bug.cgi?id=1995630
---
doc/conf_ref.rst | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/doc/conf_ref.rst b/doc/conf_ref.rst
index fa310e3..60afc86 100644
--- a/doc/conf_ref.rst
+++ b/doc/conf_ref.rst
@@ -403,7 +403,9 @@ configuration file by your distribution to override the DNF defaults.
``multilib_policy``
:ref:`string <string-label>`
- Controls how multilib packages are treated during install operations. Can either be ``"best"`` (the default) for the depsolver to prefer packages which best match the system's architecture, or ``"all"`` to install all available packages with compatible architectures.
+ Controls how multilib packages are treated during install operations. Can either be ``"best"`` (the default) for
+ the depsolver to prefer packages which best match the system's architecture, or ``"all"`` to install packages for
+ all available architectures.
.. _obsoletes_conf_option-label:
--
libgit2 1.1.0

View File

@ -1,33 +0,0 @@
From 9ce65d8575494887a08506583d9d4f05df404fac Mon Sep 17 00:00:00 2001
From: Jaroslav Rohel <jrohel@redhat.com>
Date: Wed, 20 Oct 2021 09:20:03 +0200
Subject: [PATCH] Fix: Python dnf API does not respect cacheonly (RhBug:1862970)
`Repo` object has always been constructed with default synchronization
strategy. The configuration option `cacheonly` was ignored. DNF
application set synchronization strategy later in the `Cli` object
during processing demands.
The fix takes into account the `cacheonly` option during the construction
of the `Repo` object. Synchronization strategy may still be overriden
during demand processing.
---
dnf/repo.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dnf/repo.py b/dnf/repo.py
index bb42230..1822cf0 100644
--- a/dnf/repo.py
+++ b/dnf/repo.py
@@ -434,7 +434,7 @@ class Repo(dnf.conf.RepoConf):
self._pkgdir = None
self._key_import = _NullKeyImport()
self.metadata = None # :api
- self._repo.setSyncStrategy(self.DEFAULT_SYNC)
+ self._repo.setSyncStrategy(SYNC_ONLY_CACHE if parent_conf and parent_conf.cacheonly else self.DEFAULT_SYNC)
if parent_conf:
self._repo.setSubstitutions(parent_conf.substitutions)
self._substitutions = dnf.conf.substitutions.Substitutions()
--
libgit2 1.1.0

View File

@ -1,26 +0,0 @@
From 5c598df3541c21d5c2758c42bd2eb0df8c74eddc Mon Sep 17 00:00:00 2001
From: Jaroslav Rohel <jrohel@redhat.com>
Date: Fri, 5 Nov 2021 08:52:56 +0100
Subject: [PATCH] Documentation: API notes for cacheonly
---
doc/conf_ref.rst | 3 +++
1 file changed, 3 insertions(+)
diff --git a/doc/conf_ref.rst b/doc/conf_ref.rst
index 60afc86..1a593a1 100644
--- a/doc/conf_ref.rst
+++ b/doc/conf_ref.rst
@@ -137,6 +137,9 @@ configuration file by your distribution to override the DNF defaults.
If set to ``True`` DNF will run entirely from system cache, will not update
the cache and will use it even in case it is expired. Default is ``False``.
+ API Notes: Must be set before repository objects are created. Plugins must set
+ this in the pre_config hook. Later changes are ignored.
+
.. _check_config_file_age-label:
``check_config_file_age``
--
libgit2 1.1.0

View File

@ -1,169 +0,0 @@
From 087ad3d12ba307355dd66aba54faea97d227a3dd Mon Sep 17 00:00:00 2001
From: zhanghaolian <65838930+iWhy98@users.noreply.github.com>
Date: Tue, 25 Jan 2022 15:41:16 +0800
Subject: [PATCH 1/2] dnf:fix dnf mark error when history sqlite missing
---
dnf/cli/commands/mark.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dnf/cli/commands/mark.py b/dnf/cli/commands/mark.py
index ec16b738d..cb1f91c13 100644
--- a/dnf/cli/commands/mark.py
+++ b/dnf/cli/commands/mark.py
@@ -89,7 +89,7 @@ class MarkCommand(commands.Command):
old = self.base.history.last()
if old is None:
- rpmdb_version = self.sack._rpmdb_version()
+ rpmdb_version = self.base.sack._rpmdb_version()
else:
rpmdb_version = old.end_rpmdb_version
--
2.34.1
From bee5b97ad159af019deda4de0d80d0011dba4f7a Mon Sep 17 00:00:00 2001
From: Jaroslav Rohel <jrohel@redhat.com>
Date: Fri, 28 Jan 2022 16:53:50 +0100
Subject: [PATCH 2/2] Use rpm.TransactionSet.dbCookie() to determining if rpmdb
has changed
DNF was using private method `hawkey.Sack._rpmdb_version()` from libdnf.
The method computes SHA1 hash from sorted list of hashes stored in
the headers of the instaled packages. And it adds prefix of the number
of installed packages to the computed hash. The result was stored
to the history database and used to detect changes in the rpm database.
The patch uses new oficial librpm API function
`rpm.TransactionSet.dbCookie()`. This is a cleaner solution.
It is also a step to remove the `._rpmdb_version()` method from libdnf.
It is an attempt to remove SHA1 calculations from libdnf.
Troubleshooting FIPS compatibility.
= changelog =
msg: Use rpm.TransactionSet.dbCookie() to determining if rpmdb has changed
type: bugfix
resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2043476
---
dnf/base.py | 6 +++---
dnf/cli/commands/mark.py | 2 +-
dnf/cli/output.py | 2 +-
dnf/rpm/transaction.py | 16 ++++++++++++++++
tests/test_sack.py | 6 ------
5 files changed, 21 insertions(+), 11 deletions(-)
diff --git a/dnf/base.py b/dnf/base.py
index b0a536f7f..574e80f66 100644
--- a/dnf/base.py
+++ b/dnf/base.py
@@ -907,7 +907,7 @@ class Base(object):
cmdline = ' '.join(self.cmds)
old = self.history.last()
if old is None:
- rpmdb_version = self.sack._rpmdb_version()
+ rpmdb_version = self._ts.dbCookie()
else:
rpmdb_version = old.end_rpmdb_version
@@ -1046,7 +1046,7 @@ class Base(object):
using_pkgs_pats = list(self.conf.history_record_packages)
installed_query = self.sack.query().installed()
using_pkgs = installed_query.filter(name=using_pkgs_pats).run()
- rpmdbv = self.sack._rpmdb_version()
+ rpmdbv = self._ts.dbCookie()
lastdbv = self.history.last()
if lastdbv is not None:
lastdbv = lastdbv.end_rpmdb_version
@@ -1163,7 +1163,7 @@ class Base(object):
for tsi in transaction_items:
count = display_banner(tsi.pkg, count)
- rpmdbv = rpmdb_sack._rpmdb_version()
+ rpmdbv = self._ts.dbCookie()
self.history.end(rpmdbv)
timer()
diff --git a/dnf/cli/commands/mark.py b/dnf/cli/commands/mark.py
index cb1f91c13..36bf9d436 100644
--- a/dnf/cli/commands/mark.py
+++ b/dnf/cli/commands/mark.py
@@ -89,7 +89,7 @@ class MarkCommand(commands.Command):
old = self.base.history.last()
if old is None:
- rpmdb_version = self.base.sack._rpmdb_version()
+ rpmdb_version = self.base._ts.dbCookie()
else:
rpmdb_version = old.end_rpmdb_version
diff --git a/dnf/cli/output.py b/dnf/cli/output.py
index a4e9f6c8e..ecf05c2b0 100644
--- a/dnf/cli/output.py
+++ b/dnf/cli/output.py
@@ -1607,7 +1607,7 @@ Transaction Summary
if lastdbv is not None and trans.tid == lasttid:
# If this is the last transaction, is good and it doesn't
# match the current rpmdb ... then mark it as bad.
- rpmdbv = self.sack._rpmdb_version()
+ rpmdbv = self.base._ts.dbCookie()
trans.compare_rpmdbv(str(rpmdbv))
lastdbv = None
diff --git a/dnf/rpm/transaction.py b/dnf/rpm/transaction.py
index bcc2a7024..a11f36e7e 100644
--- a/dnf/rpm/transaction.py
+++ b/dnf/rpm/transaction.py
@@ -12,8 +12,10 @@
from __future__ import absolute_import
from __future__ import unicode_literals
from dnf.i18n import _
+import logging
import rpm
+_logger = logging.getLogger('dnf')
read_ts = None
ts = None
@@ -61,6 +63,20 @@ class TransactionWrapper(object):
mi.pattern(tag, tp, pat)
return mi
+ def dbCookie(self):
+ # dbCookie() does not support lazy opening of rpm database.
+ # The following line opens the database if it is not already open.
+ if self.ts.openDB() != 0:
+ _logger.error(_('The openDB() function connot open rpm database.'))
+ return ''
+
+ cookie = self.ts.dbCookie()
+ if not cookie:
+ _logger.error(_('The dbCookie() function did not return cookie of rpm database.'))
+ return ''
+
+ return cookie
+
def __getattr__(self, attr):
if attr in self._methods:
return self.getMethod(attr)
diff --git a/tests/test_sack.py b/tests/test_sack.py
index 49a715924..2c6fe8e01 100644
--- a/tests/test_sack.py
+++ b/tests/test_sack.py
@@ -32,12 +32,6 @@ class SackTest(tests.support.DnfBaseTestCase):
REPOS = []
- def test_rpmdb_version(self):
- version = self.sack._rpmdb_version()
- self.assertIsNotNone(version)
- expected = "%s:%s" % (tests.support.TOTAL_RPMDB_COUNT, tests.support.RPMDB_CHECKSUM)
- self.assertEqual(version, expected)
-
def test_excludepkgs(self):
self.base.conf.excludepkgs = ['pepper']
self.base._setup_excludes_includes()
--
2.34.1

View File

@ -2,7 +2,7 @@
%define __cmake_in_source_build 1
# default dependencies
%global hawkey_version 0.65.0
%global hawkey_version 0.66.0
%global libcomps_version 0.1.8
%global libmodulemd_version 2.9.3
%global rpm_version 4.14.0
@ -65,17 +65,13 @@
It supports RPMs, modules and comps groups & environments.
Name: dnf
Version: 4.10.0
Release: 4%{?dist}
Version: 4.12.0
Release: 1%{?dist}
Summary: %{pkg_summary}
# For a breakdown of the licensing, see PACKAGE-LICENSING
License: GPLv2+
URL: https://github.com/rpm-software-management/dnf
Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz
Patch1: 0001-doc-Improve-description-of-multilib_policyall-RhBug19966811995630.patch
Patch2: 0002-Fix-Python-dnf-API-does-not-respect-cacheonly-RhBug1862970.patch
Patch3: 0003-Documentation-API-notes-for-cacheonly.patch
Patch4: 0004-Use-rpm.TransactionSet.dbCookie-to-determining-if-rp.patch
BuildArch: noarch
BuildRequires: cmake
@ -256,22 +252,13 @@ popd
%post automatic
%systemd_post dnf-automatic.timer
%systemd_post dnf-automatic-notifyonly.timer
%systemd_post dnf-automatic-download.timer
%systemd_post dnf-automatic-install.timer
%systemd_post dnf-automatic.timer dnf-automatic-notifyonly.timer dnf-automatic-download.timer dnf-automatic-install.timer
%preun automatic
%systemd_preun dnf-automatic.timer
%systemd_preun dnf-automatic-notifyonly.timer
%systemd_preun dnf-automatic-download.timer
%systemd_preun dnf-automatic-install.timer
%systemd_preun dnf-automatic.timer dnf-automatic-notifyonly.timer dnf-automatic-download.timer dnf-automatic-install.timer
%postun automatic
%systemd_postun_with_restart dnf-automatic.timer
%systemd_postun_with_restart dnf-automatic-notifyonly.timer
%systemd_postun_with_restart dnf-automatic-download.timer
%systemd_postun_with_restart dnf-automatic-install.timer
%systemd_postun_with_restart dnf-automatic.timer dnf-automatic-notifyonly.timer dnf-automatic-download.timer dnf-automatic-install.timer
%files -f %{name}.lang
@ -374,6 +361,27 @@ popd
%{python3_sitelib}/%{name}/automatic/
%changelog
* Thu Apr 28 2022 Pavla Kratochvilova <pkratoch@redhat.com> - 4.12.0-1
- Allow destdir option with modulesync command
- Add documentation for query api flags (RhBug:2035577)
- Fix swap command to work with local rpm files correctly (RhBug:2036434)
- Fix regression in verifying signatures using rpmkeys
- Fix decompression of groups.xml (RhBug:2030255)
- Fix history undo on a Reason Change (RhBug:2010259,2053014)
- Remove /usr/bin from sys.path to avoid accidentally importing garbage
- Fix python3.11 build: remove deprecated, update traceback regex
- fix dnf mark error when history sqlite missing
- [doc] clarify effect of --enablerepo and --disablerepo options (RhBug:2031414)
- [doc] default values for module_obsoletes and module_stream_switch (RhBug: 2051846)
- dnf.conf: hint users where to find more info about defaults and other options
- Fix unittests that relied on checksum being at the end of solvfiles
- completion: remove unnecessary echo
- Fix remove when no repos are enabled (RhBug:2064341)
- Add loongarch support for dnf
- Add spaces between words to fix typos (RhBug:2077296)
- [doc] Improve "proxy" configuration option documentation (RhBug:2072332)
- Fix download errors handling in non-english locales (RhBug:2024527)
* Mon Feb 07 2022 Pavla Kratochvilova <pkratoch@redhat.com> - 4.10.0-4
- Use rpm.TransactionSet.dbCookie() to determining if rpmdb has changed (RhBug:2043476)

View File

@ -1 +1 @@
SHA512 (dnf-4.10.0.tar.gz) = 7fddfd0ec0c37ea06f674820d1b5bcf8052420670dca9d28810193eb8f380fb5d5a642650785eaf10868b2bdb603002c46e86503b46e65e0c2940033d801e78f
SHA512 (dnf-4.12.0.tar.gz) = 27913bce6a5251d2f7aee0122e4fb238fa6ca8906027f15108a84ceab1cfc40eb5975ac3b365506580f2ff4daedbbfa2738bde2b6107bd2fa3efc2de5dd7a129