Blame SOURCES/0003-debug-Use-standard-demands.resolving-for-transaction.patch

17a86d
From 01f5570bb74aa923870e253007b76e8ed266a27f Mon Sep 17 00:00:00 2001
17a86d
From: Marek Blaha <mblaha@redhat.com>
17a86d
Date: Wed, 1 Jul 2020 08:52:19 +0200
17a86d
Subject: [PATCH 3/5] [debug] Use standard demands.resolving for transaction
17a86d
 handling
17a86d
17a86d
Do not handle the transaction in plugin, use standard demands.resolving
17a86d
instead. This ensures that transaction errors are correctly presented to
17a86d
the user.
17a86d
17a86d
Before:
17a86d
$ dnf debug-restore running-kernel-remove.txt.gz
17a86d
$ echo $?
17a86d
1
17a86d
17a86d
After the patch:
17a86d
$ dnf debug-restore running-kernel-remove.txt.gz
17a86d
Error:
17a86d
 Problem: The operation would result in removing the following protected packages: kernel-core
17a86d
(try to add '--skip-broken' to skip uninstallable packages)
17a86d
$ echo $?
17a86d
1
17a86d
---
17a86d
 plugins/debug.py | 6 ++----
17a86d
 1 file changed, 2 insertions(+), 4 deletions(-)
17a86d
17a86d
diff --git a/plugins/debug.py b/plugins/debug.py
17a86d
index 29c5bf7..efe6bea 100644
17a86d
--- a/plugins/debug.py
17a86d
+++ b/plugins/debug.py
17a86d
@@ -175,6 +175,8 @@ class DebugRestoreCommand(dnf.cli.Command):
17a86d
         self.cli.demands.sack_activation = True
17a86d
         self.cli.demands.available_repos = True
17a86d
         self.cli.demands.root_user = True
17a86d
+        if not self.opts.output:
17a86d
+            self.cli.demands.resolving = True
17a86d
 
17a86d
     @staticmethod
17a86d
     def set_argparser(parser):
17a86d
@@ -207,10 +209,6 @@ class DebugRestoreCommand(dnf.cli.Command):
17a86d
 
17a86d
         self.process_dump(dump_pkgs, self.opts)
17a86d
 
17a86d
-        if not self.opts.output:
17a86d
-            self.base.resolve()
17a86d
-            self.base.do_transaction()
17a86d
-
17a86d
     def process_installed(self, dump_pkgs, opts):
17a86d
         installed = self.base.sack.query().installed()
17a86d
         installonly_pkgs = self.base._get_installonly_query(installed)
17a86d
-- 
17a86d
2.25.4
17a86d