You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

59 lines
2.1 KiB

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