import dnf-4.7.0-9.el8

This commit is contained in:
CentOS Sources 2022-05-14 12:11:25 +00:00 committed by Stepan Oksanichenko
parent 5955cd40b5
commit c80aa486da
8 changed files with 314 additions and 21208 deletions

View File

@ -0,0 +1,57 @@
From 27f26c607c44b8331b23c861241a8509c2452531 Mon Sep 17 00:00:00 2001
From: sbluhm <stefan.bluhm@clacee.eu>
Date: Sun, 9 Jan 2022 14:30:19 +0100
Subject: [PATCH 14/19] Add documentation for query api flags
= changelog =
msg: Add documentation for query api flags
type: enhancement
resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2035577
---
AUTHORS | 1 +
doc/api_sack.rst | 14 +++++++++++++-
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/AUTHORS b/AUTHORS
index f8c9eb83..0077c7ea 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -91,6 +91,7 @@ DNF CONTRIBUTORS
Petr Spacek <pspacek@redhat.com>
Rob Cutmore <robcutmore@gmail.com>
Satoshi Matsumoto <kaorimatz@gmail.com>
+ Stefan Bluhm <stefan.bluhm@clacee.eu>
Tomas Kasparek <tkasparek@redhat.com>
Vladan Kudlac <vladankudlac@gmail.com>
Will Woods <wwoods@redhat.com>
diff --git a/doc/api_sack.rst b/doc/api_sack.rst
index 79719878..ac843fc9 100644
--- a/doc/api_sack.rst
+++ b/doc/api_sack.rst
@@ -25,10 +25,22 @@
The package sack. Contains metadata information about all known packages, installed and available.
- .. method:: query()
+ .. method:: query(flags=hawkey.APPLY_EXCLUDES)
Return a :class:`Query<dnf.query.Query>` for querying packages contained in this sack.
+ :ref:`Package filtering <excluded_packages-label>` is applied when creating the query object. The behavior can be adapted using flags. Possible flags:
+
+
+ ============================== ===========================================================================
+ Flag Value meaning
+ ============================== ===========================================================================
+ hawkey.APPLY_EXCLUDES Apply all package filtering.
+ hawkey.IGNORE_EXCLUDES Ignore all package filtering.
+ hawkey.IGNORE_REGULAR_EXCLUDES Ignore regular excludes defined by configuration files or the command line.
+ hawkey.IGNORE_MODULAR_EXCLUDES Ignore modular filtering.
+ ============================== ===========================================================================
+
.. function:: rpmdb_sack(base)
Returns a new instance of sack containing only installed packages (@System repo). Useful to get list of the installed RPMs after transaction.
--
2.31.1

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,37 @@
From 9bd0423e1e543ed5f83924ec61aa253eced24cf8 Mon Sep 17 00:00:00 2001
From: Marek Blaha <mblaha@redhat.com>
Date: Mon, 14 Mar 2022 09:49:52 +0100
Subject: [PATCH 15/19] Fix processing of download errors (RhBug: 2024527)
Users with different than english locale are not able to update their
systems in case that some of updates are already downloaded in the dnf
cache (e.g. using dnf-automatic).
The error string is taken from librepo target where it is stored
untranslated. Therefore we need to compare untranslated versions of the
string.
= changelog =
msg: Fix download errors handling in non-english locales
type: bugfix
resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2024527
---
dnf/repo.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dnf/repo.py b/dnf/repo.py
index 1822cf01..ec1a2537 100644
--- a/dnf/repo.py
+++ b/dnf/repo.py
@@ -108,7 +108,7 @@ def _download_payloads(payloads, drpm, fail_fast=True):
callbacks = tgt.getCallbacks()
payload = callbacks.package_pload
pkg = payload.pkg
- if err == _('Already downloaded'):
+ if err == 'Already downloaded':
errs._skipped.add(pkg)
continue
pkg.repo._repo.expire()
--
2.31.1

View File

