From fad26cbc9655ef793c4137794d175a01a4807274 Mon Sep 17 00:00:00 2001 From: chantra Date: May 16 2022 19:09:10 +0000 Subject: Merge branch 'c8s' into c8s-sig-hyperscale-experimental --- diff --git a/SOURCES/0013-Allow-destdir-option-with-modulesync-command.patch b/SOURCES/0013-Allow-destdir-option-with-modulesync-command.patch new file mode 100644 index 0000000..d859553 --- /dev/null +++ b/SOURCES/0013-Allow-destdir-option-with-modulesync-command.patch @@ -0,0 +1,39 @@ +From 6af9938c87cf409f886f21b59ec45c54eda6c8b2 Mon Sep 17 00:00:00 2001 +From: Jaroslav Mracek +Date: Tue, 2 Nov 2021 14:23:22 +0100 +Subject: [PATCH] Allow destdir option with modulesync command + +--- + dnf/cli/cli.py | 2 +- + doc/command_ref.rst | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/dnf/cli/cli.py b/dnf/cli/cli.py +index 6576997..a315201 100644 +--- a/dnf/cli/cli.py ++++ b/dnf/cli/cli.py +@@ -810,7 +810,7 @@ class Cli(object): + if opts.destdir is not None: + self.base.conf.destdir = opts.destdir + if not self.base.conf.downloadonly and opts.command not in ( +- 'download', 'system-upgrade', 'reposync'): ++ 'download', 'system-upgrade', 'reposync', 'modulesync'): + logger.critical(_('--destdir or --downloaddir must be used with --downloadonly ' + 'or download or system-upgrade command.') + ) +diff --git a/doc/command_ref.rst b/doc/command_ref.rst +index f96c0ea..42aec72 100644 +--- a/doc/command_ref.rst ++++ b/doc/command_ref.rst +@@ -182,7 +182,7 @@ Options + ``--downloaddir=, --destdir=`` + Redirect downloaded packages to provided directory. The option has to be used together with the \-\ + :ref:`-downloadonly ` command line option, with the +- ``download`` command (dnf-plugins-core) or with the ``system-upgrade`` command ++ ``download``, ``modulesync`` or ``reposync`` commands (dnf-plugins-core) or with the ``system-upgrade`` command + (dnf-plugins-extras). + + .. _downloadonly-label: +-- +libgit2 1.1.0 + diff --git a/SOURCES/0014-Add-documentation-for-query-api-flags.patch b/SOURCES/0014-Add-documentation-for-query-api-flags.patch new file mode 100644 index 0000000..e08d5b2 --- /dev/null +++ b/SOURCES/0014-Add-documentation-for-query-api-flags.patch @@ -0,0 +1,57 @@ +From 27f26c607c44b8331b23c861241a8509c2452531 Mon Sep 17 00:00:00 2001 +From: sbluhm +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 + Rob Cutmore + Satoshi Matsumoto ++ Stefan Bluhm + Tomas Kasparek + Vladan Kudlac + Will Woods +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` for querying packages contained in this sack. + ++ :ref:`Package filtering ` 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 + diff --git a/SOURCES/0015-Fix-processing-of-download-errors-RhBug-2024527.patch b/SOURCES/0015-Fix-processing-of-download-errors-RhBug-2024527.patch new file mode 100644 index 0000000..4994175 --- /dev/null +++ b/SOURCES/0015-Fix-processing-of-download-errors-RhBug-2024527.patch @@ -0,0 +1,37 @@ +From 9bd0423e1e543ed5f83924ec61aa253eced24cf8 Mon Sep 17 00:00:00 2001 +From: Marek Blaha +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 + diff --git a/SOURCES/0016-Fix-unittests-that-relied-on-checksum-being-at-the-e.patch b/SOURCES/0016-Fix-unittests-that-relied-on-checksum-being-at-the-e.patch new file mode 100644 index 0000000..b65e37c --- /dev/null +++ b/SOURCES/0016-Fix-unittests-that-relied-on-checksum-being-at-the-e.patch @@ -0,0 +1,81 @@ +From 0da73ea1304005b796842d96679d6ea31cdeea3c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ale=C5=A1=20Mat=C4=9Bj?= +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 + diff --git a/SOURCES/0017-cli-commands-history-Fix-history-undo-on-a-Reason-Ch.patch b/SOURCES/0017-cli-commands-history-Fix-history-undo-on-a-Reason-Ch.patch new file mode 100644 index 0000000..9f2ec34 --- /dev/null +++ b/SOURCES/0017-cli-commands-history-Fix-history-undo-on-a-Reason-Ch.patch @@ -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?= +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 + diff --git a/SOURCES/0018-Fix-remove-when-no-repos-are-enabled-RhBz-2064341.patch b/SOURCES/0018-Fix-remove-when-no-repos-are-enabled-RhBz-2064341.patch new file mode 100644 index 0000000..ff4ec12 --- /dev/null +++ b/SOURCES/0018-Fix-remove-when-no-repos-are-enabled-RhBz-2064341.patch @@ -0,0 +1,30 @@ +From 55f6691d5663c59b675064b04e19288365e92d24 Mon Sep 17 00:00:00 2001 +From: Nicola Sella +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 + diff --git a/SOURCES/0019-doc-Improve-proxy-configuration-option-documentation.patch b/SOURCES/0019-doc-Improve-proxy-configuration-option-documentation.patch new file mode 100644 index 0000000..948c0b5 --- /dev/null +++ b/SOURCES/0019-doc-Improve-proxy-configuration-option-documentation.patch @@ -0,0 +1,30 @@ +From 8f05ee29b7398fa6d18c7113a533f1d8726239df Mon Sep 17 00:00:00 2001 +From: Jaroslav Rohel +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 ` + +- 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 ``://[: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 ``://[: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 ` +-- +2.31.1 + diff --git a/SPECS/dnf.spec b/SPECS/dnf.spec index 40a5579..055068b 100644 --- a/SPECS/dnf.spec +++ b/SPECS/dnf.spec @@ -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: 5.1%{?dist} +Release: 9.1%{?dist} Summary: %{pkg_summary} # For a breakdown of the licensing, see PACKAGE-LICENSING License: GPLv2+ @@ -84,6 +84,13 @@ Patch9: 0009-comps-Make-the-install_or_skip-method-not-catch-CompsError- Patch10: 0010-doc-Improve-description-of-multilib_policyall-RhBug19966811995630.patch 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-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 Patch9998: https://github.com/rpm-software-management/dnf/pull/1761.patch Provides: dnf(pr1761) @@ -388,9 +395,25 @@ popd %{python3_sitelib}/%{name}/automatic/ %changelog +* Mon May 16 2022 Manu Bretelle - 4.7.0-9.1 +- Rebuild for Hyperscale + +* Wed May 04 2022 Lukas Hrazky - 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 + * Tue Feb 01 2022 Manu Bretelle - 4.7.0-5.1 - Rebuild for Hyperscale +* Fri Jan 14 2022 Pavla Kratochvilova - 4.7.0-7 +- Rebuild with new release number + +* Tue Jan 11 2022 Pavla Kratochvilova - 4.7.0-6 +- Allow destdir option with modulesync command + * Tue Nov 09 2021 Pavla Kratochvilova - 4.7.0-5 - Bump release number because of conflicting version of 8.5 build