Compare commits
No commits in common. 'c9' and 'cs10' have entirely different histories.
@ -1 +1 @@
|
|||||||
0697aee277730c57446b5b87bdb12456cf245203 SOURCES/dnf-4.14.0.tar.gz
|
4095a2937f72ac4c20f624cc3bfc8cb32e89c715 SOURCES/dnf-4.20.0.tar.gz
|
||||||
|
@ -1 +1 @@
|
|||||||
SOURCES/dnf-4.14.0.tar.gz
|
SOURCES/dnf-4.20.0.tar.gz
|
||||||
|
@ -1,62 +0,0 @@
|
|||||||
From 5e082d74b73bf1b3565cfd72a3e1ba7a45a00a8b 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: Wed, 7 Sep 2022 14:40:32 +0200
|
|
||||||
Subject: [PATCH 1/2] Pass whole URL in relativeUrl to PackageTarget for RPM
|
|
||||||
URL download
|
|
||||||
|
|
||||||
The PackageTarget supports baseUrl and relativeUrl on the API, but then
|
|
||||||
the relativeUrl is just a path fragment with no definition on whether it
|
|
||||||
should be encoded. It's being passed unencoded paths from other places,
|
|
||||||
and so there's a conditional encode (only if not full URL) in libdnf.
|
|
||||||
|
|
||||||
But full URLs are actually supported in relativeUrl (in that case
|
|
||||||
baseUrl should be empty) and in that case the URL is expected to be
|
|
||||||
encoded and is not encoded for the second time.
|
|
||||||
|
|
||||||
Hence, pass the full URL to relativeUrl instead of splitting it. We also
|
|
||||||
need to decode the file name we store, as on the filesystem the RPM file
|
|
||||||
name is also decoded.
|
|
||||||
|
|
||||||
= changelog =
|
|
||||||
msg: Don't double-encode RPM URLs passed on CLI
|
|
||||||
type: bugfix
|
|
||||||
resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2103015
|
|
||||||
---
|
|
||||||
dnf/repo.py | 7 ++++---
|
|
||||||
1 file changed, 4 insertions(+), 3 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/dnf/repo.py b/dnf/repo.py
|
|
||||||
index ec1a2537..86fb2bf4 100644
|
|
||||||
--- a/dnf/repo.py
|
|
||||||
+++ b/dnf/repo.py
|
|
||||||
@@ -47,6 +47,7 @@ import string
|
|
||||||
import sys
|
|
||||||
import time
|
|
||||||
import traceback
|
|
||||||
+import urllib
|
|
||||||
|
|
||||||
_PACKAGES_RELATIVE_DIR = "packages"
|
|
||||||
_MIRRORLIST_FILENAME = "mirrorlist"
|
|
||||||
@@ -295,7 +296,7 @@ class RemoteRPMPayload(PackagePayload):
|
|
||||||
self.local_path = os.path.join(self.pkgdir, self.__str__().lstrip("/"))
|
|
||||||
|
|
||||||
def __str__(self):
|
|
||||||
- return os.path.basename(self.remote_location)
|
|
||||||
+ return os.path.basename(urllib.parse.unquote(self.remote_location))
|
|
||||||
|
|
||||||
def _progress_cb(self, cbdata, total, done):
|
|
||||||
self.remote_size = total
|
|
||||||
@@ -308,8 +309,8 @@ class RemoteRPMPayload(PackagePayload):
|
|
||||||
|
|
||||||
def _librepo_target(self):
|
|
||||||
return libdnf.repo.PackageTarget(
|
|
||||||
- self.conf._config, os.path.basename(self.remote_location),
|
|
||||||
- self.pkgdir, 0, None, 0, os.path.dirname(self.remote_location),
|
|
||||||
+ self.conf._config, self.remote_location,
|
|
||||||
+ self.pkgdir, 0, None, 0, None,
|
|
||||||
True, 0, 0, self.callbacks)
|
|
||||||
|
|
||||||
@property
|
|
||||||
--
|
|
||||||
2.37.3
|
|
||||||
|
|
@ -1,96 +0,0 @@
|
|||||||
From a41c3aefaa4f982511363645f5608e270094cadf Mon Sep 17 00:00:00 2001
|
|
||||||
From: Jan Kolarik <jkolarik@redhat.com>
|
|
||||||
Date: Tue, 1 Nov 2022 09:15:08 +0000
|
|
||||||
Subject: [PATCH 2/2] 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 f39f2c71..3ee66bac 100644
|
|
||||||
--- a/doc/command_ref.rst
|
|
||||||
+++ b/doc/command_ref.rst
|
|
||||||
@@ -114,7 +114,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.
|
|
||||||
@@ -130,12 +130,12 @@ Options
|
|
||||||
solver may use older versions of dependencies to meet their requirements.
|
|
||||||
|
|
||||||
``--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.
|
|
||||||
@@ -153,8 +153,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.
|
|
||||||
@@ -217,8 +217,8 @@ Options
|
|
||||||
specified multiple times.
|
|
||||||
|
|
||||||
``--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:
|
|
||||||
|
|
||||||
@@ -289,8 +289,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
|
|
||||||
@@ -362,11 +362,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
|
|
||||||
|
|
@ -1,31 +0,0 @@
|
|||||||
From e5732ab22f092bb3fc6ce6e8f94aad72f3654383 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Jan Kolarik <jkolarik@redhat.com>
|
|
||||||
Date: Wed, 31 Aug 2022 07:49:39 +0200
|
|
||||||
Subject: [PATCH 1/2] 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 996ae3b4..f39f2c71 100644
|
|
||||||
--- a/doc/command_ref.rst
|
|
||||||
+++ b/doc/command_ref.rst
|
|
||||||
@@ -189,8 +189,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.38.1
|
|
||||||
|
|
@ -0,0 +1,81 @@
|
|||||||
|
From 78e2838c62bb842cdd6f3adc26e246b97cb7292d Mon Sep 17 00:00:00 2001
|
||||||
|
From: Jaroslav Mracek <jmracek@redhat.com>
|
||||||
|
Date: Tue, 11 Jun 2024 16:02:21 +0200
|
||||||
|
Subject: [PATCH] Drop collect file for ABRT
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
It looks like that it is not required anymore
|
||||||
|
|
||||||
|
Resolve: https://issues.redhat.com/browse/RHEL-40382
|
||||||
|
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||||
|
---
|
||||||
|
dnf.spec | 2 --
|
||||||
|
etc/CMakeLists.txt | 1 -
|
||||||
|
etc/collect_dnf.conf | 24 ------------------------
|
||||||
|
3 files changed, 27 deletions(-)
|
||||||
|
delete mode 100644 etc/collect_dnf.conf
|
||||||
|
|
||||||
|
diff --git a/dnf.spec b/dnf.spec
|
||||||
|
index b3b30529..7bc90c5d 100644
|
||||||
|
--- a/dnf.spec
|
||||||
|
+++ b/dnf.spec
|
||||||
|
@@ -103,7 +103,6 @@ Conflicts: python3-dnf-plugins-extras-common < %{conflicts_dnf_plugins_extr
|
||||||
|
|
||||||
|
%package data
|
||||||
|
Summary: Common data and configuration files for DNF
|
||||||
|
-Requires: libreport-filesystem
|
||||||
|
%if %{with dnf5_obsoletes_dnf}
|
||||||
|
Requires: /etc/dnf/dnf.conf
|
||||||
|
%endif
|
||||||
|
@@ -336,7 +335,6 @@ popd
|
||||||
|
%{_mandir}/man5/%{name}.conf.5*
|
||||||
|
%endif
|
||||||
|
%{_tmpfilesdir}/%{name}.conf
|
||||||
|
-%{_sysconfdir}/libreport/events.d/collect_dnf.conf
|
||||||
|
|
||||||
|
%files -n %{yum_subpackage_name}
|
||||||
|
%if "%{yum_compat_level}" == "full"
|
||||||
|
diff --git a/etc/CMakeLists.txt b/etc/CMakeLists.txt
|
||||||
|
index c7814205..27e3c8ed 100644
|
||||||
|
--- a/etc/CMakeLists.txt
|
||||||
|
+++ b/etc/CMakeLists.txt
|
||||||
|
@@ -1,4 +1,3 @@
|
||||||
|
-INSTALL (FILES "collect_dnf.conf" DESTINATION ${SYSCONFDIR}/libreport/events.d/)
|
||||||
|
ADD_SUBDIRECTORY (bash_completion.d)
|
||||||
|
ADD_SUBDIRECTORY (dnf)
|
||||||
|
ADD_SUBDIRECTORY (logrotate.d)
|
||||||
|
diff --git a/etc/collect_dnf.conf b/etc/collect_dnf.conf
|
||||||
|
deleted file mode 100644
|
||||||
|
index b99721b1..00000000
|
||||||
|
--- a/etc/collect_dnf.conf
|
||||||
|
+++ /dev/null
|
||||||
|
@@ -1,24 +0,0 @@
|
||||||
|
-EVENT=notify component=dnf
|
||||||
|
- # there has to be a comment here, otherwise
|
||||||
|
- # the next line is interpreted as a condition
|
||||||
|
- function fetch()
|
||||||
|
- {
|
||||||
|
- for log in $*; do
|
||||||
|
- new_name=${log//\//_}
|
||||||
|
- cp $log $new_name
|
||||||
|
- done
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- logs=`find /var/cache/dnf -iname '*.log'`
|
||||||
|
- fetch $logs
|
||||||
|
- fetch /var/log/dnf.log
|
||||||
|
- # this would fail for a non-priviledged user
|
||||||
|
- journalctl _SYSTEMD_UNIT=dnf-makecache.service &>dnf-makecache.log
|
||||||
|
- fetch /var/log/dnf.transaction.log
|
||||||
|
- if [[ -r username ]]; then
|
||||||
|
- username=`cat username`
|
||||||
|
- if [[ $username != "root" ]]; then
|
||||||
|
- logs=`find /var/tmp -path "/var/tmp/dnf-${username}-*" -iname '*.log'`
|
||||||
|
- fetch $logs
|
||||||
|
- fi
|
||||||
|
- fi
|
||||||
|
--
|
||||||
|
2.45.2
|
||||||
|
|
@ -1,94 +0,0 @@
|
|||||||
From 3ef5ec915ea4b5e6fe7d25542f0daccef278c01e 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
|
|
||||||
|
|
||||||
---
|
|
||||||
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.38.1
|
|
||||||
|
|
@ -1,50 +0,0 @@
|
|||||||
From 490cf87dd27926d16fb10735b467cbc490d5c9f1 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Jan Kolarik <jkolarik@redhat.com>
|
|
||||||
Date: Wed, 23 Nov 2022 08:44:41 +0000
|
|
||||||
Subject: [PATCH] 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
|
|
||||||
|
|
@ -0,0 +1,162 @@
|
|||||||
|
From b23e3fbd8747fdf89c2a90d6ffd899fc53378aa3 Mon Sep 17 00:00:00 2001
|
||||||
|
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
|
||||||
|
Date: Tue, 23 Jul 2024 14:56:46 +0200
|
||||||
|
Subject: [PATCH] tests: Use PGP keys without SHA-1
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
Tests failed on RHEL 10 where SHA-1 is disabled in a DEFAULT crypto
|
||||||
|
policy and where librepo is configured to use rpm-sequoia which
|
||||||
|
respects the crypto policy (in contrast to gpgme):
|
||||||
|
|
||||||
|
1: ======================================================================
|
||||||
|
1: FAIL: test_rawkey2infos (tests.test_crypto.CryptoTest.test_rawkey2infos)
|
||||||
|
1: ----------------------------------------------------------------------
|
||||||
|
1: Traceback (most recent call last):
|
||||||
|
1: File "/home/test/rhel/dnf/dnf-4.20.0/tests/test_crypto.py", line 75, in test_rawkey2infos
|
||||||
|
1: self.assertEqual(info.userid, 'Dandy Fied <dnf@example.com>')
|
||||||
|
1: AssertionError: '' != 'Dandy Fied <dnf@example.com>'
|
||||||
|
1: + Dandy Fied <dnf@example.com>
|
||||||
|
|
||||||
|
The root cause was that tests/keys/key.pub used the SHA-1 digest
|
||||||
|
algorithm.
|
||||||
|
|
||||||
|
This patch replaces that key with a 4096-bit RSA key signed using
|
||||||
|
SHA-384 digest algorithm.
|
||||||
|
|
||||||
|
Resolves: https://issues.redhat.com/browse/RHEL-50218
|
||||||
|
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||||
|
---
|
||||||
|
tests/keys/key.pub | 75 ++++++++++++++++++++++++++++----------------
|
||||||
|
tests/test_crypto.py | 14 ++++-----
|
||||||
|
2 files changed, 55 insertions(+), 34 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/tests/keys/key.pub b/tests/keys/key.pub
|
||||||
|
index 1b4ad15b7..750e51ac1 100644
|
||||||
|
--- a/tests/keys/key.pub
|
||||||
|
+++ b/tests/keys/key.pub
|
||||||
|
@@ -1,30 +1,51 @@
|
||||||
|
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
||||||
|
-Version: GnuPG v1
|
||||||
|
|
||||||
|
-mQENBFP0iHYBCADWDO8H+0nIqGgTUisRjjWj9zknXks8PgGIyWydBSjJh84d3lqw
|
||||||
|
-Tv+RAxClR2j1YBoyMGT9DxN7NwzneQ6Rj4pIP+Z9LYPA7TFYXiSIws1n0MIXIQWV
|
||||||
|
-Z54H4OzrTHp1B+G2Ykjp2e7/JHvhsPGsRkj4a7zZQGK9xscVTKovAg/PSsBiSGDw
|
||||||
|
-S2b5kId0UmKRO01FtKPLMRi2Q645d093hHRa3FRv4g99uS3xMZCUUTp3+oV3CEGO
|
||||||
|
-J4qnKtl5l09RSubZ1gJRtEaHayYzRYq0AngJCSZwEjfNY/RLpe8Fy2zraTtAl/cB
|
||||||
|
-jC0wIX0BCMuGq5/few7f7InFZIC9XA6Vj/NrABEBAAG0HERhbmR5IEZpZWQgPGRu
|
||||||
|
-ZkBleGFtcGxlLmNvbT6JATgEEwECACIFAlP0iHYCGwMGCwkIBwMCBhUIAgkKCwQW
|
||||||
|
-AgMBAh4BAheAAAoJECQ2KoSSUwyO/GUIAK3cUWelkvcLVbeuWxceE1PtWouA8ovJ
|
||||||
|
-0wJPJv8tScwguTqiZ3ZWOzuLar6e76JEAGiuCZcbrMaNRfydBC64+6lgLpSG3CXJ
|
||||||
|
-4cXvCD/XkO0DOrWR+TObdoFClgZHwyTpPaBgusVi6pAh8ngphqkVJsn0BRxWQL7u
|
||||||
|
-WL1g/kvVnd2zbhSpWpgcTvG7ZGINR+zv9yYwr2/Pi1cos0nB7LZjzXClUELLOI1L
|
||||||
|
-bCtiMYGGiGTOr7US9bmY0Ll0e9foZ/dpqMGeFVRX9ax4LMxNYukmu9UzCxX5HKQl
|
||||||
|
-os7mZBG1oqvpLMkqcUGn0Na/VxMg+xdPSgiUC/42v3PCvV/fEc3Un7y5AQ0EU/SI
|
||||||
|
-dgEIANI9gtGtLM6g6Roacdd9xpI+YXey/Nm13NyYcnSLdZdiLQt2ctgyBq8tujSf
|
||||||
|
-uBmFVujkN0xuV9GCMl8LTbdmF64DVoLLZbWGZIGEiyY3+8lSSh5urgxFrmy6HXUL
|
||||||
|
-qRpK28aBVP0DuQWgObH/+SJmKXx+c1nfq9zlAIdwTDd/j/IOWnYzFQiJns3hzMmf
|
||||||
|
-ptnw7gf5P86L0Bq/LMxPXtI0wlJC3NZNU3zKcw0feAbjN77tI8Yc3hOtaMFFVL+Z
|
||||||
|
-r8zzQXiPrBSlBH/i9cC3O18+3K4PW0LEkRfOBKxMaQhWc1K/VRMbErcXAzVGr3WC
|
||||||
|
-WXwRW+5gfvhppJbB1guklJk07N0AEQEAAYkBHwQYAQIACQUCU/SIdgIbDAAKCRAk
|
||||||
|
-NiqEklMMjjS/B/4+207VxTN/42Xx7ZYIdJYp5cZJn3lqHzYhnUrq126EsFzHuRry
|
||||||
|
-izumAcvLur+dpmOHsqtcocL5s80X6VBG/rgdwHS5Zfnx7SLPk/fK+KwM888jhI67
|
||||||
|
-616kipZxH0G28+jzRvY5urfCj91b23l4x/upkCpvMQPus520RiQutJBFLgMP4Q8Z
|
||||||
|
-hlSi13h8bGGgj1JgOgkql8QD/MGuIEcH/0agqSauedtM7h09+UkO/3m2Zd6q5tpH
|
||||||
|
-3qBcnwiUiq848s7AnUuSF4+ORwJf06sZC1QtmBf/NCVB18mfpa5VY+2XXtX9Nzmd
|
||||||
|
-HK40HDRIXyBP4BZN6axx1yflGUFGBO+oyGS3
|
||||||
|
-=qEyr
|
||||||
|
+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
|
||||||
|
+=P1HS
|
||||||
|
-----END PGP PUBLIC KEY BLOCK-----
|
||||||
|
diff --git a/tests/test_crypto.py b/tests/test_crypto.py
|
||||||
|
index bb55d2203..dbbcfd630 100644
|
||||||
|
--- a/tests/test_crypto.py
|
||||||
|
+++ b/tests/test_crypto.py
|
||||||
|
@@ -30,7 +30,7 @@ import dnf.yum.misc
|
||||||
|
import tests.support
|
||||||
|
|
||||||
|
|
||||||
|
-FINGERPRINT = '0BE49FAF9C955F4F1A98D14B24362A8492530C8E'
|
||||||
|
+FINGERPRINT = '88FBCE424BA9952A141A6A297B5443AEAA6F01F3'
|
||||||
|
KEYFILE = tests.support.resource_path('keys/key.pub')
|
||||||
|
KEYFILE_URL = 'file://%s' % KEYFILE
|
||||||
|
|
||||||
|
@@ -53,11 +53,11 @@ class CryptoTest(tests.support.TestCase):
|
||||||
|
|
||||||
|
def test_keyids_from_pubring(self):
|
||||||
|
ids = dnf.crypto.keyids_from_pubring(self.PUBRING_DIR)
|
||||||
|
- self.assertIn('24362A8492530C8E', ids)
|
||||||
|
+ self.assertIn('7B5443AEAA6F01F3', ids)
|
||||||
|
|
||||||
|
def test_printable_fingerprint(self):
|
||||||
|
self.assertEqual(dnf.crypto._printable_fingerprint(FINGERPRINT),
|
||||||
|
- '0BE4 9FAF 9C95 5F4F 1A98 D14B 2436 2A84 9253 0C8E')
|
||||||
|
+ '88FB CE42 4BA9 952A 141A 6A29 7B54 43AE AA6F 01F3')
|
||||||
|
|
||||||
|
def test_pubring_dir(self):
|
||||||
|
self.assertNotEqual(os.environ.get('GNUPGHOME'), self.PUBRING_DIR)
|
||||||
|
@@ -68,10 +68,10 @@ class CryptoTest(tests.support.TestCase):
|
||||||
|
with open(KEYFILE, 'rb') as keyfile:
|
||||||
|
info = dnf.crypto.rawkey2infos(keyfile)[0]
|
||||||
|
self.assertEqual(info.fingerprint, FINGERPRINT)
|
||||||
|
- self.assertEqual(info.short_id, '92530C8E')
|
||||||
|
- self.assertEqual(info.rpm_id, '92530c8e')
|
||||||
|
- self.assertIn(b'Frmy6HXUL\n', info.raw_key)
|
||||||
|
- self.assertEqual(info.timestamp, 1408534646)
|
||||||
|
+ self.assertEqual(info.short_id, 'AA6F01F3')
|
||||||
|
+ self.assertEqual(info.rpm_id, 'aa6f01f3')
|
||||||
|
+ self.assertIn(b'E4bO2zVZwe\n', info.raw_key)
|
||||||
|
+ self.assertEqual(info.timestamp, 1721738657)
|
||||||
|
self.assertEqual(info.userid, 'Dandy Fied <dnf@example.com>')
|
||||||
|
|
||||||
|
def test_retrieve(self):
|
||||||
|
--
|
||||||
|
2.45.2
|
||||||
|
|
@ -0,0 +1,98 @@
|
|||||||
|
From b00c7171f58dbbda3df4bf5f2e65cbc7eff37a5b Mon Sep 17 00:00:00 2001
|
||||||
|
From: David Cantrell <dcantrell@redhat.com>
|
||||||
|
Date: Thu, 15 Feb 2024 14:03:32 -0500
|
||||||
|
Subject: [PATCH] Add detection for ostree-based systems and warn users about
|
||||||
|
losing changes
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
Upstream commit: 5c050ba2324c5fb95bf0e0501c7925f38f6a09dc
|
||||||
|
|
||||||
|
On ostree-based systems, users can use dnf to customize the
|
||||||
|
environment but those changes will be lost at the next ostree-based
|
||||||
|
image update. If you want to retain changes between ostree-updates
|
||||||
|
you need to make use of rpm-ostree right now.
|
||||||
|
|
||||||
|
Signed-off-by: David Cantrell <dcantrell@redhat.com>
|
||||||
|
Resolves: https://issues.redhat.com/browse/RHEL-49671
|
||||||
|
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||||
|
---
|
||||||
|
dnf/cli/cli.py | 9 +++++++++
|
||||||
|
dnf/util.py | 31 +++++++++++++++++++++++++++++++
|
||||||
|
2 files changed, 40 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/dnf/cli/cli.py b/dnf/cli/cli.py
|
||||||
|
index 1824bd00e..c14f83639 100644
|
||||||
|
--- a/dnf/cli/cli.py
|
||||||
|
+++ b/dnf/cli/cli.py
|
||||||
|
@@ -214,6 +214,15 @@ class BaseCli(dnf.Base):
|
||||||
|
elif 'test' in self.conf.tsflags:
|
||||||
|
logger.info(_("{prog} will only download packages, install gpg keys, and check the "
|
||||||
|
"transaction.").format(prog=dnf.util.MAIN_PROG_UPPER))
|
||||||
|
+ if dnf.util.is_container():
|
||||||
|
+ _container_msg = _("""
|
||||||
|
+*** This system is managed with ostree. Changes to the system
|
||||||
|
+*** made with dnf will be lost with the next ostree-based update.
|
||||||
|
+*** If you do not want to lose these changes, use 'rpm-ostree'.
|
||||||
|
+""")
|
||||||
|
+ logger.info(_container_msg)
|
||||||
|
+ raise CliError(_("Operation aborted."))
|
||||||
|
+
|
||||||
|
if self._promptWanted():
|
||||||
|
if self.conf.assumeno or not self.output.userconfirm():
|
||||||
|
raise CliError(_("Operation aborted."))
|
||||||
|
diff --git a/dnf/util.py b/dnf/util.py
|
||||||
|
index 6cd7ad41f..1b465bda5 100644
|
||||||
|
--- a/dnf/util.py
|
||||||
|
+++ b/dnf/util.py
|
||||||
|
@@ -33,11 +33,13 @@ import errno
|
||||||
|
import functools
|
||||||
|
import hawkey
|
||||||
|
import itertools
|
||||||
|
+import json
|
||||||
|
import locale
|
||||||
|
import logging
|
||||||
|
import os
|
||||||
|
import pwd
|
||||||
|
import shutil
|
||||||
|
+import subprocess
|
||||||
|
import sys
|
||||||
|
import tempfile
|
||||||
|
import time
|
||||||
|
@@ -639,3 +641,32 @@ def _is_file_pattern_present(specs):
|
||||||
|
if subj._filename_pattern:
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
+
|
||||||
|
+
|
||||||
|
+def is_container():
|
||||||
|
+ """Returns true is the system is managed as an immutable container,
|
||||||
|
+ false otherwise. If msg is True, a warning message is displayed
|
||||||
|
+ for the user.
|
||||||
|
+ """
|
||||||
|
+
|
||||||
|
+ bootc = '/usr/bin/bootc'
|
||||||
|
+ ostree = '/sysroot/ostree'
|
||||||
|
+
|
||||||
|
+ if os.path.isfile(bootc) and os.access(bootc, os.X_OK):
|
||||||
|
+ p = subprocess.Popen([bootc, "status", "--json"], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||||
|
+ (out, err) = p.communicate()
|
||||||
|
+
|
||||||
|
+ if p.returncode == 0:
|
||||||
|
+ # check the output of 'bootc status'
|
||||||
|
+ j = json.loads(out)
|
||||||
|
+
|
||||||
|
+ # XXX: the API from bootc status is evolving
|
||||||
|
+ status = j.get("status", "")
|
||||||
|
+ kind = j.get("kind", "")
|
||||||
|
+
|
||||||
|
+ if kind.lower() == "bootchost" and bool(status.get("isContainer", None)):
|
||||||
|
+ return True
|
||||||
|
+ elif os.path.isdir(ostree):
|
||||||
|
+ return True
|
||||||
|
+
|
||||||
|
+ return False
|
||||||
|
--
|
||||||
|
2.46.2
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
@ -1,252 +0,0 @@
|
|||||||
From 56d3e10ecb666da53a77d17e9ac7524f3e1341d8 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Evan Goode <mail@evangoo.de>
|
|
||||||
Date: Tue, 24 Jan 2023 09:53:47 -0500
|
|
||||||
Subject: [PATCH 1/4] Add reboot option to DNF Automatic (RhBug:2124793)
|
|
||||||
|
|
||||||
Add ability in DNF Automatic to automatically trigger a reboot after an
|
|
||||||
upgrade. The `reboot` option supports three settings: ``never`` does not
|
|
||||||
reboot the system (current behavior). ``when-changed`` triggers a reboot
|
|
||||||
after any upgrade. ``when-needed`` triggers a reboot only when rebooting
|
|
||||||
is necessary to apply changes, such as when systemd or the kernel is
|
|
||||||
upgraded. The `reboot_command` option allows customizing the command
|
|
||||||
used to reboot (default is `shutdown -r`).
|
|
||||||
|
|
||||||
= changelog =
|
|
||||||
msg: Add `reboot` option to DNF Automatic
|
|
||||||
type: enhancement
|
|
||||||
resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2124793
|
|
||||||
---
|
|
||||||
dnf/automatic/main.py | 9 +++++++++
|
|
||||||
dnf/base.py | 14 ++++++++++++++
|
|
||||||
doc/automatic.rst | 12 ++++++++++++
|
|
||||||
etc/dnf/automatic.conf | 9 +++++++++
|
|
||||||
tests/automatic/test_main.py | 4 ++++
|
|
||||||
5 files changed, 48 insertions(+)
|
|
||||||
|
|
||||||
diff --git a/dnf/automatic/main.py b/dnf/automatic/main.py
|
|
||||||
index b53d9c00..b68962c2 100644
|
|
||||||
--- a/dnf/automatic/main.py
|
|
||||||
+++ b/dnf/automatic/main.py
|
|
||||||
@@ -24,6 +24,7 @@ from __future__ import unicode_literals
|
|
||||||
|
|
||||||
import argparse
|
|
||||||
import logging
|
|
||||||
+import os
|
|
||||||
import random
|
|
||||||
import socket
|
|
||||||
import time
|
|
||||||
@@ -179,6 +180,9 @@ class CommandsConfig(Config):
|
|
||||||
libdnf.conf.VectorString(['default', 'security'])))
|
|
||||||
self.add_option('random_sleep', libdnf.conf.OptionNumberInt32(300))
|
|
||||||
self.add_option('network_online_timeout', libdnf.conf.OptionNumberInt32(60))
|
|
||||||
+ self.add_option('reboot', libdnf.conf.OptionEnumString('never',
|
|
||||||
+ libdnf.conf.VectorString(['never', 'when-changed', 'when-needed'])))
|
|
||||||
+ self.add_option('reboot_command', libdnf.conf.OptionString('shutdown -r'))
|
|
||||||
|
|
||||||
def imply(self):
|
|
||||||
if self.apply_updates:
|
|
||||||
@@ -340,6 +344,11 @@ def main(args):
|
|
||||||
base.do_transaction()
|
|
||||||
emitters.notify_applied()
|
|
||||||
emitters.commit()
|
|
||||||
+
|
|
||||||
+ if (conf.commands.reboot == 'when-changed' or
|
|
||||||
+ (conf.commands.reboot == 'when-needed' and base.reboot_needed())):
|
|
||||||
+ if os.waitstatus_to_exitcode(os.system(conf.commands.reboot_command)) != 0:
|
|
||||||
+ return 1
|
|
||||||
except dnf.exceptions.Error as exc:
|
|
||||||
logger.error(_('Error: %s'), ucd(exc))
|
|
||||||
return 1
|
|
||||||
diff --git a/dnf/base.py b/dnf/base.py
|
|
||||||
index 154eb4e3..24c5a444 100644
|
|
||||||
--- a/dnf/base.py
|
|
||||||
+++ b/dnf/base.py
|
|
||||||
@@ -2790,6 +2790,20 @@ class Base(object):
|
|
||||||
|
|
||||||
return skipped_conflicts, skipped_dependency
|
|
||||||
|
|
||||||
+ def reboot_needed(self):
|
|
||||||
+ """Check whether a system reboot is recommended following the transaction
|
|
||||||
+
|
|
||||||
+ :return: bool
|
|
||||||
+ """
|
|
||||||
+ if not self.transaction:
|
|
||||||
+ return False
|
|
||||||
+
|
|
||||||
+ # List taken from DNF needs-restarting
|
|
||||||
+ need_reboot = frozenset(('kernel', 'kernel-rt', 'glibc',
|
|
||||||
+ 'linux-firmware', 'systemd', 'dbus',
|
|
||||||
+ 'dbus-broker', 'dbus-daemon'))
|
|
||||||
+ changed_pkgs = self.transaction.install_set | self.transaction.remove_set
|
|
||||||
+ return any(pkg.name in need_reboot for pkg in changed_pkgs)
|
|
||||||
|
|
||||||
def _msg_installed(pkg):
|
|
||||||
name = ucd(pkg)
|
|
||||||
diff --git a/doc/automatic.rst b/doc/automatic.rst
|
|
||||||
index b8e47ad1..ade0ca1a 100644
|
|
||||||
--- a/doc/automatic.rst
|
|
||||||
+++ b/doc/automatic.rst
|
|
||||||
@@ -90,6 +90,18 @@ Setting the mode of operation of the program.
|
|
||||||
|
|
||||||
What kind of upgrades to look at. ``default`` signals looking for all available updates, ``security`` only those with an issued security advisory.
|
|
||||||
|
|
||||||
+``reboot``
|
|
||||||
+ either one of ``never``, ``when-changed``, ``when-needed``, default: ``never``
|
|
||||||
+
|
|
||||||
+ When the system should reboot following upgrades. ``never`` does not reboot the system. ``when-changed`` triggers a reboot after any upgrade. ``when-needed`` triggers a reboot only when rebooting is necessary to apply changes, such as when systemd or the kernel is upgraded.
|
|
||||||
+
|
|
||||||
+``reboot_command``
|
|
||||||
+ string, default: ``shutdown -r``
|
|
||||||
+
|
|
||||||
+ Specify the command to run to trigger a reboot of the system. For example, add a 5-minute delay and a wall message by using ``shutdown -r +5 'Rebooting after upgrading packages'``
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+
|
|
||||||
----------------------
|
|
||||||
``[emitters]`` section
|
|
||||||
----------------------
|
|
||||||
diff --git a/etc/dnf/automatic.conf b/etc/dnf/automatic.conf
|
|
||||||
index 1f7e9402..9735447f 100644
|
|
||||||
--- a/etc/dnf/automatic.conf
|
|
||||||
+++ b/etc/dnf/automatic.conf
|
|
||||||
@@ -21,6 +21,15 @@ download_updates = yes
|
|
||||||
# install.timer override this setting.
|
|
||||||
apply_updates = no
|
|
||||||
|
|
||||||
+# When the system should reboot following upgrades:
|
|
||||||
+# never = don't reboot after upgrades
|
|
||||||
+# when-changed = reboot after any changes
|
|
||||||
+# when-needed = reboot when necessary to apply changes
|
|
||||||
+reboot = never
|
|
||||||
+
|
|
||||||
+# The command that is run to trigger a system reboot.
|
|
||||||
+reboot_command = "shutdown -r"
|
|
||||||
+
|
|
||||||
|
|
||||||
[emitters]
|
|
||||||
# Name to use for this system in messages that are emitted. Default is the
|
|
||||||
diff --git a/tests/automatic/test_main.py b/tests/automatic/test_main.py
|
|
||||||
index 27ffa407..dc4acd52 100644
|
|
||||||
--- a/tests/automatic/test_main.py
|
|
||||||
+++ b/tests/automatic/test_main.py
|
|
||||||
@@ -49,3 +49,7 @@ class TestConfig(tests.support.TestCase):
|
|
||||||
conf = dnf.automatic.main.AutomaticConfig(FILE, downloadupdates=True, installupdates=False)
|
|
||||||
self.assertTrue(conf.commands.download_updates)
|
|
||||||
self.assertFalse(conf.commands.apply_updates)
|
|
||||||
+
|
|
||||||
+ # test that reboot is "never" by default
|
|
||||||
+ conf = dnf.automatic.main.AutomaticConfig(FILE)
|
|
||||||
+ self.assertEqual(conf.commands.reboot, 'never')
|
|
||||||
--
|
|
||||||
2.40.0
|
|
||||||
|
|
||||||
|
|
||||||
From 8d7608f3462deddf36d5a75ff66f847a30b78026 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Evan Goode <mail@evangoo.de>
|
|
||||||
Date: Tue, 24 Jan 2023 09:59:22 -0500
|
|
||||||
Subject: [PATCH 2/4] Add Evan Goode to AUTHORS
|
|
||||||
|
|
||||||
---
|
|
||||||
AUTHORS | 1 +
|
|
||||||
1 file changed, 1 insertion(+)
|
|
||||||
|
|
||||||
diff --git a/AUTHORS b/AUTHORS
|
|
||||||
index 50bff95b..e802a51e 100644
|
|
||||||
--- a/AUTHORS
|
|
||||||
+++ b/AUTHORS
|
|
||||||
@@ -69,6 +69,7 @@ DNF CONTRIBUTORS
|
|
||||||
Dave Johansen <davejohansen@gmail.com>
|
|
||||||
Dylan Pindur <dylanpindur@gmail.com>
|
|
||||||
Eduard Cuba <ecuba@redhat.com>
|
|
||||||
+ Evan Goode <egoode@redhat.com>
|
|
||||||
Filipe Brandenburger <filbranden@gmail.com>
|
|
||||||
Frank Dana <ferdnyc@gmail.com>
|
|
||||||
George Machitidze <giomac@gmail.com>
|
|
||||||
--
|
|
||||||
2.40.0
|
|
||||||
|
|
||||||
|
|
||||||
From 9deed331cb7a1890e1f11a57c989c300b1641a88 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Evan Goode <mail@evangoo.de>
|
|
||||||
Date: Tue, 24 Jan 2023 17:12:46 -0500
|
|
||||||
Subject: [PATCH 3/4] DNF Automatic reboot: 5-minute delay and wall by default
|
|
||||||
|
|
||||||
---
|
|
||||||
dnf/automatic/main.py | 2 +-
|
|
||||||
doc/automatic.rst | 4 ++--
|
|
||||||
etc/dnf/automatic.conf | 2 +-
|
|
||||||
3 files changed, 4 insertions(+), 4 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/dnf/automatic/main.py b/dnf/automatic/main.py
|
|
||||||
index b68962c2..a03c359f 100644
|
|
||||||
--- a/dnf/automatic/main.py
|
|
||||||
+++ b/dnf/automatic/main.py
|
|
||||||
@@ -182,7 +182,7 @@ class CommandsConfig(Config):
|
|
||||||
self.add_option('network_online_timeout', libdnf.conf.OptionNumberInt32(60))
|
|
||||||
self.add_option('reboot', libdnf.conf.OptionEnumString('never',
|
|
||||||
libdnf.conf.VectorString(['never', 'when-changed', 'when-needed'])))
|
|
||||||
- self.add_option('reboot_command', libdnf.conf.OptionString('shutdown -r'))
|
|
||||||
+ self.add_option('reboot_command', libdnf.conf.OptionString('shutdown -r +5 \'Rebooting after applying package updates\''))
|
|
||||||
|
|
||||||
def imply(self):
|
|
||||||
if self.apply_updates:
|
|
||||||
diff --git a/doc/automatic.rst b/doc/automatic.rst
|
|
||||||
index ade0ca1a..329c2f46 100644
|
|
||||||
--- a/doc/automatic.rst
|
|
||||||
+++ b/doc/automatic.rst
|
|
||||||
@@ -96,9 +96,9 @@ Setting the mode of operation of the program.
|
|
||||||
When the system should reboot following upgrades. ``never`` does not reboot the system. ``when-changed`` triggers a reboot after any upgrade. ``when-needed`` triggers a reboot only when rebooting is necessary to apply changes, such as when systemd or the kernel is upgraded.
|
|
||||||
|
|
||||||
``reboot_command``
|
|
||||||
- string, default: ``shutdown -r``
|
|
||||||
+ string, default: ``shutdown -r +5 'Rebooting after applying package updates'``
|
|
||||||
|
|
||||||
- Specify the command to run to trigger a reboot of the system. For example, add a 5-minute delay and a wall message by using ``shutdown -r +5 'Rebooting after upgrading packages'``
|
|
||||||
+ Specify the command to run to trigger a reboot of the system. For example, to skip the 5-minute delay and wall message, use ``shutdown -r``
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/etc/dnf/automatic.conf b/etc/dnf/automatic.conf
|
|
||||||
index 9735447f..e61b12af 100644
|
|
||||||
--- a/etc/dnf/automatic.conf
|
|
||||||
+++ b/etc/dnf/automatic.conf
|
|
||||||
@@ -28,7 +28,7 @@ apply_updates = no
|
|
||||||
reboot = never
|
|
||||||
|
|
||||||
# The command that is run to trigger a system reboot.
|
|
||||||
-reboot_command = "shutdown -r"
|
|
||||||
+reboot_command = "shutdown -r +5 'Rebooting after applying package updates'"
|
|
||||||
|
|
||||||
|
|
||||||
[emitters]
|
|
||||||
--
|
|
||||||
2.40.0
|
|
||||||
|
|
||||||
|
|
||||||
From b002f47a763e442277913a06df963b0ca91deb54 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Evan Goode <mail@evangoo.de>
|
|
||||||
Date: Wed, 25 Jan 2023 09:47:59 -0500
|
|
||||||
Subject: [PATCH 4/4] DNF Automatic: error message for failed reboot command
|
|
||||||
|
|
||||||
---
|
|
||||||
dnf/automatic/main.py | 4 +++-
|
|
||||||
1 file changed, 3 insertions(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/dnf/automatic/main.py b/dnf/automatic/main.py
|
|
||||||
index a03c359f..11c35ecf 100644
|
|
||||||
--- a/dnf/automatic/main.py
|
|
||||||
+++ b/dnf/automatic/main.py
|
|
||||||
@@ -347,7 +347,9 @@ def main(args):
|
|
||||||
|
|
||||||
if (conf.commands.reboot == 'when-changed' or
|
|
||||||
(conf.commands.reboot == 'when-needed' and base.reboot_needed())):
|
|
||||||
- if os.waitstatus_to_exitcode(os.system(conf.commands.reboot_command)) != 0:
|
|
||||||
+ exit_code = os.waitstatus_to_exitcode(os.system(conf.commands.reboot_command))
|
|
||||||
+ if exit_code != 0:
|
|
||||||
+ logger.error('Error: reboot command returned nonzero exit code: %d', exit_code)
|
|
||||||
return 1
|
|
||||||
except dnf.exceptions.Error as exc:
|
|
||||||
logger.error(_('Error: %s'), ucd(exc))
|
|
||||||
--
|
|
||||||
2.40.0
|
|
||||||
|
|
@ -0,0 +1,106 @@
|
|||||||
|
From e2dbb97b9e13a73c47dd59827d7f2214bbdde99f Mon Sep 17 00:00:00 2001
|
||||||
|
From: Joseph Marrero <jmarrero@redhat.com>
|
||||||
|
Date: Tue, 16 Jul 2024 15:48:41 -0400
|
||||||
|
Subject: [PATCH] Update ostree/bootc host system check.
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
Upstream commit: 6120fe52511775b60b6031d4169988c025610ab5
|
||||||
|
|
||||||
|
This changes the is_container() func for _is_bootc_host()
|
||||||
|
and updates the logic and message. This should detect on
|
||||||
|
all ostree and bootc hosts to date that are not using
|
||||||
|
bootc usroverlay or ostree admin unlock for development
|
||||||
|
purposes.
|
||||||
|
|
||||||
|
Resolves: https://issues.redhat.com/browse/RHEL-49671
|
||||||
|
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||||
|
---
|
||||||
|
dnf/cli/cli.py | 11 +++++------
|
||||||
|
dnf/util.py | 33 ++++++++-------------------------
|
||||||
|
2 files changed, 13 insertions(+), 31 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/dnf/cli/cli.py b/dnf/cli/cli.py
|
||||||
|
index c14f83639..83b190026 100644
|
||||||
|
--- a/dnf/cli/cli.py
|
||||||
|
+++ b/dnf/cli/cli.py
|
||||||
|
@@ -214,13 +214,12 @@ class BaseCli(dnf.Base):
|
||||||
|
elif 'test' in self.conf.tsflags:
|
||||||
|
logger.info(_("{prog} will only download packages, install gpg keys, and check the "
|
||||||
|
"transaction.").format(prog=dnf.util.MAIN_PROG_UPPER))
|
||||||
|
- if dnf.util.is_container():
|
||||||
|
- _container_msg = _("""
|
||||||
|
-*** This system is managed with ostree. Changes to the system
|
||||||
|
-*** made with dnf will be lost with the next ostree-based update.
|
||||||
|
-*** If you do not want to lose these changes, use 'rpm-ostree'.
|
||||||
|
+ if dnf.util._is_bootc_host():
|
||||||
|
+ _bootc_host_msg = _("""
|
||||||
|
+*** Error: system is configured to be read-only; for more
|
||||||
|
+*** information run `bootc status` or `ostree admin status`.
|
||||||
|
""")
|
||||||
|
- logger.info(_container_msg)
|
||||||
|
+ logger.info(_bootc_host_msg)
|
||||||
|
raise CliError(_("Operation aborted."))
|
||||||
|
|
||||||
|
if self._promptWanted():
|
||||||
|
diff --git a/dnf/util.py b/dnf/util.py
|
||||||
|
index 1b465bda5..1ba2e27ff 100644
|
||||||
|
--- a/dnf/util.py
|
||||||
|
+++ b/dnf/util.py
|
||||||
|
@@ -33,13 +33,11 @@ import errno
|
||||||
|
import functools
|
||||||
|
import hawkey
|
||||||
|
import itertools
|
||||||
|
-import json
|
||||||
|
import locale
|
||||||
|
import logging
|
||||||
|
import os
|
||||||
|
import pwd
|
||||||
|
import shutil
|
||||||
|
-import subprocess
|
||||||
|
import sys
|
||||||
|
import tempfile
|
||||||
|
import time
|
||||||
|
@@ -643,30 +641,15 @@ def _is_file_pattern_present(specs):
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
-def is_container():
|
||||||
|
+def _is_bootc_host():
|
||||||
|
"""Returns true is the system is managed as an immutable container,
|
||||||
|
false otherwise. If msg is True, a warning message is displayed
|
||||||
|
for the user.
|
||||||
|
"""
|
||||||
|
-
|
||||||
|
- bootc = '/usr/bin/bootc'
|
||||||
|
- ostree = '/sysroot/ostree'
|
||||||
|
-
|
||||||
|
- if os.path.isfile(bootc) and os.access(bootc, os.X_OK):
|
||||||
|
- p = subprocess.Popen([bootc, "status", "--json"], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||||
|
- (out, err) = p.communicate()
|
||||||
|
-
|
||||||
|
- if p.returncode == 0:
|
||||||
|
- # check the output of 'bootc status'
|
||||||
|
- j = json.loads(out)
|
||||||
|
-
|
||||||
|
- # XXX: the API from bootc status is evolving
|
||||||
|
- status = j.get("status", "")
|
||||||
|
- kind = j.get("kind", "")
|
||||||
|
-
|
||||||
|
- if kind.lower() == "bootchost" and bool(status.get("isContainer", None)):
|
||||||
|
- return True
|
||||||
|
- elif os.path.isdir(ostree):
|
||||||
|
- return True
|
||||||
|
-
|
||||||
|
- return False
|
||||||
|
+ ostree_booted = '/run/ostree-booted'
|
||||||
|
+ usr = '/usr/'
|
||||||
|
+ # Check if usr is writtable and we are in a running ostree system.
|
||||||
|
+ # We want this code to return true only when the system is in locked state. If someone ran
|
||||||
|
+ # bootc overlay or ostree admin unlock we would want normal DNF path to be ran as it will be
|
||||||
|
+ # temporary changes (until reboot).
|
||||||
|
+ return os.path.isfile(ostree_booted) and not os.access(usr, os.W_OK)
|
||||||
|
--
|
||||||
|
2.46.2
|
||||||
|
|
@ -1,45 +0,0 @@
|
|||||||
From b0caa16589763699174f47a3e36a703e1af32ed4 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 24c5a44..7e97e21 100644
|
|
||||||
--- a/dnf/base.py
|
|
||||||
+++ b/dnf/base.py
|
|
||||||
@@ -1543,6 +1543,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()
|
|
||||||
|
|
||||||
@@ -1595,6 +1597,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,32 @@
|
|||||||
|
From 15aedf5f4e70695e7801c80498d4da52e49ac626 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Joseph Marrero <jmarrero@redhat.com>
|
||||||
|
Date: Mon, 22 Jul 2024 15:33:32 -0400
|
||||||
|
Subject: [PATCH] Update bootc hosts message to point to bootc --help
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
Upstream commit: e2535589ce16bc36b96b37369502a3c312f6056a
|
||||||
|
Resolves: https://issues.redhat.com/browse/RHEL-49671
|
||||||
|
|
||||||
|
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||||
|
---
|
||||||
|
dnf/cli/cli.py | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/dnf/cli/cli.py b/dnf/cli/cli.py
|
||||||
|
index 83b190026..0eda2c8cb 100644
|
||||||
|
--- a/dnf/cli/cli.py
|
||||||
|
+++ b/dnf/cli/cli.py
|
||||||
|
@@ -217,7 +217,7 @@ class BaseCli(dnf.Base):
|
||||||
|
if dnf.util._is_bootc_host():
|
||||||
|
_bootc_host_msg = _("""
|
||||||
|
*** Error: system is configured to be read-only; for more
|
||||||
|
-*** information run `bootc status` or `ostree admin status`.
|
||||||
|
+*** information run `bootc --help`.
|
||||||
|
""")
|
||||||
|
logger.info(_bootc_host_msg)
|
||||||
|
raise CliError(_("Operation aborted."))
|
||||||
|
--
|
||||||
|
2.46.2
|
||||||
|
|
@ -0,0 +1,47 @@
|
|||||||
|
From ff86cee7cf33f44e4b10538ceeee5f284d6735ed Mon Sep 17 00:00:00 2001
|
||||||
|
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
|
||||||
|
Date: Thu, 15 Aug 2024 14:04:55 +0200
|
||||||
|
Subject: [PATCH] Allow --installroot on read-only bootc system
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
Upstream commit: a1aa8d0e048751859a2bec1b2fb12fcca93c6e83
|
||||||
|
|
||||||
|
Some people use --installroot on a read-only bootc system to install
|
||||||
|
a system into a chroot subtree. However, current bootc check did not
|
||||||
|
take into account --installroot and rejected the operation.
|
||||||
|
|
||||||
|
This patch augments the check for the installroot being different
|
||||||
|
from /.
|
||||||
|
|
||||||
|
It's pointless to check for installroot writability here because
|
||||||
|
installroot is written before this check when updating the
|
||||||
|
repositories and computing a transaction. Moving this check sooner
|
||||||
|
would not help because some directories (/opt, /) are kept read-only
|
||||||
|
even on writable bootc.
|
||||||
|
|
||||||
|
Resolves: #2108
|
||||||
|
Resolves: https://issues.redhat.com/browse/RHEL-49671
|
||||||
|
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||||
|
---
|
||||||
|
dnf/cli/cli.py | 3 ++-
|
||||||
|
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/dnf/cli/cli.py b/dnf/cli/cli.py
|
||||||
|
index 0eda2c8cb..008262ea0 100644
|
||||||
|
--- a/dnf/cli/cli.py
|
||||||
|
+++ b/dnf/cli/cli.py
|
||||||
|
@@ -214,7 +214,8 @@ class BaseCli(dnf.Base):
|
||||||
|
elif 'test' in self.conf.tsflags:
|
||||||
|
logger.info(_("{prog} will only download packages, install gpg keys, and check the "
|
||||||
|
"transaction.").format(prog=dnf.util.MAIN_PROG_UPPER))
|
||||||
|
- if dnf.util._is_bootc_host():
|
||||||
|
+ if dnf.util._is_bootc_host() and \
|
||||||
|
+ os.path.realpath(self.conf.installroot) == "/":
|
||||||
|
_bootc_host_msg = _("""
|
||||||
|
*** Error: system is configured to be read-only; for more
|
||||||
|
*** information run `bootc --help`.
|
||||||
|
--
|
||||||
|
2.46.2
|
||||||
|
|
@ -1,66 +0,0 @@
|
|||||||
From fcc21cf217a7dfaaf79ca36b5afab6344380eae1 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Marek Blaha <mblaha@redhat.com>
|
|
||||||
Date: Mon, 3 Apr 2023 12:19:40 +0200
|
|
||||||
Subject: [PATCH] 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 | 23 ++++++++++++++++-------
|
|
||||||
1 file changed, 16 insertions(+), 7 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/dnf/automatic/main.py b/dnf/automatic/main.py
|
|
||||||
index 11c35ec..756531e 100644
|
|
||||||
--- a/dnf/automatic/main.py
|
|
||||||
+++ b/dnf/automatic/main.py
|
|
||||||
@@ -182,7 +182,8 @@ class CommandsConfig(Config):
|
|
||||||
self.add_option('network_online_timeout', libdnf.conf.OptionNumberInt32(60))
|
|
||||||
self.add_option('reboot', libdnf.conf.OptionEnumString('never',
|
|
||||||
libdnf.conf.VectorString(['never', 'when-changed', 'when-needed'])))
|
|
||||||
- self.add_option('reboot_command', libdnf.conf.OptionString('shutdown -r +5 \'Rebooting after applying package updates\''))
|
|
||||||
+ self.add_option('reboot_command', libdnf.conf.OptionString(
|
|
||||||
+ 'shutdown -r +5 \'Rebooting after applying package updates\''))
|
|
||||||
|
|
||||||
def imply(self):
|
|
||||||
if self.apply_updates:
|
|
||||||
@@ -255,21 +256,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,40 @@
|
|||||||
|
From 86bc1d60e1b8188ca5a682974d734ac3a0cdc102 Mon Sep 17 00:00:00 2001
|
||||||
|
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
|
||||||
|
Date: Thu, 10 Oct 2024 10:57:48 +0200
|
||||||
|
Subject: [PATCH] Allow --downloadonly on read-only bootc system
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
Upstream commit: 8d888d26e6da27ba37243d7504eb42472f389bde
|
||||||
|
|
||||||
|
"dnf install --downloadonly" failed on read-only bootc system despite
|
||||||
|
not running the transaction. The downloaded packages are stored under
|
||||||
|
writable /var or to a directory explicitly choosen by a user.
|
||||||
|
|
||||||
|
This patch suppresses the bootc read-only bailout if --downloadonly
|
||||||
|
option is used.
|
||||||
|
|
||||||
|
https://issues.redhat.com/browse/RHEL-62028
|
||||||
|
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||||
|
---
|
||||||
|
dnf/cli/cli.py | 3 ++-
|
||||||
|
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/dnf/cli/cli.py b/dnf/cli/cli.py
|
||||||
|
index 008262ea0..d3844df34 100644
|
||||||
|
--- a/dnf/cli/cli.py
|
||||||
|
+++ b/dnf/cli/cli.py
|
||||||
|
@@ -215,7 +215,8 @@ class BaseCli(dnf.Base):
|
||||||
|
logger.info(_("{prog} will only download packages, install gpg keys, and check the "
|
||||||
|
"transaction.").format(prog=dnf.util.MAIN_PROG_UPPER))
|
||||||
|
if dnf.util._is_bootc_host() and \
|
||||||
|
- os.path.realpath(self.conf.installroot) == "/":
|
||||||
|
+ os.path.realpath(self.conf.installroot) == "/" and \
|
||||||
|
+ not self.conf.downloadonly:
|
||||||
|
_bootc_host_msg = _("""
|
||||||
|
*** Error: system is configured to be read-only; for more
|
||||||
|
*** information run `bootc --help`.
|
||||||
|
--
|
||||||
|
2.47.0
|
||||||
|
|
@ -1,39 +0,0 @@
|
|||||||
From e62164e450c05d626e4ca2b5dc2728939686b423 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 756531e7..f6f4049b 100644
|
|
||||||
--- a/dnf/automatic/main.py
|
|
||||||
+++ b/dnf/automatic/main.py
|
|
||||||
@@ -351,6 +351,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()
|
|
||||||
|
|
||||||
--
|
|
||||||
2.40.1
|
|
||||||
|
|
@ -1,63 +0,0 @@
|
|||||||
From 0f979bd00d22d52f4970897207bd43a74db90bcc 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 3ee66bac..0e6cea01 100644
|
|
||||||
--- a/doc/command_ref.rst
|
|
||||||
+++ b/doc/command_ref.rst
|
|
||||||
@@ -710,6 +710,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
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
@ -1,53 +0,0 @@
|
|||||||
From 422794199b7b8a5f7426effc04979804cf31b6f7 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 d750fcb27686f73e352ae4575db150aa954aeb10 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 e802a51e..699a92c4 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
|
|
||||||
|
|
@ -1,55 +0,0 @@
|
|||||||
From cbc552f3f2ef72c8cb46e068aef841eee9206e30 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Marek Blaha <mblaha@redhat.com>
|
|
||||||
Date: Wed, 20 Sep 2023 09:15:03 +0200
|
|
||||||
Subject: [PATCH] base: Add obsoleters of only latest versions
|
|
||||||
|
|
||||||
Resolves situations where a package is in older version obsoleted, but
|
|
||||||
there is newer (not obsoleted) version available.
|
|
||||||
This patch covers installation of group packages and arch specific
|
|
||||||
packages. The rest is in hawkey library.
|
|
||||||
|
|
||||||
Relevant bugs:
|
|
||||||
https://bugzilla.redhat.com/show_bug.cgi?id=2183279
|
|
||||||
https://bugzilla.redhat.com/show_bug.cgi?id=2176263
|
|
||||||
---
|
|
||||||
dnf/base.py | 17 +++++++++++++++--
|
|
||||||
1 file changed, 15 insertions(+), 2 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/dnf/base.py b/dnf/base.py
|
|
||||||
index 7e97e21..50869ec 100644
|
|
||||||
--- a/dnf/base.py
|
|
||||||
+++ b/dnf/base.py
|
|
||||||
@@ -1684,7 +1684,16 @@ class Base(object):
|
|
||||||
sltr.set(provides="({} if {})".format(comps_pkg.name, comps_pkg.requires))
|
|
||||||
else:
|
|
||||||
if self.conf.obsoletes:
|
|
||||||
- query = query.union(self.sack.query().filterm(obsoletes=query))
|
|
||||||
+ # If there is no installed package in the pkgs_list, add only
|
|
||||||
+ # obsoleters of the latest versions. Otherwise behave
|
|
||||||
+ # consistently with upgrade and add all obsoleters.
|
|
||||||
+ # See https://bugzilla.redhat.com/show_bug.cgi?id=2176263
|
|
||||||
+ # for details of the problem.
|
|
||||||
+ if query.installed():
|
|
||||||
+ query = query.union(self.sack.query().filterm(obsoletes=query))
|
|
||||||
+ else:
|
|
||||||
+ query = query.union(self.sack.query().filterm(
|
|
||||||
+ obsoletes=query.filter(latest_per_arch_by_priority=True)))
|
|
||||||
sltr.set(pkg=query)
|
|
||||||
self._goal.install(select=sltr, optional=not strict)
|
|
||||||
return remove_query
|
|
||||||
@@ -1921,7 +1930,11 @@ class Base(object):
|
|
||||||
sltr = dnf.selector.Selector(self.sack)
|
|
||||||
q = self.sack.query().filterm(pkg=packages)
|
|
||||||
if self.conf.obsoletes:
|
|
||||||
- q = q.union(self.sack.query().filterm(obsoletes=q))
|
|
||||||
+ # use only obsoletes of the latest versions
|
|
||||||
+ # See https://bugzilla.redhat.com/show_bug.cgi?id=2176263
|
|
||||||
+ # for details of the problem.
|
|
||||||
+ q = q.union(self.sack.query().filterm(
|
|
||||||
+ obsoletes=q.filter(latest_per_arch_by_priority=True)))
|
|
||||||
sltr = sltr.set(pkg=q)
|
|
||||||
if reponame is not None:
|
|
||||||
sltr = sltr.set(reponame=reponame)
|
|
||||||
--
|
|
||||||
libgit2 1.6.4
|
|
||||||
|
|
@ -1,79 +0,0 @@
|
|||||||
From 0592ff47bc1b9029eb9b25d59410062038fdacd3 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Jaroslav Mracek <jmracek@redhat.com>
|
|
||||||
Date: Thu, 15 Feb 2024 11:28:59 +0100
|
|
||||||
Subject: [PATCH] Add all candidates for reinstall to solver
|
|
||||||
MIME-Version: 1.0
|
|
||||||
Content-Type: text/plain; charset=UTF-8
|
|
||||||
Content-Transfer-Encoding: 8bit
|
|
||||||
|
|
||||||
Upstream commit: 96f8d79c37e119ff56f730797865121b63241a6b
|
|
||||||
Resolves: https://issues.redhat.com/browse/RHEL-25005
|
|
||||||
|
|
||||||
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
|
||||||
---
|
|
||||||
dnf/base.py | 9 ++++++---
|
|
||||||
dnf/query.py | 5 ++++-
|
|
||||||
tests/test_queries.py | 7 ++++++-
|
|
||||||
3 files changed, 16 insertions(+), 5 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/dnf/base.py b/dnf/base.py
|
|
||||||
index 50869ec4..adb5ad6f 100644
|
|
||||||
--- a/dnf/base.py
|
|
||||||
+++ b/dnf/base.py
|
|
||||||
@@ -2333,19 +2333,22 @@ class Base(object):
|
|
||||||
|
|
||||||
if not installed_pkgs:
|
|
||||||
raise dnf.exceptions.PackagesNotInstalledError(
|
|
||||||
- 'no package matched', pkg_spec, available_nevra2pkg.values())
|
|
||||||
+ 'no package matched', pkg_spec, available_q.run())
|
|
||||||
|
|
||||||
cnt = 0
|
|
||||||
clean_deps = self.conf.clean_requirements_on_remove
|
|
||||||
+ strict = self.conf.strict
|
|
||||||
for installed_pkg in installed_pkgs:
|
|
||||||
try:
|
|
||||||
- available_pkg = available_nevra2pkg[ucd(installed_pkg)]
|
|
||||||
+ available_pkgs = available_nevra2pkg[ucd(installed_pkg)]
|
|
||||||
except KeyError:
|
|
||||||
if not remove_na:
|
|
||||||
continue
|
|
||||||
self._goal.erase(installed_pkg, clean_deps=clean_deps)
|
|
||||||
else:
|
|
||||||
- self._goal.install(available_pkg)
|
|
||||||
+ sltr = dnf.selector.Selector(self.sack)
|
|
||||||
+ sltr.set(pkg=available_pkgs)
|
|
||||||
+ self._goal.install(select=sltr, optional=(not strict))
|
|
||||||
cnt += 1
|
|
||||||
|
|
||||||
if cnt == 0:
|
|
||||||
diff --git a/dnf/query.py b/dnf/query.py
|
|
||||||
index ab4139bf..02e631a6 100644
|
|
||||||
--- a/dnf/query.py
|
|
||||||
+++ b/dnf/query.py
|
|
||||||
@@ -43,4 +43,7 @@ def _by_provides(sack, patterns, ignore_case=False, get_query=False):
|
|
||||||
return q.run()
|
|
||||||
|
|
||||||
def _per_nevra_dict(pkg_list):
|
|
||||||
- return {ucd(pkg):pkg for pkg in pkg_list}
|
|
||||||
+ nevra_dic = {}
|
|
||||||
+ for pkg in pkg_list:
|
|
||||||
+ nevra_dic.setdefault(ucd(pkg), []).append(pkg)
|
|
||||||
+ return nevra_dic
|
|
||||||
diff --git a/tests/test_queries.py b/tests/test_queries.py
|
|
||||||
index cdcb7ca4..e0253008 100644
|
|
||||||
--- a/tests/test_queries.py
|
|
||||||
+++ b/tests/test_queries.py
|
|
||||||
@@ -128,4 +128,9 @@ class DictsTest(tests.support.TestCase):
|
|
||||||
dct = dnf.query._per_nevra_dict(pkgs)
|
|
||||||
self.assertCountEqual(dct.keys(),
|
|
||||||
["lotus-3-16.x86_64", "lotus-3-16.i686"])
|
|
||||||
- self.assertCountEqual(dct.values(), pkgs)
|
|
||||||
+ test_list = []
|
|
||||||
+ for list_items in dct.values():
|
|
||||||
+ for item in list_items:
|
|
||||||
+ test_list.append(item)
|
|
||||||
+
|
|
||||||
+ self.assertCountEqual(test_list, pkgs)
|
|
||||||
--
|
|
||||||
2.44.0
|
|
||||||
|
|
@ -1,41 +0,0 @@
|
|||||||
From 657197afd95f387d0c60a288b7cdcbfa914f9cd2 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Jaroslav Mracek <jmracek@redhat.com>
|
|
||||||
Date: Mon, 11 Mar 2024 12:36:48 +0100
|
|
||||||
Subject: [PATCH 1/4] Fix handling installonly packages reasons
|
|
||||||
MIME-Version: 1.0
|
|
||||||
Content-Type: text/plain; charset=UTF-8
|
|
||||||
Content-Transfer-Encoding: 8bit
|
|
||||||
|
|
||||||
Upstream commit: a4d815e4df87f5afbae9d37c7faf6a9871d50b53
|
|
||||||
|
|
||||||
The original code took the first item from all remaining packages.
|
|
||||||
It means a random reason and use it to keep installonly package reason.
|
|
||||||
|
|
||||||
Related: https://issues.redhat.com/browse/RHEL-15902
|
|
||||||
Closes: https://github.com/rpm-software-management/dnf/issues/2061
|
|
||||||
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
|
||||||
---
|
|
||||||
dnf/base.py | 6 ++++--
|
|
||||||
1 file changed, 4 insertions(+), 2 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/dnf/base.py b/dnf/base.py
|
|
||||||
index adb5ad6f..b8237183 100644
|
|
||||||
--- a/dnf/base.py
|
|
||||||
+++ b/dnf/base.py
|
|
||||||
@@ -815,9 +815,11 @@ class Base(object):
|
|
||||||
if erasures:
|
|
||||||
remaining_installed_query = self.sack.query(flags=hawkey.IGNORE_EXCLUDES).installed()
|
|
||||||
remaining_installed_query.filterm(pkg__neq=erasures)
|
|
||||||
+ remaining_installed_query.apply()
|
|
||||||
for pkg in erasures:
|
|
||||||
- if remaining_installed_query.filter(name=pkg.name):
|
|
||||||
- remaining = remaining_installed_query[0]
|
|
||||||
+ tmp_remaining_installed_query = remaining_installed_query.filter(name=pkg.name, arch=pkg.arch)
|
|
||||||
+ if tmp_remaining_installed_query:
|
|
||||||
+ remaining = tmp_remaining_installed_query[0]
|
|
||||||
ts.get_reason(remaining)
|
|
||||||
self.history.set_reason(remaining, ts.get_reason(remaining))
|
|
||||||
self._ds_callback.pkg_added(pkg, 'e')
|
|
||||||
--
|
|
||||||
2.45.0
|
|
||||||
|
|
@ -1,36 +0,0 @@
|
|||||||
From 64ca173adf414354c158e429ffec23e4560bb65f Mon Sep 17 00:00:00 2001
|
|
||||||
From: Jaroslav Mracek <jmracek@redhat.com>
|
|
||||||
Date: Fri, 8 Mar 2024 12:51:26 +0100
|
|
||||||
Subject: [PATCH 2/4] Remove confusing sentence from documentation
|
|
||||||
MIME-Version: 1.0
|
|
||||||
Content-Type: text/plain; charset=UTF-8
|
|
||||||
Content-Transfer-Encoding: 8bit
|
|
||||||
|
|
||||||
Upstream commit: 824a95e1786b460102d9bf4a2cec0ce7973f882e
|
|
||||||
|
|
||||||
Installonly packages are handled by autoremove command in a similar
|
|
||||||
way like other package.
|
|
||||||
|
|
||||||
Resolves: https://issues.redhat.com/browse/RHEL-15902
|
|
||||||
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
|
||||||
---
|
|
||||||
doc/command_ref.rst | 3 ---
|
|
||||||
1 file changed, 3 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/doc/command_ref.rst b/doc/command_ref.rst
|
|
||||||
index 0e6cea01..b92a1f10 100644
|
|
||||||
--- a/doc/command_ref.rst
|
|
||||||
+++ b/doc/command_ref.rst
|
|
||||||
@@ -501,9 +501,6 @@ Autoremove Command
|
|
||||||
|
|
||||||
Removes all "leaf" packages from the system that were originally installed as dependencies of user-installed packages, but which are no longer required by any such package.
|
|
||||||
|
|
||||||
-Packages listed in :ref:`installonlypkgs <installonlypkgs-label>` are never automatically removed by
|
|
||||||
-this command.
|
|
||||||
-
|
|
||||||
``dnf [options] autoremove <spec>...``
|
|
||||||
|
|
||||||
This is an alias for the :ref:`\remove_command-label` command with clean_requirements_on_remove set to
|
|
||||||
--
|
|
||||||
2.45.0
|
|
||||||
|
|
@ -1,36 +0,0 @@
|
|||||||
From 2ea32ace13f6a30f86e03b690f284c0ec0992a19 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Jaroslav Mracek <jmracek@redhat.com>
|
|
||||||
Date: Fri, 8 Mar 2024 12:56:57 +0100
|
|
||||||
Subject: [PATCH 3/4] Remove "leaf" word from documentation
|
|
||||||
MIME-Version: 1.0
|
|
||||||
Content-Type: text/plain; charset=UTF-8
|
|
||||||
Content-Transfer-Encoding: 8bit
|
|
||||||
|
|
||||||
Upstream commit: a6d4cd745ce27c09d6cdb4302177b2bfed600549
|
|
||||||
|
|
||||||
Leaf packages term is not define in documentation and it even
|
|
||||||
represent different set of packages that are showed by leaves command.
|
|
||||||
|
|
||||||
Related: https://issues.redhat.com/browse/RHELDOCS-17711
|
|
||||||
Resolves: https://issues.redhat.com/browse/RHEL-15902
|
|
||||||
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
|
||||||
---
|
|
||||||
doc/command_ref.rst | 2 +-
|
|
||||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/doc/command_ref.rst b/doc/command_ref.rst
|
|
||||||
index b92a1f10..8991df2f 100644
|
|
||||||
--- a/doc/command_ref.rst
|
|
||||||
+++ b/doc/command_ref.rst
|
|
||||||
@@ -499,7 +499,7 @@ Autoremove Command
|
|
||||||
|
|
||||||
``dnf [options] autoremove``
|
|
||||||
|
|
||||||
- Removes all "leaf" packages from the system that were originally installed as dependencies of user-installed packages, but which are no longer required by any such package.
|
|
||||||
+ Removes all packages from the system that were originally installed as dependencies of user-installed packages, but which are no longer required by any such package.
|
|
||||||
|
|
||||||
``dnf [options] autoremove <spec>...``
|
|
||||||
|
|
||||||
--
|
|
||||||
2.45.0
|
|
||||||
|
|
@ -1,37 +0,0 @@
|
|||||||
From c09865aa3af8248c69b7aa064fe6e96f68e03de1 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Jaroslav Mracek <jmracek@redhat.com>
|
|
||||||
Date: Fri, 8 Mar 2024 14:06:26 +0100
|
|
||||||
Subject: [PATCH 4/4] Update documentation of history userinstalled command
|
|
||||||
MIME-Version: 1.0
|
|
||||||
Content-Type: text/plain; charset=UTF-8
|
|
||||||
Content-Transfer-Encoding: 8bit
|
|
||||||
|
|
||||||
Upstream commit: 929d9133971b53eabfd65d989ded0de8f72f95ea
|
|
||||||
|
|
||||||
The described behavior differs from current behavior therefore
|
|
||||||
it might create a confusion.
|
|
||||||
|
|
||||||
Resolves: https://issues.redhat.com/browse/RHEL-15902
|
|
||||||
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
|
||||||
---
|
|
||||||
doc/command_ref.rst | 4 ++--
|
|
||||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/doc/command_ref.rst b/doc/command_ref.rst
|
|
||||||
index 8991df2f..ffb84407 100644
|
|
||||||
--- a/doc/command_ref.rst
|
|
||||||
+++ b/doc/command_ref.rst
|
|
||||||
@@ -795,8 +795,8 @@ transactions and act according to this information (assuming the
|
|
||||||
the current state of RPMDB, it will not undo the transaction.
|
|
||||||
|
|
||||||
``dnf history userinstalled``
|
|
||||||
- Show all installonly packages, packages installed outside of DNF and packages not
|
|
||||||
- installed as dependency. I.e. it lists packages that will stay on the system when
|
|
||||||
+ Show all packages installed by user, installed from a group or a module profile, and packages
|
|
||||||
+ installed outside of DNF. I.e. it lists packages that will stay on the system when
|
|
||||||
:ref:`\autoremove_command-label` or :ref:`\remove_command-label` along with
|
|
||||||
`clean_requirements_on_remove` configuration option set to True is executed. Note the same
|
|
||||||
results can be accomplished with ``dnf repoquery --userinstalled``, and the repoquery
|
|
||||||
--
|
|
||||||
2.45.0
|
|
||||||
|
|
@ -1,39 +0,0 @@
|
|||||||
From 5388d980c8137c3ee6924f145bd284169d838fad Mon Sep 17 00:00:00 2001
|
|
||||||
From: Evan Goode <mail@evangoo.de>
|
|
||||||
Date: Tue, 30 Jan 2024 21:36:46 +0000
|
|
||||||
Subject: [PATCH] automatic: Use add_security_filters, not
|
|
||||||
_update_security_filters
|
|
||||||
MIME-Version: 1.0
|
|
||||||
Content-Type: text/plain; charset=UTF-8
|
|
||||||
Content-Transfer-Encoding: 8bit
|
|
||||||
|
|
||||||
Upstream commit: 0b4b8cc8940a4073b33f1bb772651ae27e55f299
|
|
||||||
Resolves: https://issues.redhat.com/browse/RHEL-21874
|
|
||||||
|
|
||||||
It seems that these two approaches for selecting security updates
|
|
||||||
sometimes disagree. The regular `dnf update` command uses
|
|
||||||
base.add_security_filters to select security updates, so dnf-automatic
|
|
||||||
should do the same.
|
|
||||||
|
|
||||||
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
|
||||||
---
|
|
||||||
dnf/automatic/main.py | 3 +--
|
|
||||||
1 file changed, 1 insertion(+), 2 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/dnf/automatic/main.py b/dnf/automatic/main.py
|
|
||||||
index f6f4049b..caef627f 100644
|
|
||||||
--- a/dnf/automatic/main.py
|
|
||||||
+++ b/dnf/automatic/main.py
|
|
||||||
@@ -375,8 +375,7 @@ def main(args):
|
|
||||||
|
|
||||||
def upgrade(base, upgrade_type):
|
|
||||||
if upgrade_type == 'security':
|
|
||||||
- base._update_security_filters.append(base.sack.query().upgrades().filterm(
|
|
||||||
- advisory_type='security'))
|
|
||||||
+ base.add_security_filters("gte", ("security",))
|
|
||||||
base.upgrade_all()
|
|
||||||
elif upgrade_type == 'default':
|
|
||||||
base.upgrade_all()
|
|
||||||
--
|
|
||||||
2.45.0
|
|
||||||
|
|
@ -1,38 +0,0 @@
|
|||||||
From c24e1521813dc002994f243c2b9de331b763b434 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Pavla Kratochvilova <pkratoch@redhat.com>
|
|
||||||
Date: Fri, 5 Apr 2024 14:42:38 +0200
|
|
||||||
Subject: [PATCH 1/2] remove --duplicates: when no duplicates, exit with 0
|
|
||||||
(RHEL-6424)
|
|
||||||
MIME-Version: 1.0
|
|
||||||
Content-Type: text/plain; charset=UTF-8
|
|
||||||
Content-Transfer-Encoding: 8bit
|
|
||||||
|
|
||||||
Upstream commit: 720338fed8124b120b56cc99cc0b13dfe48ffe95
|
|
||||||
|
|
||||||
If no duplicates are present, then the command succesfully removed all
|
|
||||||
duplicates and should exit with 0 and write the message to stdout
|
|
||||||
instead of stderr.
|
|
||||||
|
|
||||||
Resolves: https://issues.redhat.com/browse/RHEL-6424
|
|
||||||
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
|
||||||
---
|
|
||||||
dnf/cli/commands/remove.py | 3 ++-
|
|
||||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/dnf/cli/commands/remove.py b/dnf/cli/commands/remove.py
|
|
||||||
index e455ba6e..af9622fd 100644
|
|
||||||
--- a/dnf/cli/commands/remove.py
|
|
||||||
+++ b/dnf/cli/commands/remove.py
|
|
||||||
@@ -92,7 +92,8 @@ class RemoveCommand(commands.Command):
|
|
||||||
instonly = self.base._get_installonly_query(q.installed())
|
|
||||||
dups = q.duplicated().difference(instonly)
|
|
||||||
if not dups:
|
|
||||||
- raise dnf.exceptions.Error(_('No duplicated packages found for removal.'))
|
|
||||||
+ logger.info(_('No duplicated packages found for removal.'))
|
|
||||||
+ return
|
|
||||||
|
|
||||||
for (name, arch), pkgs_list in dups._na_dict().items():
|
|
||||||
if len(pkgs_list) < 2:
|
|
||||||
--
|
|
||||||
2.45.0
|
|
||||||
|
|
@ -1,38 +0,0 @@
|
|||||||
From 1e78096d569eecbd3201c821cb3484328caf8789 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Pavla Kratochvilova <pkratoch@redhat.com>
|
|
||||||
Date: Fri, 5 Apr 2024 14:43:04 +0200
|
|
||||||
Subject: [PATCH 2/2] remove --oldinstallonly: when no old installonly
|
|
||||||
packages, exit with 0
|
|
||||||
MIME-Version: 1.0
|
|
||||||
Content-Type: text/plain; charset=UTF-8
|
|
||||||
Content-Transfer-Encoding: 8bit
|
|
||||||
|
|
||||||
Upstream commit: 87eb5a7a3561381b5ef5e70548f49288251300fc
|
|
||||||
|
|
||||||
If no old installonly packages are present, then the command succesfully
|
|
||||||
removed all of them and should exit with 0 and write the message to
|
|
||||||
stdout instead of stderr.
|
|
||||||
|
|
||||||
Resolves: https://issues.redhat.com/browse/RHEL-6424
|
|
||||||
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
|
||||||
---
|
|
||||||
dnf/cli/commands/remove.py | 3 +--
|
|
||||||
1 file changed, 1 insertion(+), 2 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/dnf/cli/commands/remove.py b/dnf/cli/commands/remove.py
|
|
||||||
index af9622fd..32e78d6d 100644
|
|
||||||
--- a/dnf/cli/commands/remove.py
|
|
||||||
+++ b/dnf/cli/commands/remove.py
|
|
||||||
@@ -124,8 +124,7 @@ class RemoveCommand(commands.Command):
|
|
||||||
for pkg in instonly:
|
|
||||||
self.base.package_remove(pkg)
|
|
||||||
else:
|
|
||||||
- raise dnf.exceptions.Error(
|
|
||||||
- _('No old installonly packages found for removal.'))
|
|
||||||
+ logger.info(_('No old installonly packages found for removal.'))
|
|
||||||
return
|
|
||||||
|
|
||||||
# Remove groups.
|
|
||||||
--
|
|
||||||
2.45.0
|
|
||||||
|
|
@ -1,38 +0,0 @@
|
|||||||
From 9ceb9b3591899aaa9bb4932bc20be2fa650cbddc Mon Sep 17 00:00:00 2001
|
|
||||||
From: Pavla Kratochvilova <pkratoch@redhat.com>
|
|
||||||
Date: Mon, 18 Mar 2024 11:58:08 +0100
|
|
||||||
Subject: [PATCH] doc: Makecache with timer tries only one mirror
|
|
||||||
MIME-Version: 1.0
|
|
||||||
Content-Type: text/plain; charset=UTF-8
|
|
||||||
Content-Transfer-Encoding: 8bit
|
|
||||||
|
|
||||||
Upstream commit: a6d82221ae32045f0f788708a52d2f2bf5c5740b
|
|
||||||
Related: https://bugzilla.redhat.com/show_bug.cgi?id=922667
|
|
||||||
Related: https://issues.redhat.com/browse/RHEL-1342
|
|
||||||
|
|
||||||
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
|
||||||
---
|
|
||||||
doc/command_ref.rst | 5 +++--
|
|
||||||
1 file changed, 3 insertions(+), 2 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/doc/command_ref.rst b/doc/command_ref.rst
|
|
||||||
index 42dd6e8a..36817c00 100644
|
|
||||||
--- a/doc/command_ref.rst
|
|
||||||
+++ b/doc/command_ref.rst
|
|
||||||
@@ -973,10 +973,11 @@ Makecache Command
|
|
||||||
|
|
||||||
``dnf [options] makecache --timer``
|
|
||||||
Like plain ``makecache``, but instructs DNF to be more resource-aware,
|
|
||||||
- meaning it will not do anything if running on battery power and will terminate
|
|
||||||
+ meaning it will not do anything if running on battery power, it will terminate
|
|
||||||
immediately if it's too soon after the last successful ``makecache`` run
|
|
||||||
(see :manpage:`dnf.conf(5)`, :ref:`metadata_timer_sync
|
|
||||||
- <metadata_timer_sync-label>`).
|
|
||||||
+ <metadata_timer_sync-label>`), and if the first mirror in a repository mirrorlist fails,
|
|
||||||
+ it will not try to synchronize the metadata from more mirrors for that repository.
|
|
||||||
|
|
||||||
.. _mark_command-label:
|
|
||||||
|
|
||||||
--
|
|
||||||
2.45.2
|
|
||||||
|
|
Loading…
Reference in new issue