import dnf-4.10.0-5.el9_0

This commit is contained in:
CentOS Sources 2022-05-17 06:28:35 -04:00 committed by Stepan Oksanichenko
commit 88f507c549
8 changed files with 10673 additions and 0 deletions

1
.dnf.metadata Normal file
View File

@ -0,0 +1 @@
cad8de377a20b5cf6668eb4c4150248bfaa1ed20 SOURCES/dnf-4.10.0.tar.gz

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
SOURCES/dnf-4.10.0.tar.gz

View File

@ -0,0 +1,29 @@
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

@ -0,0 +1,33 @@
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

@ -0,0 +1,26 @@
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

@ -0,0 +1,169 @@
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

File diff suppressed because it is too large Load Diff

2688
SPECS/dnf.spec Normal file

File diff suppressed because it is too large Load Diff