@ -0,0 +1,81 @@
From 0da73ea1304005b796842d96679d6ea31cdeea3c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ale=C5=A1=20Mat=C4=9Bj?= <amatej@redhat.com>
Date: Tue, 1 Mar 2022 12:42:23 +0100
Subject: [PATCH 16/19] Fix unittests that relied on checksum being at the end
of solvfiles
---
tests/test_fill_sack_from_repos_in_cache.py | 26 +++++++++++----------
1 file changed, 14 insertions(+), 12 deletions(-)
diff --git a/tests/test_fill_sack_from_repos_in_cache.py b/tests/test_fill_sack_from_repos_in_cache.py
index a8de287c..30d02cfe 100644
--- a/tests/test_fill_sack_from_repos_in_cache.py
+++ b/tests/test_fill_sack_from_repos_in_cache.py
@@ -39,7 +39,7 @@ TEST_REPO_NAME = "test-repo"
class FillSackFromReposInCacheTest(unittest.TestCase):
- def _create_cache_for_repo(self, repopath, tmpdir):
+ def _create_cache_for_repo(self, repopath, tmpdir, repo_name=TEST_REPO_NAME):
conf = dnf.conf.MainConf()
conf.cachedir = os.path.join(tmpdir, "cache")
conf.installroot = tmpdir
@@ -49,7 +49,7 @@ class FillSackFromReposInCacheTest(unittest.TestCase):
base = dnf.Base(conf=conf)
- repoconf = dnf.repo.Repo(TEST_REPO_NAME, base.conf)
+ repoconf = dnf.repo.Repo(repo_name, base.conf)
repoconf.baseurl = repopath
repoconf.enable()
@@ -194,6 +194,8 @@ class FillSackFromReposInCacheTest(unittest.TestCase):
def test_exception_with_checksum_mismatch_and_only_repomd(self):
self._setUp_from_repo_path(os.path.join(os.path.abspath(os.path.dirname(__file__)), "repos/rpm"))
+ self._create_cache_for_repo(os.path.join(os.path.abspath(os.path.dirname(__file__)), "repos/drpm"),
+ self.tmpdir, "drpm-repo")
# Remove xml metadata except repomd
# repomd.xml is not compressed and doesn't end with .gz
@@ -201,12 +203,11 @@ class FillSackFromReposInCacheTest(unittest.TestCase):
for f in repodata_without_repomd:
os.remove(f)
- # Modify checksum of solv file so it doesn't match with repomd
- solv = glob.glob(os.path.join(self.tmpdir, "cache/*.solv"))[0]
- with open(solv, "a") as opensolv:
- opensolv.write("appended text to change checksum")
+ # Replace solvfile of test-repo with solvfile from drpm-repo which has different data (different checksum)
+ shutil.move(os.path.join(self.tmpdir, "cache/drpm-repo.solv"),
+ os.path.join(self.tmpdir, "cache/test-repo.solv"))
- # Now we only have cache with solvx, modified solv file and just repomd
+ # Now we only have cache with solvx, mismatching solv file and just repomd
# Since we don't have original xml metadata we cannot regenerate solv -> fail (exception)
self.assertRaises(dnf.exceptions.RepoError,
@@ -214,13 +215,14 @@ class FillSackFromReposInCacheTest(unittest.TestCase):
def test_checksum_mistmatch_regenerates_solv(self):
self._setUp_from_repo_path(os.path.join(os.path.abspath(os.path.dirname(__file__)), "repos/rpm"))
+ self._create_cache_for_repo(os.path.join(os.path.abspath(os.path.dirname(__file__)), "repos/drpm"),
+ self.tmpdir, "drpm-repo")
- # Modify checksum of solv file so it doesn't match with repomd
- solv = glob.glob(os.path.join(self.tmpdir, "cache/*.solv"))[0]
- with open(solv, "a") as opensolv:
- opensolv.write("appended text to change checksum")
+ # Replace solvfile of test-repo with solvfile from drpm-repo which has different data (different checksum)
+ shutil.move(os.path.join(self.tmpdir, "cache/drpm-repo.solv"),
+ os.path.join(self.tmpdir, "cache/test-repo.solv"))
- # Now we only have cache with solvx, modified solv file and xml metadata.
+ # Now we only have cache with solvx, mismatching solv file and xml metadata.
# Checksum mistmatch causes regeneration of solv file and repo works.
self.test_base.fill_sack_from_repos_in_cache(load_system_repo=False)
--
2.31.1

View File

@ -0,0 +1,65 @@
From fe87499e6745795b1dc6225fa102a1242eb9ffc8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Hr=C3=A1zk=C3=BD?= <lhrazky@redhat.com>
Date: Thu, 17 Feb 2022 18:46:22 +0100
Subject: [PATCH 17/19] cli/commands/history: Fix history undo on a Reason
Change
The previous reason needs to be fetched from the history db. It's
inefficient to parse the nevra after it was serialized in a previous
step, but that would need bigger code restructuring.
= changelog =
msg: Fix history undo on a Reason Change
type: bugfix
resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2053014
resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2010259
---
dnf.spec | 2 +-
dnf/cli/commands/history.py | 11 +++++++++++
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/dnf.spec b/dnf.spec
index 02c8b577..36c3932e 100644
--- a/dnf.spec
+++ b/dnf.spec
@@ -2,7 +2,7 @@
%define __cmake_in_source_build 1
# default dependencies
-%global hawkey_version 0.61.1
+%global hawkey_version 0.66.0
%global libcomps_version 0.1.8
%global libmodulemd_version 2.9.3
%global rpm_version 4.14.0
diff --git a/dnf/cli/commands/history.py b/dnf/cli/commands/history.py
index 293d93fc..21d04a1a 100644
--- a/dnf/cli/commands/history.py
+++ b/dnf/cli/commands/history.py
@@ -223,6 +223,7 @@ class HistoryCommand(commands.Command):
"Reinstall": "Reinstalled",
"Obsoleted": "Install",
"Obsolete": "Obsoleted",
+ "Reason Change": "Reason Change",
}
data = serialize_transaction(trans)
@@ -235,6 +236,16 @@ class HistoryCommand(commands.Command):
if ti["action"] == "Install" and ti.get("reason", None) == "clean":
ti["reason"] = "dependency"
+ if ti["action"] == "Reason Change" and "nevra" in ti:
+ subj = hawkey.Subject(ti["nevra"])
+ nevra = subj.get_nevra_possibilities(forms=[hawkey.FORM_NEVRA])[0]
+ reason = self.output.history.swdb.resolveRPMTransactionItemReason(
+ nevra.name,
+ nevra.arch,
+ trans.tids()[0] - 1
+ )
+ ti["reason"] = libdnf.transaction.TransactionItemReasonToString(reason)
+
if ti.get("repo_id") == hawkey.SYSTEM_REPO_NAME:
# erase repo_id, because it's not possible to perform forward actions from the @System repo
ti["repo_id"] = None
--
2.31.1

