diff --git a/0001-Reset-all-modules-except-enabled-and-with-defaults-RhBug-1811234.patch b/0001-Reset-all-modules-except-enabled-and-with-defaults-RhBug-1811234.patch new file mode 100644 index 0000000..08cc79c --- /dev/null +++ b/0001-Reset-all-modules-except-enabled-and-with-defaults-RhBug-1811234.patch @@ -0,0 +1,77 @@ +From bdacf7f61a1fae982e05defde0bd4aa2b8442833 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ale=C5=A1=20Mat=C4=9Bj?= +Date: Mon, 18 May 2020 07:16:35 +0200 +Subject: [PATCH] Reset all modules except enabled and with defaults + (RhBug:1811234) + +Downstream hack only + +During system-upgrade to F31 or F32 (F >= 33 don't have defaults) reset +modules to resolve missing upgrade path only if they don't have default +stream or are not enabled. + +The module reset is not applied to offline-distrosync and +offline-upgrade commands. + +Also fixes a fix from RhBug:1767351 where we ran the same module reset +during `run_upgrade` which was needed becase the new state from +`run_download` wasn't saved to the module persistor, here we save it in +transaction_download. + +https://bugzilla.redhat.com/show_bug.cgi?id=1767351 +https://bugzilla.redhat.com/show_bug.cgi?id=1811234 +--- + plugins/system_upgrade.py | 33 +++++++++++++++++++++++++++++++++ + 1 file changed, 33 insertions(+) + +diff --git a/plugins/system_upgrade.py b/plugins/system_upgrade.py +index f082149..b7c3258 100644 +--- a/plugins/system_upgrade.py ++++ b/plugins/system_upgrade.py +@@ -572,6 +572,34 @@ def run_reboot(self): + reboot() + + def run_download(self): ++ # downstream hack to narrow missing upgrade path with modules between dist versions ++ if self.opts.command not in ['offline-upgrade', 'offline-distrosync']: ++ if dnf.base.WITH_MODULES: ++ module_container = self.base._moduleContainer ++ module_names = set() ++ for module in module_container.getModulePackages(): ++ module_names.add(module.getName()) ++ ++ for module_name in module_names: ++ enabled_stream = module_container.getEnabledStream(module_name) ++ default_stream = module_container.getDefaultStream(module_name) ++ # This check is a hotfix to prevent multiple module operations for the same module, ++ # it prevents raising: libdnf::ModulePackageContainer::EnableMultipleStreamsException ++ if not (enabled_stream and default_stream): ++ module_container.reset(module_name) ++ ++ # Update modular excludes ++ hot_fix_repos = [i.id for i in self.base.repos.iter_enabled() if i.module_hotfixes] ++ try: ++ solver_errors = self.base.sack.filter_modules( ++ module_container, hot_fix_repos, self.base.conf.installroot, ++ self.base.conf.module_platform_id, update_only=True, debugsolver=self.base.conf.debug_solver) ++ except hawkey.Exception as e: ++ raise dnf.exceptions.Error(ucd(e)) ++ if solver_errors: ++ logger.warning( ++ dnf.module.module_base.format_modular_solver_errors(solver_errors[0])) ++ + # Mark everything in the world for upgrade/sync + if self.opts.distro_sync: + self.base.distro_sync() +@@ -720,6 +748,11 @@ def transaction_download(self): + state.enable_disable_repos = self.opts.repos_ed + state.destdir = self.base.conf.destdir + state.upgrade_command = self.opts.command ++ ++ if self.opts.command not in ['offline-upgrade', 'offline-distrosync']: ++ if dnf.base.WITH_MODULES: ++ self.base._moduleContainer.save() ++ + msg = DOWNLOAD_FINISHED_MSG.format(command=self.opts.command) + logger.info(msg) + self.log_status(_("Download finished."), diff --git a/0001-Reset-all-modules-on-system-upgrade-RhBug-1767351.patch b/0001-Reset-all-modules-on-system-upgrade-RhBug-1767351.patch deleted file mode 100644 index d14a67b..0000000 --- a/0001-Reset-all-modules-on-system-upgrade-RhBug-1767351.patch +++ /dev/null @@ -1,58 +0,0 @@ -From 6ccd70735f592e5d74625d4baa9dfbb9b89e8af4 Mon Sep 17 00:00:00 2001 -From: Jaroslav Mracek -Date: Fri, 6 Mar 2020 18:51:10 -0800 -Subject: [PATCH] Reset all modules on system-upgrade (RhBug:1767351) - -This is a downstream hack that resolves distribution issue with missing -upgrade path between dist versions. - -The module reset is not applied to offline-distrosync and -offline-upgrade commands. It will allow to users to disable automatic -reset of modules with the same functionality. - -https://bugzilla.redhat.com/show_bug.cgi?id=1767351 ---- - plugins/system_upgrade.py | 20 ++++++++++++++++++++ - 1 file changed, 20 insertions(+) - -diff --git a/plugins/system_upgrade.py b/plugins/system_upgrade.py -index a132a76..2a889a3 100644 ---- a/plugins/system_upgrade.py -+++ b/plugins/system_upgrade.py -@@ -561,6 +561,16 @@ class SystemUpgradeCommand(dnf.cli.Command): - reboot() - - def run_download(self): -+ # downstream hack to narrow missing upgrade path with modules between dist versions -+ if self.opts.command not in ['offline-upgrade', 'offline-distrosync']: -+ if dnf.base.WITH_MODULES: -+ module_base = dnf.module.module_base.ModuleBase(self.base) -+ try: -+ module_base.reset(["*"]) -+ except dnf.exceptions.MarkingErrors: -+ # When no module is available, just pass -+ pass -+ - # Mark everything in the world for upgrade/sync - if self.opts.distro_sync: - self.base.distro_sync() -@@ -574,6 +584,16 @@ class SystemUpgradeCommand(dnf.cli.Command): - state.destdir = self.base.conf.destdir - - def run_upgrade(self): -+ # downstream hack to narrow missing upgrade path with modules between dist versions -+ if self.opts.command not in ['offline-upgrade', 'offline-distrosync']: -+ if dnf.base.WITH_MODULES: -+ module_base = dnf.module.module_base.ModuleBase(self.base) -+ try: -+ module_base.reset(["*"]) -+ except dnf.exceptions.MarkingErrors: -+ # When no module is available, just pass -+ pass -+ - # change the upgrade status (so we can detect crashed upgrades later) - command = '' - with self.state as state: --- -2.25.1 - diff --git a/dnf-plugins-extras.spec b/dnf-plugins-extras.spec index 05a51ac..2d72a9f 100644 --- a/dnf-plugins-extras.spec +++ b/dnf-plugins-extras.spec @@ -15,13 +15,13 @@ Name: dnf-plugins-extras Version: 4.0.10 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Extras Plugins for DNF License: GPLv2+ URL: https://github.com/rpm-software-management/%{name} Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz # This is a downstream hack that resolves distribution issue with missing upgrade path between dist versions. -Patch1: 0001-Reset-all-modules-on-system-upgrade-RhBug-1767351.patch +Patch1: 0001-Reset-all-modules-except-enabled-and-with-defaults-RhBug-1811234.patch BuildArch: noarch BuildRequires: cmake @@ -445,6 +445,9 @@ PYTHONPATH="%{buildroot}%{python3_sitelib}:%{buildroot}%{python3_sitelib}/dnf-pl %endif %changelog +* Fri May 22 2020 Nicola Sella - 4.0.10-1 +- Reset all modules except enabled and with defaults (RhBug:1811234) + * Wed Apr 08 2020 Nicola Sella - 4.0.10-1 - Update to 4.0.10 - Ensure plymouth progressbar is filled up only once (RhBug:1809096)