Compare commits
No commits in common. "imports/c8s/dnf-4.7.0-11.el8" and "c8" have entirely different histories.
imports/c8
...
c8
|
@ -1 +0,0 @@
|
|||
f9c31cf46094c4bbf021e1872a9eb72d8a3f2136 SOURCES/dnf-4.7.0.tar.gz
|
|
@ -0,0 +1,47 @@
|
|||
From 66a37245e82c60b972ee35879f9c29c27466a27b Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Ale=C5=A1=20Mat=C4=9Bj?= <amatej@redhat.com>
|
||||
Date: Mon, 25 Jul 2022 12:44:17 +0200
|
||||
Subject: [PATCH] Don't include resolved advisories for obsoletes with sec.
|
||||
filters (RhBug:2101421)
|
||||
|
||||
This makes the obsoletes security filters consistent with upgrade
|
||||
security filters.
|
||||
|
||||
This API is used from check-update and from Info and List commands.
|
||||
- For check-update we don't want to include resolved advisories to have
|
||||
identical result to the actual update. That is bz2101421 use case.
|
||||
- For Info and List commands the --obsoletes switch: "List packages
|
||||
installed on the system that are obsoleted by packages in any known
|
||||
repository." Given this specification in makes sense not to
|
||||
consider resolved advisories when we also use security filters.
|
||||
|
||||
There is still a general case when someone uses the API or any potential
|
||||
future use and I think it is best to have the behavior unified for
|
||||
"upgrades" and "obsoletes".
|
||||
|
||||
= changelog =
|
||||
msg: Don't include resolved advisories for obsoletes filtering with security filters
|
||||
type: bugfix
|
||||
resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2101421
|
||||
|
||||
Tests: https://github.com/rpm-software-management/ci-dnf-stack/pull/1134
|
||||
---
|
||||
dnf/base.py | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dnf/base.py b/dnf/base.py
|
||||
index e606d9fa..e623d98e 100644
|
||||
--- a/dnf/base.py
|
||||
+++ b/dnf/base.py
|
||||
@@ -1565,7 +1565,7 @@ class Base(object):
|
||||
obsoletes = query_for_repo(
|
||||
self.sack.query()).filter(obsoletes_by_priority=inst)
|
||||
# reduce a query to security upgrades if they are specified
|
||||
- obsoletes = self._merge_update_filters(obsoletes, warning=False)
|
||||
+ obsoletes = self._merge_update_filters(obsoletes, warning=False, upgrade=True)
|
||||
obsoletesTuples = []
|
||||
for new in obsoletes:
|
||||
obsoleted_reldeps = new.obsoletes
|
||||
--
|
||||
2.37.1
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
From 553a2c585db50599d5028ea6bb6462281bb88d02 Mon Sep 17 00:00:00 2001
|
||||
From: Jaroslav Mracek <jmracek@redhat.com>
|
||||
Date: Mon, 11 Jul 2022 12:27:14 +0200
|
||||
Subject: [PATCH] Set default value for variable to prevent crash
|
||||
(RhBug:2091636)
|
||||
|
||||
It ensure that read of file ended successfully.
|
||||
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=2091636
|
||||
---
|
||||
dnf/conf/substitutions.py | 4 +++-
|
||||
1 file changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dnf/conf/substitutions.py b/dnf/conf/substitutions.py
|
||||
index 703e4a4f..1281bdf0 100644
|
||||
--- a/dnf/conf/substitutions.py
|
||||
+++ b/dnf/conf/substitutions.py
|
||||
@@ -53,6 +53,7 @@ class Substitutions(dict):
|
||||
continue
|
||||
for fsvar in fsvars:
|
||||
filepath = os.path.join(dir_fsvars, fsvar)
|
||||
+ val = None
|
||||
if os.path.isfile(filepath):
|
||||
try:
|
||||
with open(filepath) as fp:
|
||||
@@ -61,4 +62,5 @@ class Substitutions(dict):
|
||||
val = val[:-1]
|
||||
except (OSError, IOError):
|
||||
continue
|
||||
- self[fsvar] = val
|
||||
+ if val is not None:
|
||||
+ self[fsvar] = val
|
||||
--
|
||||
2.37.1
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
From 96a5bd61ab3b35f00f0b52bcd6428c7aea7d1ca5 Mon Sep 17 00:00:00 2001
|
||||
From: Jan Kolarik <jkolarik@redhat.com>
|
||||
Date: Wed, 7 Sep 2022 14:27:07 +0200
|
||||
Subject: [PATCH] Add doc related to --destdir and --downloadonly options
|
||||
(RhBug:2100811)
|
||||
|
||||
= changelog =
|
||||
type: bugfix
|
||||
resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2100811
|
||||
---
|
||||
doc/command_ref.rst | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/doc/command_ref.rst b/doc/command_ref.rst
|
||||
index 42aec72c..7a02448c 100644
|
||||
--- a/doc/command_ref.rst
|
||||
+++ b/doc/command_ref.rst
|
||||
@@ -190,6 +190,10 @@ Options
|
||||
``--downloadonly``
|
||||
Download the resolved package set without performing any rpm transaction (install/upgrade/erase).
|
||||
|
||||
+ Packages are removed after the next successful transaction. This applies also when used together
|
||||
+ with ``--destdir`` option as the directory is considered as a part of the DNF cache. To persist
|
||||
+ the packages, use the ``download`` command instead.
|
||||
+
|
||||
``-e <error level>, --errorlevel=<error level>``
|
||||
Error output level. This is an integer value between 0 (no error output) and
|
||||
10 (shows all error messages), default is 3. Deprecated, use ``-v`` instead.
|
||||
--
|
||||
2.37.1
|
||||
|
|
@ -0,0 +1,79 @@
|
|||
From aa724a639a641943ecf39038fd694abc2037e66d Mon Sep 17 00:00:00 2001
|
||||
From: Jan Kolarik <jkolarik@redhat.com>
|
||||
Date: Mon, 22 Aug 2022 10:38:30 +0200
|
||||
Subject: [PATCH] Expose plugin unload method to API (RhBug:2047251)
|
||||
|
||||
= changelog =
|
||||
type: bugfix
|
||||
resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2047251
|
||||
---
|
||||
dnf/base.py | 5 +++++
|
||||
dnf/plugin.py | 1 +
|
||||
doc/api_base.rst | 4 ++++
|
||||
tests/api/test_dnf_base.py | 7 +++++++
|
||||
4 files changed, 17 insertions(+)
|
||||
|
||||
diff --git a/dnf/base.py b/dnf/base.py
|
||||
index e623d98e..4ddfae15 100644
|
||||
--- a/dnf/base.py
|
||||
+++ b/dnf/base.py
|
||||
@@ -316,6 +316,11 @@ class Base(object):
|
||||
"""Run plugins configure() method."""
|
||||
self._plugins._run_config()
|
||||
|
||||
+ def unload_plugins(self):
|
||||
+ # :api
|
||||
+ """Run plugins unload() method."""
|
||||
+ self._plugins._unload()
|
||||
+
|
||||
def update_cache(self, timer=False):
|
||||
# :api
|
||||
|
||||
diff --git a/dnf/plugin.py b/dnf/plugin.py
|
||||
index 06066e79..87c1f08f 100644
|
||||
--- a/dnf/plugin.py
|
||||
+++ b/dnf/plugin.py
|
||||
@@ -164,6 +164,7 @@ class Plugins(object):
|
||||
self._caller('transaction')
|
||||
|
||||
def _unload(self):
|
||||
+ logger.debug(_('Plugins were unloaded'))
|
||||
del sys.modules[DYNAMIC_PACKAGE]
|
||||
|
||||
def unload_removed_plugins(self, transaction):
|
||||
diff --git a/doc/api_base.rst b/doc/api_base.rst
|
||||
index 03396b69..35cbeef5 100644
|
||||
--- a/doc/api_base.rst
|
||||
+++ b/doc/api_base.rst
|
||||
@@ -97,6 +97,10 @@
|
||||
|
||||
Configure plugins by running their configure() method.
|
||||
|
||||
+ .. method:: unload_plugins()
|
||||
+
|
||||
+ Unload all plugins.
|
||||
+
|
||||
.. method:: fill_sack([load_system_repo=True, load_available_repos=True])
|
||||
|
||||
Setup the package sack. If `load_system_repo` is ``True``, load information about packages in the local RPMDB into the sack. Else no package is considered installed during dependency solving. If `load_available_repos` is ``True``, load information about packages from the available repositories into the sack.
|
||||
diff --git a/tests/api/test_dnf_base.py b/tests/api/test_dnf_base.py
|
||||
index 33598189..e84e272b 100644
|
||||
--- a/tests/api/test_dnf_base.py
|
||||
+++ b/tests/api/test_dnf_base.py
|
||||
@@ -95,6 +95,13 @@ class DnfBaseApiTest(TestCase):
|
||||
|
||||
self.base.configure_plugins()
|
||||
|
||||
+ def test_unload_plugins(self):
|
||||
+ # Base.unload_plugins()
|
||||
+ self.assertHasAttr(self.base, "unload_plugins")
|
||||
+
|
||||
+ self.base.init_plugins()
|
||||
+ self.base.unload_plugins()
|
||||
+
|
||||
def test_update_cache(self):
|
||||
# Base.update_cache(self, timer=False)
|
||||
self.assertHasAttr(self.base, "update_cache")
|
||||
--
|
||||
2.37.1
|
||||
|
|
@ -0,0 +1,105 @@
|
|||
From 7ba2cd6a86945e0ec6f9ed866e2ef6b6759ee092 Mon Sep 17 00:00:00 2001
|
||||
From: Jan Kolarik <jkolarik@redhat.com>
|
||||
Date: Thu, 25 Aug 2022 08:06:34 +0200
|
||||
Subject: [PATCH] Add support for group upgrade rollback (RhBug:2016070)
|
||||
|
||||
= changelog =
|
||||
type: bugfix
|
||||
resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2016070
|
||||
---
|
||||
dnf/db/group.py | 8 +++++++-
|
||||
dnf/transaction_sr.py | 24 ++++++++++++++++++++++++
|
||||
2 files changed, 31 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dnf/db/group.py b/dnf/db/group.py
|
||||
index 4dc8cb06..312e3b98 100644
|
||||
--- a/dnf/db/group.py
|
||||
+++ b/dnf/db/group.py
|
||||
@@ -34,14 +34,16 @@ class PersistorBase(object):
|
||||
self._installed = {}
|
||||
self._removed = {}
|
||||
self._upgraded = {}
|
||||
+ self._downgraded = {}
|
||||
|
||||
def __len__(self):
|
||||
- return len(self._installed) + len(self._removed) + len(self._upgraded)
|
||||
+ return len(self._installed) + len(self._removed) + len(self._upgraded) + len(self._downgraded)
|
||||
|
||||
def clean(self):
|
||||
self._installed = {}
|
||||
self._removed = {}
|
||||
self._upgraded = {}
|
||||
+ self._downgraded = {}
|
||||
|
||||
def _get_obj_id(self, obj):
|
||||
raise NotImplementedError
|
||||
@@ -62,6 +64,10 @@ class PersistorBase(object):
|
||||
self._upgraded[self._get_obj_id(obj)] = obj
|
||||
self._add_to_history(obj, libdnf.transaction.TransactionItemAction_UPGRADE)
|
||||
|
||||
+ def downgrade(self, obj):
|
||||
+ self._downgraded[self._get_obj_id(obj)] = obj
|
||||
+ self._add_to_history(obj, libdnf.transaction.TransactionItemAction_DOWNGRADE)
|
||||
+
|
||||
def new(self, obj_id, name, translated_name, pkg_types):
|
||||
raise NotImplementedError
|
||||
|
||||
diff --git a/dnf/transaction_sr.py b/dnf/transaction_sr.py
|
||||
index dae8d300..5d403a3e 100644
|
||||
--- a/dnf/transaction_sr.py
|
||||
+++ b/dnf/transaction_sr.py
|
||||
@@ -416,6 +416,16 @@ class TransactionReplay(object):
|
||||
if swdb_group is not None:
|
||||
self._base.history.group.upgrade(swdb_group)
|
||||
|
||||
+ def _swdb_group_downgrade(self, group_id, pkg_types, pkgs):
|
||||
+ if not self._base.history.group.get(group_id):
|
||||
+ self._raise_or_warn(self._ignore_installed, _("Group id '%s' is not installed.") % group_id)
|
||||
+ return
|
||||
+
|
||||
+ swdb_group = self._create_swdb_group(group_id, pkg_types, pkgs)
|
||||
+
|
||||
+ if swdb_group is not None:
|
||||
+ self._base.history.group.downgrade(swdb_group)
|
||||
+
|
||||
def _swdb_group_remove(self, group_id, pkg_types, pkgs):
|
||||
if not self._base.history.group.get(group_id):
|
||||
self._raise_or_warn(self._ignore_installed, _("Group id '%s' is not installed.") % group_id)
|
||||
@@ -482,6 +492,16 @@ class TransactionReplay(object):
|
||||
if swdb_env is not None:
|
||||
self._base.history.env.upgrade(swdb_env)
|
||||
|
||||
+ def _swdb_environment_downgrade(self, env_id, pkg_types, groups):
|
||||
+ if not self._base.history.env.get(env_id):
|
||||
+ self._raise_or_warn(self._ignore_installed, _("Environment id '%s' is not installed.") % env_id)
|
||||
+ return
|
||||
+
|
||||
+ swdb_env = self._create_swdb_environment(env_id, pkg_types, groups)
|
||||
+
|
||||
+ if swdb_env is not None:
|
||||
+ self._base.history.env.downgrade(swdb_env)
|
||||
+
|
||||
def _swdb_environment_remove(self, env_id, pkg_types, groups):
|
||||
if not self._base.history.env.get(env_id):
|
||||
self._raise_or_warn(self._ignore_installed, _("Environment id '%s' is not installed.") % env_id)
|
||||
@@ -535,6 +555,8 @@ class TransactionReplay(object):
|
||||
self._swdb_group_install(group_id, pkg_types, group_data["packages"])
|
||||
elif action == "Upgrade":
|
||||
self._swdb_group_upgrade(group_id, pkg_types, group_data["packages"])
|
||||
+ elif action == "Downgraded":
|
||||
+ self._swdb_group_downgrade(group_id, pkg_types, group_data["packages"])
|
||||
elif action == "Removed":
|
||||
self._swdb_group_remove(group_id, pkg_types, group_data["packages"])
|
||||
else:
|
||||
@@ -564,6 +586,8 @@ class TransactionReplay(object):
|
||||
self._swdb_environment_install(env_id, pkg_types, env_data["groups"])
|
||||
elif action == "Upgrade":
|
||||
self._swdb_environment_upgrade(env_id, pkg_types, env_data["groups"])
|
||||
+ elif action == "Downgraded":
|
||||
+ self._swdb_environment_downgrade(env_id, pkg_types, env_data["groups"])
|
||||
elif action == "Removed":
|
||||
self._swdb_environment_remove(env_id, pkg_types, env_data["groups"])
|
||||
else:
|
||||
--
|
||||
2.37.1
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
From 46562dc76e50d86eed99a102af74a1187a4303e4 Mon Sep 17 00:00:00 2001
|
||||
From: Nicola Sella <nsella@redhat.com>
|
||||
Date: Thu, 11 Aug 2022 13:56:11 +0200
|
||||
Subject: [PATCH] Fix upgrade from file to noarch pkg (RhBug:2006018)
|
||||
|
||||
= changelog =
|
||||
msg: Fix upgrade pkg from file when installed pkg is noarch and upgrades
|
||||
to a different arch
|
||||
type: bugfix
|
||||
resolves: https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=2006018
|
||||
---
|
||||
dnf/base.py | 6 +++++-
|
||||
1 file changed, 5 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dnf/base.py b/dnf/base.py
|
||||
index 4ddfae15..aba411ea 100644
|
||||
--- a/dnf/base.py
|
||||
+++ b/dnf/base.py
|
||||
@@ -2109,7 +2109,11 @@ class Base(object):
|
||||
sltr.set(pkg=[pkg])
|
||||
self._goal.upgrade(select=sltr)
|
||||
return 1
|
||||
- q = installed.filter(name=pkg.name, arch=[pkg.arch, "noarch"])
|
||||
+ # do not filter by arch if the package is noarch
|
||||
+ if pkg.arch == "noarch":
|
||||
+ q = installed.filter(name=pkg.name)
|
||||
+ else:
|
||||
+ q = installed.filter(name=pkg.name, arch=[pkg.arch, "noarch"])
|
||||
if not q:
|
||||
msg = _("Package %s not installed, cannot update it.")
|
||||
logger.warning(msg, pkg.name)
|
||||
--
|
||||
2.37.1
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
From 7a265cf17fe3531e45dde8ae622c496bef1e17ae Mon Sep 17 00:00:00 2001
|
||||
From: Jan Kolarik <jkolarik@redhat.com>
|
||||
Date: Wed, 10 Aug 2022 16:24:08 +0200
|
||||
Subject: [PATCH] Allow passing plugin parameters with dashes in names
|
||||
(RhBug:1980712)
|
||||
|
||||
= changelog =
|
||||
type: bugfix
|
||||
resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1980712
|
||||
---
|
||||
dnf/plugin.py | 20 +++++++++++++++++---
|
||||
1 file changed, 17 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/dnf/plugin.py b/dnf/plugin.py
|
||||
index 87c1f08f..b083727d 100644
|
||||
--- a/dnf/plugin.py
|
||||
+++ b/dnf/plugin.py
|
||||
@@ -225,17 +225,17 @@ def _get_plugins_files(paths, disable_plugins, enable_plugins):
|
||||
matched = True
|
||||
enable_pattern_tested = False
|
||||
for pattern_skip in disable_plugins:
|
||||
- if fnmatch.fnmatch(plugin_name, pattern_skip):
|
||||
+ if _plugin_name_matches_pattern(plugin_name, pattern_skip):
|
||||
pattern_disable_found.add(pattern_skip)
|
||||
matched = False
|
||||
for pattern_enable in enable_plugins:
|
||||
- if fnmatch.fnmatch(plugin_name, pattern_enable):
|
||||
+ if _plugin_name_matches_pattern(plugin_name, pattern_enable):
|
||||
matched = True
|
||||
pattern_enable_found.add(pattern_enable)
|
||||
enable_pattern_tested = True
|
||||
if not enable_pattern_tested:
|
||||
for pattern_enable in enable_plugins:
|
||||
- if fnmatch.fnmatch(plugin_name, pattern_enable):
|
||||
+ if _plugin_name_matches_pattern(plugin_name, pattern_enable):
|
||||
pattern_enable_found.add(pattern_enable)
|
||||
if matched:
|
||||
plugins.append(fn)
|
||||
@@ -250,6 +250,20 @@ def _get_plugins_files(paths, disable_plugins, enable_plugins):
|
||||
return plugins
|
||||
|
||||
|
||||
+def _plugin_name_matches_pattern(plugin_name, pattern):
|
||||
+ """
|
||||
+ Checks plugin name matches the pattern.
|
||||
+
|
||||
+ The alternative plugin name using dashes instead of underscores is tried
|
||||
+ in case of original name is not matched.
|
||||
+
|
||||
+ (see https://bugzilla.redhat.com/show_bug.cgi?id=1980712)
|
||||
+ """
|
||||
+
|
||||
+ try_names = set((plugin_name, plugin_name.replace('_', '-')))
|
||||
+ return any(fnmatch.fnmatch(name, pattern) for name in try_names)
|
||||
+
|
||||
+
|
||||
def register_command(command_class):
|
||||
# :api
|
||||
"""A class decorator for automatic command registration."""
|
||||
--
|
||||
2.37.1
|
||||
|
|
@ -0,0 +1,97 @@
|
|||
From 9700b8fabd102fcf289281c3c04238da90d7b28e Mon Sep 17 00:00:00 2001
|
||||
From: Jan Kolarik <jkolarik@redhat.com>
|
||||
Date: Tue, 13 Sep 2022 14:35:10 +0200
|
||||
Subject: [PATCH] Fix plugins unit tests + unload plugins upon their deletion
|
||||
|
||||
=changelog=
|
||||
type: bugfix
|
||||
resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2134309
|
||||
---
|
||||
dnf/plugin.py | 8 ++++++--
|
||||
tests/api/test_dnf_base.py | 24 +++++++++++++++++++-----
|
||||
2 files changed, 25 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/dnf/plugin.py b/dnf/plugin.py
|
||||
index b083727d..d2f46ce3 100644
|
||||
--- a/dnf/plugin.py
|
||||
+++ b/dnf/plugin.py
|
||||
@@ -98,6 +98,9 @@ class Plugins(object):
|
||||
self.plugin_cls = []
|
||||
self.plugins = []
|
||||
|
||||
+ def __del__(self):
|
||||
+ self._unload()
|
||||
+
|
||||
def _caller(self, method):
|
||||
for plugin in self.plugins:
|
||||
try:
|
||||
@@ -164,8 +167,9 @@ class Plugins(object):
|
||||
self._caller('transaction')
|
||||
|
||||
def _unload(self):
|
||||
- logger.debug(_('Plugins were unloaded'))
|
||||
- del sys.modules[DYNAMIC_PACKAGE]
|
||||
+ if DYNAMIC_PACKAGE in sys.modules:
|
||||
+ logger.log(dnf.logging.DDEBUG, 'Plugins were unloaded.')
|
||||
+ del sys.modules[DYNAMIC_PACKAGE]
|
||||
|
||||
def unload_removed_plugins(self, transaction):
|
||||
"""
|
||||
diff --git a/tests/api/test_dnf_base.py b/tests/api/test_dnf_base.py
|
||||
index e84e272b..19754b07 100644
|
||||
--- a/tests/api/test_dnf_base.py
|
||||
+++ b/tests/api/test_dnf_base.py
|
||||
@@ -7,10 +7,23 @@ from __future__ import unicode_literals
|
||||
import dnf
|
||||
import dnf.conf
|
||||
|
||||
+import tests.support
|
||||
+
|
||||
from .common import TestCase
|
||||
from .common import TOUR_4_4
|
||||
|
||||
|
||||
+def conf_with_empty_plugins():
|
||||
+ """
|
||||
+ Use empty configuration to avoid importing plugins from default paths
|
||||
+ which would lead to crash of other tests.
|
||||
+ """
|
||||
+ conf = tests.support.FakeConf()
|
||||
+ conf.plugins = True
|
||||
+ conf.pluginpath = []
|
||||
+ return conf
|
||||
+
|
||||
+
|
||||
class DnfBaseApiTest(TestCase):
|
||||
def setUp(self):
|
||||
self.base = dnf.Base(dnf.conf.Conf())
|
||||
@@ -75,13 +88,12 @@ class DnfBaseApiTest(TestCase):
|
||||
self.assertHasType(self.base.transaction, dnf.db.group.RPMTransaction)
|
||||
|
||||
def test_init_plugins(self):
|
||||
- # Base.init_plugins(disabled_glob=(), enable_plugins=(), cli=None)
|
||||
+ # Base.init_plugins()
|
||||
self.assertHasAttr(self.base, "init_plugins")
|
||||
|
||||
- # disable plugins to avoid calling dnf.plugin.Plugins._load() multiple times
|
||||
- # which causes the tests to crash
|
||||
- self.base.conf.plugins = False
|
||||
- self.base.init_plugins(disabled_glob=(), enable_plugins=(), cli=None)
|
||||
+ self.base._conf = conf_with_empty_plugins()
|
||||
+
|
||||
+ self.base.init_plugins()
|
||||
|
||||
def test_pre_configure_plugins(self):
|
||||
# Base.pre_configure_plugins()
|
||||
@@ -99,6 +111,8 @@ class DnfBaseApiTest(TestCase):
|
||||
# Base.unload_plugins()
|
||||
self.assertHasAttr(self.base, "unload_plugins")
|
||||
|
||||
+ self.base._conf = conf_with_empty_plugins()
|
||||
+
|
||||
self.base.init_plugins()
|
||||
self.base.unload_plugins()
|
||||
|
||||
--
|
||||
2.37.3
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
From c9251d182be0bfa66345220cffe0842b44a061a8 Mon Sep 17 00:00:00 2001
|
||||
From: Jan Kolarik <jkolarik@redhat.com>
|
||||
Date: Wed, 31 Aug 2022 07:49:39 +0200
|
||||
Subject: [PATCH] Move system-upgrade plugin to core (RhBug:2054235)
|
||||
|
||||
Just doc fix.
|
||||
|
||||
= changelog =
|
||||
type: bugfix
|
||||
resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2054235
|
||||
---
|
||||
doc/command_ref.rst | 3 +--
|
||||
1 file changed, 1 insertion(+), 2 deletions(-)
|
||||
|
||||
diff --git a/doc/command_ref.rst b/doc/command_ref.rst
|
||||
index 7a02448c..bee6a109 100644
|
||||
--- a/doc/command_ref.rst
|
||||
+++ b/doc/command_ref.rst
|
||||
@@ -182,8 +182,7 @@ Options
|
||||
``--downloaddir=<path>, --destdir=<path>``
|
||||
Redirect downloaded packages to provided directory. The option has to be used together with the \-\
|
||||
:ref:`-downloadonly <downloadonly-label>` command line option, with the
|
||||
- ``download``, ``modulesync`` or ``reposync`` commands (dnf-plugins-core) or with the ``system-upgrade`` command
|
||||
- (dnf-plugins-extras).
|
||||
+ ``download``, ``modulesync``, ``reposync`` or ``system-upgrade`` commands (dnf-plugins-core).
|
||||
|
||||
.. _downloadonly-label:
|
||||
|
||||
--
|
||||
2.37.3
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
From a32b2f7d596247124ad6ff5ab71bc83bf78f0518 Mon Sep 17 00:00:00 2001
|
||||
From: Jan Kolarik <jkolarik@redhat.com>
|
||||
Date: Tue, 13 Sep 2022 13:55:35 +0200
|
||||
Subject: [PATCH] Add support for rollback of group upgrade rollback
|
||||
(RhBug:2016070)
|
||||
|
||||
= changelog =
|
||||
type: bugfix
|
||||
resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2016070
|
||||
---
|
||||
dnf/transaction_sr.py | 20 ++++++++++++--------
|
||||
1 file changed, 12 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/dnf/transaction_sr.py b/dnf/transaction_sr.py
|
||||
index 5d403a3e..b389f152 100644
|
||||
--- a/dnf/transaction_sr.py
|
||||
+++ b/dnf/transaction_sr.py
|
||||
@@ -553,12 +553,14 @@ class TransactionReplay(object):
|
||||
|
||||
if action == "Install":
|
||||
self._swdb_group_install(group_id, pkg_types, group_data["packages"])
|
||||
- elif action == "Upgrade":
|
||||
- self._swdb_group_upgrade(group_id, pkg_types, group_data["packages"])
|
||||
- elif action == "Downgraded":
|
||||
- self._swdb_group_downgrade(group_id, pkg_types, group_data["packages"])
|
||||
elif action == "Removed":
|
||||
self._swdb_group_remove(group_id, pkg_types, group_data["packages"])
|
||||
+ # Groups are not versioned, but a reverse transaction could be applied,
|
||||
+ # therefore we treat both actions the same way
|
||||
+ elif action == "Upgrade" or action == "Upgraded":
|
||||
+ self._swdb_group_upgrade(group_id, pkg_types, group_data["packages"])
|
||||
+ elif action == "Downgrade" or action == "Downgraded":
|
||||
+ self._swdb_group_downgrade(group_id, pkg_types, group_data["packages"])
|
||||
else:
|
||||
errors.append(TransactionError(
|
||||
_('Unexpected value of group action "{action}" for group "{group}".')
|
||||
@@ -584,12 +586,14 @@ class TransactionReplay(object):
|
||||
|
||||
if action == "Install":
|
||||
self._swdb_environment_install(env_id, pkg_types, env_data["groups"])
|
||||
- elif action == "Upgrade":
|
||||
- self._swdb_environment_upgrade(env_id, pkg_types, env_data["groups"])
|
||||
- elif action == "Downgraded":
|
||||
- self._swdb_environment_downgrade(env_id, pkg_types, env_data["groups"])
|
||||
elif action == "Removed":
|
||||
self._swdb_environment_remove(env_id, pkg_types, env_data["groups"])
|
||||
+ # Environments are not versioned, but a reverse transaction could be applied,
|
||||
+ # therefore we treat both actions the same way
|
||||
+ elif action == "Upgrade" or action == "Upgraded":
|
||||
+ self._swdb_environment_upgrade(env_id, pkg_types, env_data["groups"])
|
||||
+ elif action == "Downgrade" or action == "Downgraded":
|
||||
+ self._swdb_environment_downgrade(env_id, pkg_types, env_data["groups"])
|
||||
else:
|
||||
errors.append(TransactionError(
|
||||
_('Unexpected value of environment action "{action}" for environment "{env}".')
|
||||
--
|
||||
2.37.3
|
||||
|
|
@ -0,0 +1,95 @@
|
|||
From 97fe94c94f030f5596a3a3ac52748bdd7544ad52 Mon Sep 17 00:00:00 2001
|
||||
From: Jan Kolarik <jkolarik@redhat.com>
|
||||
Date: Tue, 1 Nov 2022 09:15:08 +0000
|
||||
Subject: [PATCH] Document changes to offline-upgrade command (RhBug:1939975)
|
||||
|
||||
A support for security filters was added to the offline-upgrade command. This commit adds the documentation into the man pages.
|
||||
|
||||
= changelog =
|
||||
type: bugfix
|
||||
resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1939975
|
||||
---
|
||||
doc/command_ref.rst | 28 ++++++++++++++--------------
|
||||
1 file changed, 14 insertions(+), 14 deletions(-)
|
||||
|
||||
diff --git a/doc/command_ref.rst b/doc/command_ref.rst
|
||||
index bee6a109..7279b3a4 100644
|
||||
--- a/doc/command_ref.rst
|
||||
+++ b/doc/command_ref.rst
|
||||
@@ -113,7 +113,7 @@ Options
|
||||
|
||||
``--advisory=<advisory>, --advisories=<advisory>``
|
||||
Include packages corresponding to the advisory ID, Eg. FEDORA-2201-123.
|
||||
- Applicable for the install, repoquery, updateinfo and upgrade commands.
|
||||
+ Applicable for the ``install``, ``repoquery``, ``updateinfo``, ``upgrade`` and ``offline-upgrade`` (dnf-plugins-core) commands.
|
||||
|
||||
``--allowerasing``
|
||||
Allow erasing of installed packages to resolve dependencies. This option could be used as an alternative to the ``yum swap`` command where packages to remove are not explicitly defined.
|
||||
@@ -125,12 +125,12 @@ Options
|
||||
Try the best available package versions in transactions. Specifically during :ref:`dnf upgrade <upgrade_command-label>`, which by default skips over updates that can not be installed for dependency reasons, the switch forces DNF to only consider the latest packages. When running into packages with broken dependencies, DNF will fail giving a reason why the latest version can not be installed.
|
||||
|
||||
``--bugfix``
|
||||
- Include packages that fix a bugfix issue. Applicable for the install, repoquery, updateinfo and
|
||||
- upgrade commands.
|
||||
+ Include packages that fix a bugfix issue.
|
||||
+ Applicable for the ``install``, ``repoquery``, ``updateinfo``, ``upgrade`` and ``offline-upgrade`` (dnf-plugins-core) commands.
|
||||
|
||||
``--bz=<bugzilla>, --bzs=<bugzilla>``
|
||||
- Include packages that fix a Bugzilla ID, Eg. 123123. Applicable for the install, repoquery,
|
||||
- updateinfo and upgrade commands.
|
||||
+ Include packages that fix a Bugzilla ID, Eg. 123123.
|
||||
+ Applicable for the ``install``, ``repoquery``, ``updateinfo``, ``upgrade`` and ``offline-upgrade`` (dnf-plugins-core) commands.
|
||||
|
||||
``-C, --cacheonly``
|
||||
Run entirely from system cache, don't update the cache and use it even in case it is expired.
|
||||
@@ -148,8 +148,8 @@ Options
|
||||
|
||||
``--cve=<cves>, --cves=<cves>``
|
||||
Include packages that fix a CVE (Common Vulnerabilities and Exposures) ID
|
||||
- (http://cve.mitre.org/about/), Eg. CVE-2201-0123. Applicable for the install, repoquery, updateinfo,
|
||||
- and upgrade commands.
|
||||
+ (http://cve.mitre.org/about/), Eg. CVE-2201-0123.
|
||||
+ Applicable for the ``install``, ``repoquery``, ``updateinfo``, ``upgrade`` and ``offline-upgrade`` (dnf-plugins-core) commands.
|
||||
|
||||
``-d <debug level>, --debuglevel=<debug level>``
|
||||
Debugging output level. This is an integer value between 0 (no additional information strings) and 10 (shows all debugging information, even that not understandable to the user), default is 2. Deprecated, use ``-v`` instead.
|
||||
@@ -208,8 +208,8 @@ Options
|
||||
Enable additional repositories by an id or a glob.
|
||||
|
||||
``--enhancement``
|
||||
- Include enhancement relevant packages. Applicable for the install, repoquery, updateinfo and
|
||||
- upgrade commands.
|
||||
+ Include enhancement relevant packages.
|
||||
+ Applicable for the ``install``, ``repoquery``, ``updateinfo``, ``upgrade`` and ``offline-upgrade`` (dnf-plugins-core) commands.
|
||||
|
||||
.. _exclude_option-label:
|
||||
|
||||
@@ -280,8 +280,8 @@ Options
|
||||
``--setopt`` using configuration from ``/path/dnf.conf``.
|
||||
|
||||
``--newpackage``
|
||||
- Include newpackage relevant packages. Applicable for the install, repoquery, updateinfo and
|
||||
- upgrade commands.
|
||||
+ Include newpackage relevant packages.
|
||||
+ Applicable for the ``install``, ``repoquery``, ``updateinfo``, ``upgrade`` and ``offline-upgrade`` (dnf-plugins-core) commands.
|
||||
|
||||
``--noautoremove``
|
||||
Disable removal of dependencies that are no longer used. It sets
|
||||
@@ -353,11 +353,11 @@ Options
|
||||
|
||||
``--sec-severity=<severity>, --secseverity=<severity>``
|
||||
Includes packages that provide a fix for an issue of the specified severity.
|
||||
- Applicable for the install, repoquery, updateinfo and upgrade commands.
|
||||
+ Applicable for the ``install``, ``repoquery``, ``updateinfo``, ``upgrade`` and ``offline-upgrade`` (dnf-plugins-core) commands.
|
||||
|
||||
``--security``
|
||||
- Includes packages that provide a fix for a security issue. Applicable for the
|
||||
- upgrade command.
|
||||
+ Includes packages that provide a fix for a security issue.
|
||||
+ Applicable for the ``install``, ``repoquery``, ``updateinfo``, ``upgrade`` and ``offline-upgrade`` (dnf-plugins-core) commands.
|
||||
|
||||
.. _setopt_option-label:
|
||||
|
||||
--
|
||||
2.38.1
|
||||
|
|
@ -0,0 +1,114 @@
|
|||
From f1fbef17862e033bf9518bd318339b405f2664dd Mon Sep 17 00:00:00 2001
|
||||
From: Nicola Sella <nsella@redhat.com>
|
||||
Date: Mon, 22 Mar 2021 17:37:51 +0100
|
||||
Subject: [PATCH 1/2] Better explain traceback of rpm.error with dnf
|
||||
|
||||
=changelog=
|
||||
msg: Add dnf.error message to explain rpm.error traceback when package not found after resolving a transaction
|
||||
type: bugfix
|
||||
resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1815327
|
||||
resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1887293
|
||||
resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1909845
|
||||
---
|
||||
dnf/db/group.py | 78 ++++++++++++++++++++++++++-----------------------
|
||||
1 file changed, 41 insertions(+), 37 deletions(-)
|
||||
|
||||
diff --git a/dnf/db/group.py b/dnf/db/group.py
|
||||
index 312e3b98..3a17019a 100644
|
||||
--- a/dnf/db/group.py
|
||||
+++ b/dnf/db/group.py
|
||||
@@ -26,6 +26,7 @@ import dnf.exceptions
|
||||
from dnf.i18n import _
|
||||
from dnf.util import logger
|
||||
|
||||
+import rpm
|
||||
|
||||
class PersistorBase(object):
|
||||
def __init__(self, history):
|
||||
@@ -316,43 +317,46 @@ class RPMTransaction(object):
|
||||
modular_problems = 0
|
||||
|
||||
for tsi in self:
|
||||
- if tsi.action == libdnf.transaction.TransactionItemAction_DOWNGRADE:
|
||||
- hdr = tsi.pkg._header
|
||||
- modular_problems += self._test_fail_safe(hdr, tsi.pkg)
|
||||
- ts.addInstall(hdr, tsi, 'u')
|
||||
- elif tsi.action == libdnf.transaction.TransactionItemAction_DOWNGRADED:
|
||||
- ts.addErase(tsi.pkg.idx)
|
||||
- elif tsi.action == libdnf.transaction.TransactionItemAction_INSTALL:
|
||||
- hdr = tsi.pkg._header
|
||||
- modular_problems += self._test_fail_safe(hdr, tsi.pkg)
|
||||
- ts.addInstall(hdr, tsi, 'i')
|
||||
- elif tsi.action == libdnf.transaction.TransactionItemAction_OBSOLETE:
|
||||
- hdr = tsi.pkg._header
|
||||
- modular_problems += self._test_fail_safe(hdr, tsi.pkg)
|
||||
- ts.addInstall(hdr, tsi, 'u')
|
||||
- elif tsi.action == libdnf.transaction.TransactionItemAction_OBSOLETED:
|
||||
- ts.addErase(tsi.pkg.idx)
|
||||
- elif tsi.action == libdnf.transaction.TransactionItemAction_REINSTALL:
|
||||
- # note: in rpm 4.12 there should not be set
|
||||
- # rpm.RPMPROB_FILTER_REPLACEPKG to work
|
||||
- hdr = tsi.pkg._header
|
||||
- modular_problems += self._test_fail_safe(hdr, tsi.pkg)
|
||||
- ts.addReinstall(hdr, tsi)
|
||||
- elif tsi.action == libdnf.transaction.TransactionItemAction_REINSTALLED:
|
||||
- # Required when multiple packages with the same NEVRA marked as installed
|
||||
- ts.addErase(tsi.pkg.idx)
|
||||
- elif tsi.action == libdnf.transaction.TransactionItemAction_REMOVE:
|
||||
- ts.addErase(tsi.pkg.idx)
|
||||
- elif tsi.action == libdnf.transaction.TransactionItemAction_UPGRADE:
|
||||
- hdr = tsi.pkg._header
|
||||
- modular_problems += self._test_fail_safe(hdr, tsi.pkg)
|
||||
- ts.addInstall(hdr, tsi, 'u')
|
||||
- elif tsi.action == libdnf.transaction.TransactionItemAction_UPGRADED:
|
||||
- ts.addErase(tsi.pkg.idx)
|
||||
- elif tsi.action == libdnf.transaction.TransactionItemAction_REASON_CHANGE:
|
||||
- pass
|
||||
- else:
|
||||
- raise RuntimeError("TransactionItemAction not handled: %s" % tsi.action)
|
||||
+ try:
|
||||
+ if tsi.action == libdnf.transaction.TransactionItemAction_DOWNGRADE:
|
||||
+ hdr = tsi.pkg._header
|
||||
+ modular_problems += self._test_fail_safe(hdr, tsi.pkg)
|
||||
+ ts.addInstall(hdr, tsi, 'u')
|
||||
+ elif tsi.action == libdnf.transaction.TransactionItemAction_DOWNGRADED:
|
||||
+ ts.addErase(tsi.pkg.idx)
|
||||
+ elif tsi.action == libdnf.transaction.TransactionItemAction_INSTALL:
|
||||
+ hdr = tsi.pkg._header
|
||||
+ modular_problems += self._test_fail_safe(hdr, tsi.pkg)
|
||||
+ ts.addInstall(hdr, tsi, 'i')
|
||||
+ elif tsi.action == libdnf.transaction.TransactionItemAction_OBSOLETE:
|
||||
+ hdr = tsi.pkg._header
|
||||
+ modular_problems += self._test_fail_safe(hdr, tsi.pkg)
|
||||
+ ts.addInstall(hdr, tsi, 'u')
|
||||
+ elif tsi.action == libdnf.transaction.TransactionItemAction_OBSOLETED:
|
||||
+ ts.addErase(tsi.pkg.idx)
|
||||
+ elif tsi.action == libdnf.transaction.TransactionItemAction_REINSTALL:
|
||||
+ # note: in rpm 4.12 there should not be set
|
||||
+ # rpm.RPMPROB_FILTER_REPLACEPKG to work
|
||||
+ hdr = tsi.pkg._header
|
||||
+ modular_problems += self._test_fail_safe(hdr, tsi.pkg)
|
||||
+ ts.addReinstall(hdr, tsi)
|
||||
+ elif tsi.action == libdnf.transaction.TransactionItemAction_REINSTALLED:
|
||||
+ # Required when multiple packages with the same NEVRA marked as installed
|
||||
+ ts.addErase(tsi.pkg.idx)
|
||||
+ elif tsi.action == libdnf.transaction.TransactionItemAction_REMOVE:
|
||||
+ ts.addErase(tsi.pkg.idx)
|
||||
+ elif tsi.action == libdnf.transaction.TransactionItemAction_UPGRADE:
|
||||
+ hdr = tsi.pkg._header
|
||||
+ modular_problems += self._test_fail_safe(hdr, tsi.pkg)
|
||||
+ ts.addInstall(hdr, tsi, 'u')
|
||||
+ elif tsi.action == libdnf.transaction.TransactionItemAction_UPGRADED:
|
||||
+ ts.addErase(tsi.pkg.idx)
|
||||
+ elif tsi.action == libdnf.transaction.TransactionItemAction_REASON_CHANGE:
|
||||
+ pass
|
||||
+ else:
|
||||
+ raise RuntimeError("TransactionItemAction not handled: %s" % tsi.action)
|
||||
+ except rpm.error as e:
|
||||
+ raise dnf.exceptions.Error(_("An rpm exception occurred: %s" % e))
|
||||
if modular_problems:
|
||||
raise dnf.exceptions.Error(_("No available modular metadata for modular package"))
|
||||
|
||||
--
|
||||
2.39.0
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
From 23742561dcb168604d9668815a8c1ebbdf516d39 Mon Sep 17 00:00:00 2001
|
||||
From: Jan Kolarik <jkolarik@redhat.com>
|
||||
Date: Wed, 23 Nov 2022 08:44:41 +0000
|
||||
Subject: [PATCH 2/2] Ignore processing variable files with unsupported
|
||||
encoding (RhBug:2141215)
|
||||
|
||||
This issue could be seen for example when there are some temporary files stored by text editors in the `/etc/dnf/vars` folder. These files could be in the binary format and causes `UnicodeDecodeError` exception to be thrown during processing of the var files.
|
||||
|
||||
= changelog =
|
||||
type: bugfix
|
||||
resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2141215
|
||||
---
|
||||
dnf/conf/substitutions.py | 9 ++++++---
|
||||
1 file changed, 6 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/dnf/conf/substitutions.py b/dnf/conf/substitutions.py
|
||||
index 1281bdf0..4d0f0d55 100644
|
||||
--- a/dnf/conf/substitutions.py
|
||||
+++ b/dnf/conf/substitutions.py
|
||||
@@ -18,13 +18,15 @@
|
||||
# Red Hat, Inc.
|
||||
#
|
||||
|
||||
+import logging
|
||||
import os
|
||||
import re
|
||||
|
||||
-import dnf
|
||||
-import dnf.exceptions
|
||||
+from dnf.i18n import _
|
||||
|
||||
ENVIRONMENT_VARS_RE = re.compile(r'^DNF_VAR_[A-Za-z0-9_]+$')
|
||||
+logger = logging.getLogger('dnf')
|
||||
+
|
||||
|
||||
class Substitutions(dict):
|
||||
# :api
|
||||
@@ -60,7 +62,8 @@ class Substitutions(dict):
|
||||
val = fp.readline()
|
||||
if val and val[-1] == '\n':
|
||||
val = val[:-1]
|
||||
- except (OSError, IOError):
|
||||
+ except (OSError, IOError, UnicodeDecodeError) as e:
|
||||
+ logger.warning(_("Error when parsing a variable from file '{0}': {1}").format(filepath, e))
|
||||
continue
|
||||
if val is not None:
|
||||
self[fsvar] = val
|
||||
--
|
||||
2.39.0
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,45 @@
|
|||
From 33c354ed52be8f8fa2d43aff8ba1fe1540e1744c Mon Sep 17 00:00:00 2001
|
||||
From: Kyle Walker <kwalker@redhat.com>
|
||||
Date: Tue, 20 Dec 2022 08:42:03 -0500
|
||||
Subject: [PATCH] Omit src RPMs from check-update (RhBug: 2151910)
|
||||
|
||||
The current check-update operation relies on src RPMs not being included
|
||||
in the available repos. When those repos are enabled, *.src RPMs can be
|
||||
emitted as updates that are available. Those RPMs are not updated in the
|
||||
traditional fashion and can cause confusion to end users.
|
||||
|
||||
This change unconditionally filters out src packages in the
|
||||
_list_patterns() callpath.
|
||||
|
||||
= changelog =
|
||||
type: bugfix
|
||||
resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2151910
|
||||
---
|
||||
dnf/base.py | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/dnf/base.py b/dnf/base.py
|
||||
index aba411e..8c19276 100644
|
||||
--- a/dnf/base.py
|
||||
+++ b/dnf/base.py
|
||||
@@ -1519,6 +1519,8 @@ class Base(object):
|
||||
updates = query_for_repo(q).filterm(upgrades_by_priority=True)
|
||||
# reduce a query to security upgrades if they are specified
|
||||
updates = self._merge_update_filters(updates, upgrade=True)
|
||||
+ # reduce a query to remove src RPMs
|
||||
+ updates.filterm(arch__neq=['src', 'nosrc'])
|
||||
# reduce a query to latest packages
|
||||
updates = updates.latest().run()
|
||||
|
||||
@@ -1571,6 +1573,8 @@ class Base(object):
|
||||
self.sack.query()).filter(obsoletes_by_priority=inst)
|
||||
# reduce a query to security upgrades if they are specified
|
||||
obsoletes = self._merge_update_filters(obsoletes, warning=False, upgrade=True)
|
||||
+ # reduce a query to remove src RPMs
|
||||
+ obsoletes.filterm(arch__neq=['src', 'nosrc'])
|
||||
obsoletesTuples = []
|
||||
for new in obsoletes:
|
||||
obsoleted_reldeps = new.obsoletes
|
||||
--
|
||||
libgit2 1.3.2
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
From 2658062d4c176201d0decf03929a89b44761c072 Mon Sep 17 00:00:00 2001
|
||||
From: Marek Blaha <mblaha@redhat.com>
|
||||
Date: Mon, 3 Apr 2023 12:19:40 +0200
|
||||
Subject: [PATCH] Backport: automatic: Fix online detection with proxy (RhBz:2022440)
|
||||
|
||||
In case the proxy is configured (either for a repo of globally) it is
|
||||
used also for detecting whether the system is online.
|
||||
|
||||
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2022440
|
||||
---
|
||||
dnf/automatic/main.py | 20 ++++++++++++++------
|
||||
1 file changed, 14 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/dnf/automatic/main.py b/dnf/automatic/main.py
|
||||
index b53d9c0..93ce13c 100644
|
||||
--- a/dnf/automatic/main.py
|
||||
+++ b/dnf/automatic/main.py
|
||||
@@ -251,21 +251,29 @@ def wait_for_network(repos, timeout):
|
||||
'http': 80,
|
||||
'https': 443,
|
||||
'ftp': 21,
|
||||
+ 'socks': 1080,
|
||||
+ 'socks5': 1080,
|
||||
}
|
||||
|
||||
def remote_address(url_list):
|
||||
for url in url_list:
|
||||
parsed_url = dnf.pycomp.urlparse.urlparse(url)
|
||||
- if parsed_url.hostname and parsed_url.scheme in remote_schemes:
|
||||
- yield (parsed_url.hostname,
|
||||
- parsed_url.port or remote_schemes[parsed_url.scheme])
|
||||
+ if (not parsed_url.hostname) \
|
||||
+ or (not parsed_url.port and parsed_url.scheme not in remote_schemes):
|
||||
+ # skip urls without hostname or without recognized port
|
||||
+ continue
|
||||
+ yield (parsed_url.hostname,
|
||||
+ parsed_url.port or remote_schemes[parsed_url.scheme])
|
||||
|
||||
# collect possible remote repositories urls
|
||||
addresses = set()
|
||||
for repo in repos.iter_enabled():
|
||||
- addresses.update(remote_address(repo.baseurl))
|
||||
- addresses.update(remote_address([repo.mirrorlist]))
|
||||
- addresses.update(remote_address([repo.metalink]))
|
||||
+ if repo.proxy:
|
||||
+ addresses.update(remote_address([repo.proxy]))
|
||||
+ else:
|
||||
+ addresses.update(remote_address(repo.baseurl))
|
||||
+ addresses.update(remote_address([repo.mirrorlist]))
|
||||
+ addresses.update(remote_address([repo.metalink]))
|
||||
|
||||
if not addresses:
|
||||
# there is no remote repository enabled so network connection should not be needed
|
||||
--
|
||||
libgit2 1.3.2
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
From 46aeabda1980621ca0f87528e0a81b4f59d886f0 Mon Sep 17 00:00:00 2001
|
||||
From: Jan Kolarik <jkolarik@redhat.com>
|
||||
Date: Thu, 20 Apr 2023 10:10:14 +0000
|
||||
Subject: [PATCH] automatic: Return an error when transaction fails
|
||||
(RhBug:2170093)
|
||||
|
||||
In case of no global error occurred within the transaction, we still need to check state of individual transaction items for any failure.
|
||||
|
||||
This is matching the logic in `BaseCli.do_transaction` method, where the error is emitted after printing the transaction summary.
|
||||
|
||||
= changelog =
|
||||
msg: automatic: Return an error when transaction fails
|
||||
type: bugfix
|
||||
resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2170093
|
||||
---
|
||||
dnf/automatic/main.py | 7 +++++++
|
||||
1 file changed, 7 insertions(+)
|
||||
|
||||
diff --git a/dnf/automatic/main.py b/dnf/automatic/main.py
|
||||
index 93ce13cc..ccd9ab64 100644
|
||||
--- a/dnf/automatic/main.py
|
||||
+++ b/dnf/automatic/main.py
|
||||
@@ -346,6 +346,13 @@ def main(args):
|
||||
|
||||
gpgsigcheck(base, trans.install_set)
|
||||
base.do_transaction()
|
||||
+
|
||||
+ # In case of no global error occurred within the transaction,
|
||||
+ # we need to check state of individual transaction items.
|
||||
+ for tsi in trans:
|
||||
+ if tsi.state == libdnf.transaction.TransactionItemState_ERROR:
|
||||
+ raise dnf.exceptions.Error(_('Transaction failed'))
|
||||
+
|
||||
emitters.notify_applied()
|
||||
emitters.commit()
|
||||
except dnf.exceptions.Error as exc:
|
||||
--
|
||||
2.40.1
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
From a74209ff53c9a51293b45434196dff49002c5691 Mon Sep 17 00:00:00 2001
|
||||
From: Evan Goode <mail@evangoo.de>
|
||||
Date: Tue, 30 May 2023 20:48:54 +0000
|
||||
Subject: [PATCH] Document symbols in `dnf history list` output
|
||||
|
||||
This patch adds documentation for the symbols shown in the "Action(s)"
|
||||
and "Altered" columns of `dnf history list`
|
||||
|
||||
The "Action(s)" column abbreviates the names of transaction actions when
|
||||
there was more than one action, e.g. a transaction that both installs
|
||||
and upgrades packages would be displayed as "I, U".
|
||||
|
||||
The "Altered" column prints some extra symbols when something unusual
|
||||
happened with the transaction, like if any warnings were printed or if
|
||||
it completed with a non-zero status.
|
||||
|
||||
Some language was taken from the yum man pages:
|
||||
https://github.com/rpm-software-management/yum/blob/master/docs/yum.8.
|
||||
It appears we no longer use the "P" or "s" symbols.
|
||||
|
||||
Resolves https://bugzilla.redhat.com/show_bug.cgi?id=2172067
|
||||
(RhBug:2172067)
|
||||
|
||||
= changelog =
|
||||
msg: Document the symbols in the output of `dnf history list`
|
||||
type: bugfix
|
||||
resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2172067
|
||||
---
|
||||
doc/command_ref.rst | 18 ++++++++++++++++++
|
||||
1 file changed, 18 insertions(+)
|
||||
|
||||
diff --git a/doc/command_ref.rst b/doc/command_ref.rst
|
||||
index 7279b3a4..f8149e86 100644
|
||||
--- a/doc/command_ref.rst
|
||||
+++ b/doc/command_ref.rst
|
||||
@@ -701,6 +701,24 @@ transactions and act according to this information (assuming the
|
||||
which specifies a transaction by a package which it manipulated. When no
|
||||
transaction is specified, list all known transactions.
|
||||
|
||||
+ The "Action(s)" column lists each type of action taken in the transaction. The possible values are:
|
||||
+
|
||||
+ * Install (I): a new package was installed on the system
|
||||
+ * Downgrade (D): an older version of a package replaced the previously-installed version
|
||||
+ * Obsolete (O): an obsolete package was replaced by a new package
|
||||
+ * Upgrade (U): a newer version of the package replaced the previously-installed version
|
||||
+ * Remove (E): a package was removed from the system
|
||||
+ * Reinstall (R): a package was reinstalled with the same version
|
||||
+ * Reason change (C): a package was kept in the system but its reason for being installed changed
|
||||
+
|
||||
+ The "Altered" column lists the number of actions taken in each transaction, possibly followed by one or two the following symbols:
|
||||
+
|
||||
+ * ``>``: The RPM database was changed, outside DNF, after the transaction
|
||||
+ * ``<``: The RPM database was changed, outside DNF, before the transaction
|
||||
+ * ``*``: The transaction aborted before completion
|
||||
+ * ``#``: The transaction completed, but with a non-zero status
|
||||
+ * ``E``: The transaction completed successfully, but had warning/error output
|
||||
+
|
||||
``--reverse``
|
||||
The order of ``history list`` output is printed in reverse order.
|
||||
|
||||
--
|
||||
2.40.1
|
||||
|
|
@ -0,0 +1,85 @@
|
|||
From 29f4df4bf7bf7cb9099dbc7c834441ce4e75b623 Mon Sep 17 00:00:00 2001
|
||||
From: Miro Hrončok <miro@hroncok.cz>
|
||||
Date: Wed, 23 Feb 2022 13:25:12 +0100
|
||||
Subject: [PATCH] RHEL-1245: Remove /usr/bin from sys.path to avoid accidentally importing garbage
|
||||
|
||||
See https://bugzilla.redhat.com/show_bug.cgi?id=2057340
|
||||
and https://github.com/benjaminp/six/issues/359
|
||||
|
||||
dnf should never import Python modules from /usr/bin but users can
|
||||
have files in there that look like Python modules and Python will
|
||||
try to import them and fail.
|
||||
|
||||
Consider a tool that is *not* written in Python and is called "copy.pyc".
|
||||
Naturally, it resides in /usr/bin/copy.pyc and dnf fails:
|
||||
|
||||
Traceback (most recent call last):
|
||||
File "/usr/bin/dnf", line 57, in <module>
|
||||
from dnf.cli import main
|
||||
File "/usr/lib/python3.10/site-packages/dnf/__init__.py", line 30, in <module>
|
||||
import dnf.base
|
||||
File "/usr/lib/python3.10/site-packages/dnf/base.py", line 31, in <module>
|
||||
from copy import deepcopy
|
||||
ImportError: bad magic number in 'copy': b'...'
|
||||
|
||||
Similarly, a tool actually written in Python, called "copy.py"
|
||||
might as well own /usr/bin/copy.py and dnf fails as well:
|
||||
|
||||
Traceback (most recent call last):
|
||||
File "/usr/bin/dnf", line 57, in <module>
|
||||
from dnf.cli import main
|
||||
File "/usr/lib/python3.10/site-packages/dnf/__init__.py", line 30, in <module>
|
||||
import dnf.base
|
||||
File "/usr/lib/python3.10/site-packages/dnf/base.py", line 31, in <module>
|
||||
from copy import deepcopy
|
||||
ImportError: cannot import name 'deepcopy' from 'copy' (/usr/bin/copy.py)
|
||||
|
||||
Either problem can happen for a variety of names.
|
||||
We better not let that happen.
|
||||
|
||||
A more general solution that would prevent Python doing this entirely
|
||||
does not exists yet, see https://discuss.python.org/t/4235
|
||||
|
||||
Hence, proposing this to dnf, which is a critical piece of the system.
|
||||
---
|
||||
bin/dnf-automatic.in | 6 +++++-
|
||||
bin/dnf.in | 6 +++++-
|
||||
2 files changed, 10 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/bin/dnf-automatic.in b/bin/dnf-automatic.in
|
||||
index 5b06aa2..17e35a0 100755
|
||||
--- a/bin/dnf-automatic.in
|
||||
+++ b/bin/dnf-automatic.in
|
||||
@@ -23,7 +23,11 @@ import os
|
||||
import sys
|
||||
|
||||
here = sys.path[0]
|
||||
-if here != '/usr/bin':
|
||||
+if here == '/usr/bin':
|
||||
+ # we never import Python modules from /usr/bin
|
||||
+ # removing this lowers the risk of accidental imports of weird files
|
||||
+ del sys.path[0]
|
||||
+else:
|
||||
# git checkout
|
||||
dnf_toplevel = os.path.dirname(here)
|
||||
sys.path[0] = dnf_toplevel
|
||||
diff --git a/bin/dnf.in b/bin/dnf.in
|
||||
index 645d0f0..55ceb3f 100755
|
||||
--- a/bin/dnf.in
|
||||
+++ b/bin/dnf.in
|
||||
@@ -48,7 +48,11 @@ if __name__ != "__main__":
|
||||
sys.exit(1)
|
||||
|
||||
here = sys.path[0]
|
||||
-if here != '/usr/bin':
|
||||
+if here == '/usr/bin':
|
||||
+ # we never import Python modules from /usr/bin
|
||||
+ # removing this lowers the risk of accidental imports of weird files
|
||||
+ del sys.path[0]
|
||||
+else:
|
||||
# git checkout
|
||||
import os
|
||||
dnf_toplevel = os.path.dirname(here)
|
||||
--
|
||||
libgit2 1.6.4
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,53 @@
|
|||
From 8bc3b7a217de41c0a9bc52cd9cac50cde9e9ee65 Mon Sep 17 00:00:00 2001
|
||||
From: Anish Bhatt <anish.bhatt@salesforce.com>
|
||||
Date: Mon, 10 Jul 2023 10:09:17 -0700
|
||||
Subject: [PATCH] When parsing over a KVP list, do not return till the whole
|
||||
list is parsed
|
||||
|
||||
---
|
||||
dnf/repodict.py | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/dnf/repodict.py b/dnf/repodict.py
|
||||
index ffa0f8ed..82c05ac0 100644
|
||||
--- a/dnf/repodict.py
|
||||
+++ b/dnf/repodict.py
|
||||
@@ -79,8 +79,8 @@ class RepoDict(dict):
|
||||
if isinstance(value, str):
|
||||
substituted.append(
|
||||
libdnf.conf.ConfigParser.substitute(value, conf.substitutions))
|
||||
- if substituted:
|
||||
- return substituted
|
||||
+ if substituted:
|
||||
+ return substituted
|
||||
return values
|
||||
|
||||
repo = dnf.repo.Repo(repoid, conf)
|
||||
--
|
||||
2.41.0
|
||||
|
||||
|
||||
From 89c6f3633f55acd31d44a487ce76dd89c12d795c Mon Sep 17 00:00:00 2001
|
||||
From: Anish Bhatt <anish.bhatt@salesforce.com>
|
||||
Date: Mon, 10 Jul 2023 10:10:30 -0700
|
||||
Subject: [PATCH] Add to authors
|
||||
|
||||
---
|
||||
AUTHORS | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/AUTHORS b/AUTHORS
|
||||
index 0077c7ea..eb1e0121 100644
|
||||
--- a/AUTHORS
|
||||
+++ b/AUTHORS
|
||||
@@ -63,6 +63,7 @@ DNF CONTRIBUTORS
|
||||
Adam Williamson <awilliam@redhat.com>
|
||||
Albert Uchytil <auchytil@redhat.com>
|
||||
Alberto Ruiz <aruiz@redhat.com>
|
||||
+ Anish Bhatt <anish.bhatt@salesforce.com>
|
||||
Baurzhan Muftakhidinov <baurthefirst@gmail.com>
|
||||
Christopher Meng <cickumqt@gmail.com>
|
||||
Daniel Mach <dmach@redhat.com>
|
||||
--
|
||||
2.41.0
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
diff -aruN dnf-4.7.0/dnf/const.py.in dnf-4.7.0_alma/dnf/const.py.in
|
||||
--- dnf-4.7.0/dnf/const.py.in 2021-04-12 18:26:33.000000000 +0300
|
||||
+++ dnf-4.7.0_alma/dnf/const.py.in 2021-12-30 10:30:33.806575400 +0300
|
||||
@@ -55,4 +55,4 @@
|
||||
USER_AGENT = "dnf/%s" % VERSION
|
||||
|
||||
BUGTRACKER_COMPONENT=NAME.lower()
|
||||
-BUGTRACKER='https://bugzilla.redhat.com/enter_bug.cgi?product=Fedora&component=%s' % BUGTRACKER_COMPONENT
|
||||
+BUGTRACKER='https://bugs.almalinux.org/'
|
||||
diff -aruN dnf-4.7.0/doc/conf.py.in dnf-4.7.0_alma/doc/conf.py.in
|
||||
--- dnf-4.7.0/doc/conf.py.in 2021-04-12 18:26:33.000000000 +0300
|
||||
+++ dnf-4.7.0_alma/doc/conf.py.in 2021-12-30 10:34:07.810855800 +0300
|
||||
@@ -267,5 +267,5 @@
|
||||
.. _DNF: https://github.com/rpm-software-management/dnf/
|
||||
.. _hawkey: http://rpm-software-management.github.io/hawkey/
|
||||
.. _YUM: http://yum.baseurl.org/
|
||||
-.. _bugzilla: https://bugzilla.redhat.com/enter_bug.cgi?product=Fedora&component=dnf
|
||||
+.. _bugzilla: https://bugs.almalinux.org/
|
||||
"""
|
||||
diff -aruN dnf-4.7.0/tests/test_config.py dnf-4.7.0_alma/tests/test_config.py
|
||||
--- dnf-4.7.0/tests/test_config.py 2021-04-12 18:26:33.000000000 +0300
|
||||
+++ dnf-4.7.0_alma/tests/test_config.py 2021-12-30 10:33:24.147815500 +0300
|
||||
@@ -55,8 +55,7 @@
|
||||
def test_bugtracker(self):
|
||||
conf = Conf()
|
||||
self.assertEqual(conf.bugtracker_url,
|
||||
- "https://bugzilla.redhat.com/enter_bug.cgi" +
|
||||
- "?product=Fedora&component=dnf")
|
||||
+ "https://bugs.almalinux.org/")
|
||||
|
||||
def test_conf_from_file(self):
|
||||
conf = Conf()
|
|
@ -66,7 +66,7 @@ It supports RPMs, modules and comps groups & environments.
|
|||
|
||||
Name: dnf
|
||||
Version: 4.7.0
|
||||
Release: 11%{?dist}
|
||||
Release: 20%{?dist}.alma
|
||||
Summary: %{pkg_summary}
|
||||
# For a breakdown of the licensing, see PACKAGE-LICENSING
|
||||
License: GPLv2+
|
||||
|
@ -102,6 +102,31 @@ Patch0023: 0023-Base.reset-plug-temporary-leak-of-libsolv-s-page-fil.patch
|
|||
Patch0024: 0024-doc-Describe-how-gpg-keys-are-stored-for-repo_ggpche.patch
|
||||
Patch0025: 0025-Add-only-relevant-pkgs-to-upgrade-transaction-RhBug-.patch
|
||||
Patch0026: 0026-Use-installed_all-because-installed_query-is-filtere.patch
|
||||
Patch0027: 0027-Don-t-include-resolved-advisories-for-obsoletes-with.patch
|
||||
Patch0028: 0028-Set-default-value-for-variable-to-prevent-crash-RhBu.patch
|
||||
Patch0029: 0029-Add-doc-related-to-destdir-and-downloadonly-options-.patch
|
||||
Patch0030: 0030-Expose-plugin-unload-method-to-API-RhBug-2047251.patch
|
||||
Patch0031: 0031-Add-support-for-group-upgrade-rollback-RhBug-2016070.patch
|
||||
Patch0032: 0032-Fix-upgrade-from-file-to-noarch-pkg-RhBug-2006018.patch
|
||||
Patch0033: 0033-Allow-passing-plugin-parameters-with-dashes-in-names.patch
|
||||
Patch0034: 0034-Fix-plugins-unit-tests-unload-plugins-upon-their-del.patch
|
||||
Patch0035: 0035-Move-system-upgrade-plugin-to-core-RhBug-2054235.patch
|
||||
Patch0036: 0036-Add-support-for-rollback-of-group-upgrade-rollback-R.patch
|
||||
Patch0037: 0037-Document-changes-to-offline-upgrade-command.patch
|
||||
Patch0038: 0038-Better-explain-traceback-of-rpm.error-with-dnf.patch
|
||||
Patch0039: 0039-Ignore-processing-variable-files-with-unsupported-en.patch
|
||||
Patch0040: 0040-Update-translations.patch
|
||||
Patch0041: 0041-Omit-src-RPMs-from-check-update-RhBug-2151910.patch
|
||||
Patch0042: 0042-Backport-automatic-Fix-onl-detect-proxy-RhBz2022440.patch
|
||||
Patch0043: 0043-automatic-Return-an-error-when-transaction-fails-RhB.patch
|
||||
Patch0044: 0044-Document-symbols-in-dnf-history-list-output.patch
|
||||
Patch0045: 0045-RHEL-1245-Remove-usrbin-from-syspath-noimpor-garbage.patch
|
||||
Patch0046: 0046-RHEL-6393-Fix-japanese-translations.patch
|
||||
Patch0047: 0047-RHEL-11786-Fix-substitution-in-kvp-in-add_new_repo.patch
|
||||
|
||||
|
||||
#Almalinux patches
|
||||
Patch10000: almalinux_bugtracker.patch
|
||||
|
||||
BuildArch: noarch
|
||||
BuildRequires: cmake
|
||||
|
@ -401,6 +426,45 @@ popd
|
|||
%{python3_sitelib}/%{name}/automatic/
|
||||
|
||||
%changelog
|
||||
* Wed Mar 27 2024 Eduard Abdullin <eabdullin@almalinux.org> - 4.7.0-20.alma
|
||||
- AlmaLinux changes
|
||||
|
||||
* Mon Oct 16 2023 Jaroslav Rohel <jrohel@redhat.com> - 4.7.0-20
|
||||
- Remove /usr/bin from sys.path to avoid accidentally importing garbage (RHEL-1245)
|
||||
- Fix japanese translations (RHEL-6393)
|
||||
- Fix substitution in kay-value-pair list in add_new_repo (RHEL-11786)
|
||||
* Wed Jun 28 2023 Jaroslav Rohel <jrohel@redhat.com> - 4.7.0-19
|
||||
- Document symbols in `dnf history list` output (RhBug:2172067)
|
||||
* Wed May 31 2023 Nicola Sella <nsella@redhat.com> - 4.7.0-18
|
||||
- Return an error when transaction fails (RhBug:2170093)
|
||||
|
||||
* Wed May 17 2023 Jaroslav Rohel <jrohel@redhat.com> - 4.7.0-17
|
||||
- Omit src RPMs from check-update (RhBug:2151910,2203069)
|
||||
- automatic: Fix online detection with proxy (RhBug:2022440,2189851)
|
||||
|
||||
* Wed Mar 08 2023 Marek Blaha <mblaha@redhat.com> - 4.7.0-16
|
||||
- Update translations
|
||||
|
||||
* Thu Jan 05 2023 Nicola Sella <nsella@redhat.com> - 4.7.0-15
|
||||
- Ignore processing variable files with unsupported encoding (RhBug:2141215)
|
||||
- Better explain traceback of rpm.error with dnf
|
||||
* Wed Nov 30 2022 Nicola Sella <nsella@redhat.com> - 4.7.0-14
|
||||
- Document changes to offline-upgrade command (RhBug:1939975,2139324)
|
||||
|
||||
* Wed Oct 26 2022 Nicola Sella <nsella@redhat.com> - 4.7.0-13
|
||||
- Add support for rollback of group upgrade rollback (RhBug:2016070)
|
||||
- Move system-upgrade plugin to core (RhBug:2054235)
|
||||
- Fix plugins unit tests + unload plugins upon their deletion (RhBug:2134309)
|
||||
|
||||
* Tue Sep 13 2022 Lukas Hrazky <lhrazky@redhat.com> - 4.7.0-12
|
||||
- Allow passing plugin parameters with dashes in names (RhBug:1980712)
|
||||
- Fix upgrade from file to noarch pkg (RhBug:2006018)
|
||||
- Add support for group upgrade rollback (RhBug:2016070)
|
||||
- Expose plugin unload method to API (RhBug:2047251)
|
||||
- Add doc related to --destdir and --downloadonly options (RhBug:2100811)
|
||||
- Set default value for variable to prevent crash (RhBug:2091636)
|
||||
- Don't include resolved advisories for obsoletes with sec. filters (RhBug:2101421)
|
||||
|
||||
* Tue Jul 19 2022 Lukas Hrazky <lhrazky@redhat.com> - 4.7.0-11
|
||||
- [doc] Describe how gpg keys are stored for `repo_ggpcheck`
|
||||
- Add only relevant pkgs to upgrade transaction (RhBug:2097757)
|
||||
|
|
Loading…
Reference in New Issue