Backport patches

Resolves: rhbz#2212262
Resolves: rhbz#2218113
This commit is contained in:
Jaroslav Rohel 2023-06-28 10:39:09 +02:00
parent 219f083e34
commit aeb22da079
3 changed files with 109 additions and 1 deletions

View File

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

View File

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

View File

@ -69,7 +69,7 @@ It supports RPMs, modules and comps groups & environments.
Name: dnf
Version: 4.14.0
Release: 7%{?dist}
Release: 8%{?dist}
Summary: %{pkg_summary}
# For a breakdown of the licensing, see PACKAGE-LICENSING
License: GPLv2+
@ -84,6 +84,8 @@ Patch6: 0006-Update-translations.patch
Patch7: 0007-Add-reboot-option-to-DNF-Automatic.patch
Patch8: 0008-Omit-src-RPMs-from-check-update-RhBug-2151910.patch
Patch9: 0009-automatic-Fix-online-detection-with-proxy-RhBz2022440.patch
Patch10: 0010-automatic-Return-an-error-when-transaction-fails-RhB.patch
Patch11: 0011-Document-symbols-in-dnf-history-list-output.patch
BuildArch: noarch
BuildRequires: cmake
@ -372,6 +374,10 @@ popd
%{python3_sitelib}/%{name}/automatic/
%changelog
* Wed Jun 28 2023 Jaroslav Rohel <jrohel@redhat.com> - 4.14.0-8
- Return an error when transaction fails (RhBug:2170093,2212262)
- Document symbols in `dnf history list` output (RhBug:2172067,2218113)
* Tue May 30 2023 Kyle Walker <kwalker@redhat.com> - 4.14.0-7
- Explicitly use the python3.9 runtime (RhBug:2211019)