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

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