View File

@ -0,0 +1,30 @@
From 55f6691d5663c59b675064b04e19288365e92d24 Mon Sep 17 00:00:00 2001
From: Nicola Sella <nsella@redhat.com>
Date: Tue, 15 Mar 2022 16:26:10 +0100
Subject: [PATCH 18/19] Fix remove when no repos are enabled (RhBz:2064341)
msg: When no repositories are enabled, dnf group exits and does not
remove an installed group.
resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2064341
type: bugfix
---
dnf/cli/commands/group.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/dnf/cli/commands/group.py b/dnf/cli/commands/group.py
index fd723c48..c5c23230 100644
--- a/dnf/cli/commands/group.py
+++ b/dnf/cli/commands/group.py
@@ -358,7 +358,8 @@ class GroupCommand(commands.Command):
else:
demands.available_repos = True
- commands._checkEnabledRepo(self.base)
+ if cmd not in ('remove'):
+ commands._checkEnabledRepo(self.base)
if cmd in ('install', 'upgrade'):
commands._checkGPGKey(self.base, self.cli)
--
2.31.1

View File

@ -0,0 +1,30 @@
From 8f05ee29b7398fa6d18c7113a533f1d8726239df Mon Sep 17 00:00:00 2001
From: Jaroslav Rohel <jrohel@redhat.com>
Date: Tue, 12 Apr 2022 12:25:05 +0200
Subject: [PATCH 19/19] [doc] Improve "proxy" configuration option
documentation (RhBug:2072332)
---
doc/conf_ref.rst | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/doc/conf_ref.rst b/doc/conf_ref.rst
index 75bcdf75..885a4560 100644
--- a/doc/conf_ref.rst
+++ b/doc/conf_ref.rst
@@ -833,10 +833,10 @@ configuration.
``proxy``
:ref:`string <string-label>`
- URL of a proxy server to connect through. Set to an empty string to disable the proxy setting inherited from the main section and use direct connection instead. The expected format of this option is ``<scheme>://<ip-or-hostname>[:port]``.
+ URL of a proxy server to connect through. Set to an empty string in the repository configuration to disable proxy setting inherited from the main section. The expected format of this option is ``<scheme>://<ip-or-hostname>[:port]``.
(For backward compatibility, '_none_' can be used instead of the empty string.)
- Note: The curl environment variables (such as ``http_proxy``) are effective if this option is unset. See the ``curl`` man page for details.
+ Note: The curl environment variables (such as ``http_proxy``) are effective if this option is unset (or '_none_' is set in the repository configuration). See the ``curl`` man page for details.
``proxy_username``
:ref:`string <string-label>`
--
2.31.1

