Blame SOURCES/BZ-1208803-autosavets.patch

d2a170
commit 8d5248c4ab3e8efab00537da8f35a77b86f3c333
d2a170
Author: Valentina Mukhamedzhanova <vmukhame@redhat.com>
d2a170
Date:   Fri May 6 11:30:56 2016 +0200
d2a170
d2a170
    Add autosavets option allowing to avoid autosaving transactions. BZ 1208803
d2a170
d2a170
diff --git a/docs/yum.conf.5 b/docs/yum.conf.5
d2a170
index efc6765..4d53c8e 100644
d2a170
--- a/docs/yum.conf.5
d2a170
+++ b/docs/yum.conf.5
d2a170
@@ -897,6 +897,12 @@ Note that if loadts_ignorerpm is True, this option does nothing.
d2a170
 Boolean (1, 0, True, False, yes, no) Defaults to False
d2a170
 
d2a170
 .IP
d2a170
+\fBautosavets\fR
d2a170
+Should yum automatically save a transaction to a file when the transaction is
d2a170
+solved but not run.
d2a170
+Boolean (1, 0, True, False, yes, no) Defaults to True
d2a170
+
d2a170
+.IP
d2a170
 \fBfssnap_automatic_pre\fR
d2a170
 Should yum try to automatically create a snapshot before it runs a transaction.
d2a170
 Boolean (1, 0, True, False, yes, no) Defaults to False
d2a170
diff --git a/yum/__init__.py b/yum/__init__.py
d2a170
index c896fff..764e97d 100644
d2a170
--- a/yum/__init__.py
d2a170
+++ b/yum/__init__.py
d2a170
@@ -1355,7 +1355,8 @@ much more problems).
d2a170
             self._depsolving_failed = False
d2a170
 
d2a170
         if rescode == 2:
d2a170
-            self.save_ts(auto=True)
d2a170
+            if self.conf.autosavets:
d2a170
+                self.save_ts(auto=True)
d2a170
 
d2a170
         # Make sure we don't fail in rpm if we're installing a package that is
d2a170
         # allowed multiple installs but has a newer version already installed.
d2a170
diff --git a/yum/config.py b/yum/config.py
d2a170
index 84be564..cae914d 100644
d2a170
--- a/yum/config.py
d2a170
+++ b/yum/config.py
d2a170
@@ -893,6 +893,7 @@ class YumConf(StartupConf):
d2a170
     loadts_ignoremissing = BoolOption(False)
d2a170
     loadts_ignorerpm = BoolOption(False)
d2a170
     loadts_ignorenewrpm = BoolOption(False)
d2a170
+    autosavets = BoolOption(True)
d2a170
     
d2a170
     clean_requirements_on_remove = BoolOption(False)
d2a170
 
d2a170
diff -up yum-3.4.3/test/testbase.py.old yum-3.4.3/test/testbase.py
d2a170
--- yum-3.4.3/test/testbase.py.old	2016-05-10 16:58:02.812286775 +0200
d2a170
+++ yum-3.4.3/test/testbase.py	2016-05-10 16:58:43.590544423 +0200
d2a170
@@ -69,6 +69,7 @@ class FakeConf(object):
d2a170
         self.diskspacecheck = True
d2a170
         self.depsolve_loop_limit = 10
d2a170
         self.override_install_langs = ''
d2a170
+        self.autosavets = True
d2a170
 
d2a170
 class FakeSack:
d2a170
     """ Fake PackageSack to use with FakeRepository"""