Blame 0001-Save-install_weak_deps-option-to-persist-through-reb.patch

664184
From 495e04b9902ba75e71ebde50f7cbfbf089c42485 Mon Sep 17 00:00:00 2001
664184
From: Pavla Kratochvilova <pkratoch@redhat.com>
664184
Date: Wed, 17 Oct 2018 14:37:16 +0200
664184
Subject: [PATCH 1/2] Save install_weak_deps option to persist through reboot
664184
 (RhBug:1638689)
664184
664184
https://bugzilla.redhat.com/show_bug.cgi?id=1638689
664184
When the install_weak_deps is set to False during the download
664184
(--setopt=install_weak_deps=False), the upgrade fails as some weak
664184
dependencies are missing. Therefore, the option must be reused during
664184
the upgrade.
664184
---
664184
 plugins/system_upgrade.py    | 3 +++
664184
 tests/test_system_upgrade.py | 1 +
664184
 2 files changed, 4 insertions(+)
664184
664184
diff --git a/plugins/system_upgrade.py b/plugins/system_upgrade.py
664184
index 6f6d40b..d9057ea 100644
664184
--- a/plugins/system_upgrade.py
664184
+++ b/plugins/system_upgrade.py
664184
@@ -155,6 +155,7 @@ class State(object):
664184
     best = _prop("best")
664184
     exclude = _prop("exclude")
664184
     install_packages = _prop("install_packages")
664184
+    install_weak_deps = _prop("install_weak_deps")
664184
 
664184
 # --- Plymouth output helpers -------------------------------------------------
664184
 
664184
@@ -391,6 +392,7 @@ class SystemUpgradeCommand(dnf.cli.Command):
664184
         self.base.conf.gpgcheck = self.state.gpgcheck
664184
         self.base.conf.best = self.state.best
664184
         self.base.conf.exclude = self.state.exclude
664184
+        self.base.conf.install_weak_deps = self.state.install_weak_deps
664184
         # don't try to get new metadata, 'cuz we're offline
664184
         self.cli.demands.cacheonly = True
664184
         # and don't ask any questions (we confirmed all this beforehand)
664184
@@ -544,6 +546,7 @@ class SystemUpgradeCommand(dnf.cli.Command):
664184
             state.system_releasever = system_ver
664184
             state.target_releasever = self.base.conf.releasever
664184
             state.install_packages = install_packages
664184
+            state.install_weak_deps = self.base.conf.install_weak_deps
664184
             state.enable_disable_repos = self.opts.repos_ed
664184
             state.destdir = self.base.conf.destdir
664184
         logger.info(DOWNLOAD_FINISHED_MSG)
664184
diff --git a/tests/test_system_upgrade.py b/tests/test_system_upgrade.py
664184
index 8f7e6de..ec85c97 100644
664184
--- a/tests/test_system_upgrade.py
664184
+++ b/tests/test_system_upgrade.py
664184
@@ -394,6 +394,7 @@ class DownloadCommandTestCase(CommandTestCase):
664184
         self.command.base.conf.releasever = "35"
664184
         self.command.base.conf.gpgcheck = True
664184
         self.command.base.conf.destdir = "/grape/wine"
664184
+        self.command.base.conf.install_weak_deps = True
664184
         self.command.transaction_download()
664184
         with system_upgrade.State() as state:
664184
             self.assertEqual(state.download_status, "complete")
664184
-- 
664184
2.19.1
664184