View File

@ -2,7 +2,7 @@
%define __cmake_in_source_build 1
# default dependencies
%global hawkey_version 0.61.1
%global hawkey_version 0.63.0-8
%global libcomps_version 0.1.8
%global libmodulemd_version 2.9.3
%global rpm_version 4.14.2-35
@ -66,7 +66,7 @@ It supports RPMs, modules and comps groups & environments.
Name: dnf
Version: 4.7.0
Release: 8%{?dist}
Release: 9%{?dist}
Summary: %{pkg_summary}
# For a breakdown of the licensing, see PACKAGE-LICENSING
License: GPLv2+
@ -85,7 +85,12 @@ Patch10: 0010-doc-Improve-description-of-multilib_policyall-RhBug19966811
Patch11: 0011-Fix-Python-dnf-API-does-not-respect-cacheonly-RhBug1862970.patch
Patch12: 0012-Documentation-API-notes-for-cacheonly.patch
Patch13: 0013-Allow-destdir-option-with-modulesync-command.patch
Patch14: 0014-Update-translations-RhBug-2017270.patch
Patch14: 0014-Add-documentation-for-query-api-flags.patch
Patch15: 0015-Fix-processing-of-download-errors-RhBug-2024527.patch
Patch16: 0016-Fix-unittests-that-relied-on-checksum-being-at-the-e.patch
Patch17: 0017-cli-commands-history-Fix-history-undo-on-a-Reason-Ch.patch
Patch18: 0018-Fix-remove-when-no-repos-are-enabled-RhBz-2064341.patch
Patch19: 0019-doc-Improve-proxy-configuration-option-documentation.patch
BuildArch: noarch
BuildRequires: cmake
@ -385,8 +390,12 @@ popd
%{python3_sitelib}/%{name}/automatic/
%changelog
* Fri Mar 18 2022 Marek Blaha <mblaha@redhat.com> - 4.7.0-8
- Update translations
* Wed May 04 2022 Lukas Hrazky <lhrazky@redhat.com> - 4.7.0-8
- Add documentation for query api flags
- Fix processing of download errors
- Fix history undo on a Reason Change
- Fix remove when no repos are enabled
- Improve "proxy" configuration option documentation
* Fri Jan 14 2022 Pavla Kratochvilova <pkratoch@redhat.com> - 4.7.0-7
- Rebuild with new release number