Blame SOURCES/BZ-1004853-yum-cron-handle-empty-transaction.patch

eb5f31
commit ae22bcdbacc01b12175304e14df59bdda45aa108
eb5f31
Author: Andreas Fleig <andreasfleig@googlemail.com>
eb5f31
Date:   Wed Mar 16 12:35:38 2016 +0100
eb5f31
eb5f31
    yum-cron: don't fail on empty transaction. BZ 1004853
eb5f31
    
eb5f31
    Even if refreshUpdates() returns True, the transaction may still be
eb5f31
    empty if some updateinfo filters were applied there and thus a later
eb5f31
    call to buildTransaction() would return 0 (success).  This wasn't
eb5f31
    handled by findDeps() properly, making it emit an error message in such
eb5f31
    a case.
eb5f31
    
eb5f31
    Note that, in the first place, we shouldn't return True from
eb5f31
    refreshUpdates() if the transaction becomes empty after applying the
eb5f31
    filters.  However, we should handle this particular buildTransaction()
eb5f31
    outcome in findDeps() regardless and that's sufficient to fix this bug.
eb5f31
    
eb5f31
    See also:
eb5f31
    http://lists.baseurl.org/pipermail/yum/2014-December/024141.html
eb5f31
eb5f31
diff --git a/yum-cron/yum-cron.py b/yum-cron/yum-cron.py
eb5f31
index ccba690..5c3c1f9 100755
eb5f31
--- a/yum-cron/yum-cron.py
eb5f31
+++ b/yum-cron/yum-cron.py
eb5f31
@@ -513,7 +513,13 @@ class YumCronBase(yum.YumBase, YumOutput):
eb5f31
         except yum.Errors.RepoError, e:
eb5f31
             self.emitCheckFailed("%s" %(e,))
eb5f31
             sys.exit()
eb5f31
-        if res != 2:
eb5f31
+        if res == 0:
eb5f31
+            # success, empty transaction
eb5f31
+            sys.exit(0)
eb5f31
+        elif res == 2:
eb5f31
+            # success, dependencies resolved
eb5f31
+            pass
eb5f31
+        else:
eb5f31
             self.emitCheckFailed("Failed to build transaction: %s" %(str.join("\n", resmsg),))
eb5f31
             sys.exit(1)
eb5f31
 
eb5f31
commit 485121311f4ff40b939965587db735b05aec6fe0
eb5f31
Author: Felix Kaiser <felix.kaiser@fxkr.net>
eb5f31
Date:   Wed Mar 16 13:16:13 2016 +0100
eb5f31
eb5f31
    yum-cron: fix exit code in findDeps()
eb5f31
eb5f31
diff --git a/yum-cron/yum-cron.py b/yum-cron/yum-cron.py
eb5f31
index 5c3c1f9..12c7720 100755
eb5f31
--- a/yum-cron/yum-cron.py
eb5f31
+++ b/yum-cron/yum-cron.py
eb5f31
@@ -512,7 +512,7 @@ class YumCronBase(yum.YumBase, YumOutput):
eb5f31
             (res, resmsg) = self.buildTransaction()
eb5f31
         except yum.Errors.RepoError, e:
eb5f31
             self.emitCheckFailed("%s" %(e,))
eb5f31
-            sys.exit()
eb5f31
+            sys.exit(1)
eb5f31
         if res == 0:
eb5f31
             # success, empty transaction
eb5f31
             sys.exit(0)