Blame SOURCES/0018-Allow-stream-switching-if-option-enabled.patch

31f77b
From 9ceb74f77479910f7844a9a87d4b7623687076be Mon Sep 17 00:00:00 2001
31f77b
From: =?UTF-8?q?Ale=C5=A1=20Mat=C4=9Bj?= <amatej@redhat.com>
31f77b
Date: Fri, 24 Jul 2020 07:59:38 +0200
31f77b
Subject: [PATCH] Allow stream switching if option enabled
31f77b
31f77b
= changelog =
31f77b
msg: New config option module_allow_stream_switch allows switching enabled streams
31f77b
type: enhancement
31f77b
---
31f77b
 dnf.spec       |  2 +-
31f77b
 dnf/cli/cli.py | 19 ++++++++++---------
31f77b
 2 files changed, 11 insertions(+), 10 deletions(-)
31f77b
31f77b
diff --git a/dnf.spec b/dnf.spec
31f77b
index 0e63b2b422..04f6f104c7 100644
31f77b
--- a/dnf.spec
31f77b
+++ b/dnf.spec
31f77b
@@ -2,7 +2,7 @@
31f77b
 %undefine __cmake_in_source_build
31f77b
 
31f77b
 # default dependencies
31f77b
-%global hawkey_version 0.54.4
31f77b
+%global hawkey_version 0.55.0
31f77b
 %global libcomps_version 0.1.8
31f77b
 %global libmodulemd_version 1.4.0
31f77b
 %global rpm_version 4.14.0
31f77b
diff --git a/dnf/cli/cli.py b/dnf/cli/cli.py
31f77b
index be737ed3b7..29d7373fa3 100644
31f77b
--- a/dnf/cli/cli.py
31f77b
+++ b/dnf/cli/cli.py
31f77b
@@ -166,15 +166,16 @@ def do_transaction(self, display=()):
31f77b
         :return: history database transaction ID or None
31f77b
         """
31f77b
         if dnf.base.WITH_MODULES:
31f77b
-            switchedModules = dict(self._moduleContainer.getSwitchedStreams())
31f77b
-            if switchedModules:
31f77b
-                report_module_switch(switchedModules)
31f77b
-                msg = _("It is not possible to switch enabled streams of a module.\n"
31f77b
-                        "It is recommended to remove all installed content from the module, and "
31f77b
-                        "reset the module using '{prog} module reset <module_name>' command. After "
31f77b
-                        "you reset the module, you can install the other stream.").format(
31f77b
-                    prog=dnf.util.MAIN_PROG)
31f77b
-                raise dnf.exceptions.Error(msg)
31f77b
+            if not self.conf.module_stream_switch:
31f77b
+                switchedModules = dict(self._moduleContainer.getSwitchedStreams())
31f77b
+                if switchedModules:
31f77b
+                    report_module_switch(switchedModules)
31f77b
+                    msg = _("It is not possible to switch enabled streams of a module.\n"
31f77b
+                            "It is recommended to remove all installed content from the module, and "
31f77b
+                            "reset the module using '{prog} module reset <module_name>' command. After "
31f77b
+                            "you reset the module, you can install the other stream.").format(
31f77b
+                        prog=dnf.util.MAIN_PROG)
31f77b
+                    raise dnf.exceptions.Error(msg)
31f77b
 
31f77b
         trans = self.transaction
31f77b
         pkg_str = self.output.list_transaction(trans)