From c222eb61bc76e199f13a082b405f43cc3d32f58c Mon Sep 17 00:00:00 2001 From: Packit Service Date: Mar 14 2021 14:38:45 +0000 Subject: Apply patch 0018-Allow-stream-switching-if-option-enabled.patch patch_name: 0018-Allow-stream-switching-if-option-enabled.patch present_in_specfile: true location_in_specfile: 18 --- diff --git a/dnf.spec b/dnf.spec index e8113d5..232a37f 100644 --- a/dnf.spec +++ b/dnf.spec @@ -2,7 +2,7 @@ %undefine __cmake_in_source_build # default dependencies -%global hawkey_version 0.54.4 +%global hawkey_version 0.55.0 %global libcomps_version 0.1.8 %global libmodulemd_version 1.4.0 %global rpm_version 4.14.0 diff --git a/dnf/cli/cli.py b/dnf/cli/cli.py index be737ed..29d7373 100644 --- a/dnf/cli/cli.py +++ b/dnf/cli/cli.py @@ -166,15 +166,16 @@ class BaseCli(dnf.Base): :return: history database transaction ID or None """ if dnf.base.WITH_MODULES: - switchedModules = dict(self._moduleContainer.getSwitchedStreams()) - if switchedModules: - report_module_switch(switchedModules) - msg = _("It is not possible to switch enabled streams of a module.\n" - "It is recommended to remove all installed content from the module, and " - "reset the module using '{prog} module reset ' command. After " - "you reset the module, you can install the other stream.").format( - prog=dnf.util.MAIN_PROG) - raise dnf.exceptions.Error(msg) + if not self.conf.module_stream_switch: + switchedModules = dict(self._moduleContainer.getSwitchedStreams()) + if switchedModules: + report_module_switch(switchedModules) + msg = _("It is not possible to switch enabled streams of a module.\n" + "It is recommended to remove all installed content from the module, and " + "reset the module using '{prog} module reset ' command. After " + "you reset the module, you can install the other stream.").format( + prog=dnf.util.MAIN_PROG) + raise dnf.exceptions.Error(msg) trans = self.transaction pkg_str = self.output.list_transaction(trans)